com.atlassian.jira.util.dbc.Assertions$NullArgumentException: contentType should not be null!

Atlassian JIRA | Mike Knight | 3 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    *Steps to reproduce:* - Try to attach a file to an issue with a file that is larger than the configured maximum attachment size. *Expected results:* - The upload should not even be attempted, with the following error being returned: {quote} MYFILE.EXT is too large to attach. Attachment is 13.75 MB but the largest allowed attachment is 10.00 MB. {quote} *Actual results:* - The upload proceeds. - The following error is presented: {quote} Cannot attach file MYFILE.EXT: Unknown server error (500). {quote} - The following stack trace is produced: {noformat} 2013-09-09 11:59:06,186 TP-Processor2 ERROR sysadmin 719x4534x1 1jbsie1 200.210.150.226,131.103.26.193 /rest/internal/1.0/AttachTemporaryFile [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service com.atlassian.jira.util.dbc.Assertions$NullArgumentException: contentType should not be null! at com.atlassian.jira.util.dbc.Assertions.notNull(Assertions.java:29) at com.atlassian.jira.util.dbc.Assertions.notBlank(Assertions.java:122) at com.atlassian.jira.web.util.DefaultWebAttachmentManager.createTemporaryAttachment(DefaultWebAttachmentManager.java:143) at sun.reflect.GeneratedMethodAccessor1111.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.atlassian.plugin.osgi.hostcomponents.impl.DefaultComponentRegistrar$ContextClassLoaderSettingInvocationHandler.invoke(DefaultComponentRegistrar.java:129) at $Proxy354.createTemporaryAttachment(Unknown Source) at sun.reflect.GeneratedMethodAccessor1110.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58) at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56) at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy1089.createTemporaryAttachment(Unknown Source) at com.atlassian.jira.rest.v1.attachment.AttachTemporaryFileResource.addTemporaryAttachment(AttachTemporaryFileResource.java:114) ... {noformat} I know that this was not happening in 6.1-OD-04-1 but I'm not sure exactly which version introduced this problem.

    Atlassian JIRA | 3 years ago | Mike Knight
    com.atlassian.jira.util.dbc.Assertions$NullArgumentException: contentType should not be null!
  2. 0

    *Steps to reproduce:* - Try to attach a file to an issue with a file that is larger than the configured maximum attachment size. *Expected results:* - The upload should not even be attempted, with the following error being returned: {quote} MYFILE.EXT is too large to attach. Attachment is 13.75 MB but the largest allowed attachment is 10.00 MB. {quote} *Actual results:* - The upload proceeds. - The following error is presented: {quote} Cannot attach file MYFILE.EXT: Unknown server error (500). {quote} - The following stack trace is produced: {noformat} 2013-09-09 11:59:06,186 TP-Processor2 ERROR sysadmin 719x4534x1 1jbsie1 200.210.150.226,131.103.26.193 /rest/internal/1.0/AttachTemporaryFile [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service com.atlassian.jira.util.dbc.Assertions$NullArgumentException: contentType should not be null! at com.atlassian.jira.util.dbc.Assertions.notNull(Assertions.java:29) at com.atlassian.jira.util.dbc.Assertions.notBlank(Assertions.java:122) at com.atlassian.jira.web.util.DefaultWebAttachmentManager.createTemporaryAttachment(DefaultWebAttachmentManager.java:143) at sun.reflect.GeneratedMethodAccessor1111.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.atlassian.plugin.osgi.hostcomponents.impl.DefaultComponentRegistrar$ContextClassLoaderSettingInvocationHandler.invoke(DefaultComponentRegistrar.java:129) at $Proxy354.createTemporaryAttachment(Unknown Source) at sun.reflect.GeneratedMethodAccessor1110.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58) at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56) at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy1089.createTemporaryAttachment(Unknown Source) at com.atlassian.jira.rest.v1.attachment.AttachTemporaryFileResource.addTemporaryAttachment(AttachTemporaryFileResource.java:114) ... {noformat} I know that this was not happening in 6.1-OD-04-1 but I'm not sure exactly which version introduced this problem.

    Atlassian JIRA | 3 years ago | Mike Knight
    com.atlassian.jira.util.dbc.Assertions$NullArgumentException: contentType should not be null!

    Root Cause Analysis

    1. com.atlassian.jira.util.dbc.Assertions$NullArgumentException

      contentType should not be null!

      at com.atlassian.jira.util.dbc.Assertions.notNull()
    2. com.atlassian.jira
      DefaultWebAttachmentManager.createTemporaryAttachment
      1. com.atlassian.jira.util.dbc.Assertions.notNull(Assertions.java:29)
      2. com.atlassian.jira.util.dbc.Assertions.notBlank(Assertions.java:122)
      3. com.atlassian.jira.web.util.DefaultWebAttachmentManager.createTemporaryAttachment(DefaultWebAttachmentManager.java:143)
      3 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor1111.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3. java.lang.reflect.Method.invoke(Method.java:597)
      3 frames
    4. com.atlassian.plugin
      DefaultComponentRegistrar$ContextClassLoaderSettingInvocationHandler.invoke
      1. com.atlassian.plugin.osgi.hostcomponents.impl.DefaultComponentRegistrar$ContextClassLoaderSettingInvocationHandler.invoke(DefaultComponentRegistrar.java:129)
      1 frame
    5. Unknown
      $Proxy354.createTemporaryAttachment
      1. $Proxy354.createTemporaryAttachment(Unknown Source)
      1 frame
    6. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor1110.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3. java.lang.reflect.Method.invoke(Method.java:597)
      3 frames
    7. Spring AOP
      AopUtils.invokeJoinpointUsingReflection
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      1 frame
    8. Spring OSGi Core
      ServiceInvoker.invoke
      1. org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
      2. org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
      2 frames
    9. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      2. org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
      3. org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
      4. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      4 frames
    10. Spring OSGi Core
      ServiceTCCLInterceptor.invoke
      1. org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56)
      2. org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39)
      2 frames
    11. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      1 frame
    12. Spring OSGi Core
      LocalBundleContextAdvice.invoke
      1. org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
      1 frame
    13. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      2. org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
      3. org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
      4. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      5. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      5 frames
    14. Unknown
      $Proxy1089.createTemporaryAttachment
      1. $Proxy1089.createTemporaryAttachment(Unknown Source)
      1 frame
    15. com.atlassian.jira
      AttachTemporaryFileResource.addTemporaryAttachment
      1. com.atlassian.jira.rest.v1.attachment.AttachTemporaryFileResource.addTemporaryAttachment(AttachTemporaryFileResource.java:114)
      1 frame