Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-67304

Jira can't handle missing project for workflow scheme assocation

XMLWordPrintable

      How to reproduce

      1. Have a workflow scheme associated to project
      2. For this workflow scheme create row in nodeassociation table in Jira's database:
        INSERT INTO nodeassociation (
            source_node_id, 
            source_node_entity, 
            sink_node_id, 
            sink_node_entity, 
            association_type, 
            sequence
        )
        VALUES (
            <any id that doesn't belong to project>, 
            'Project', 
            <workflow scheme id>, 
            'WorkflowScheme', 
            'ProjectScheme', 
            null
        );
        

        replace <any id that doesn't belong to project> and <workflow scheme id> with proper ids.

      3. Reset caches with http request: DELETE /jira/rest/internal/1.0/cache/app
      4. Access issue type workflow viewer in project config

      Expected behaviour

      Workflow is shown

      Actual behaviour

      Error is thrown in log and workflow cache is not populated resulting in page not loading for any project.

      /rest/projectconfig/latest/issuetype/ABC/1/fields [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: java.lang.NullPointerException
      com.atlassian.cache.CacheException: java.lang.NullPointerException
      	at com.atlassian.cache.memory.DelegatingCachedReference.get(DelegatingCachedReference.java:84)
      	at com.atlassian.jira.cache.SingleValueLocalCache$2.get(SingleValueLocalCache.java:71)
      	at com.atlassian.jira.workflow.DefaultWorkflowSchemeManager.getActiveWorkflowNames(DefaultWorkflowSchemeManager.java:408)
      	at com.atlassian.jira.workflow.OSWorkflowManager.getSchemeActiveWorkflows(OSWorkflowManager.java:175)
      	at com.atlassian.jira.workflow.OSWorkflowManager.getActiveWorkflows(OSWorkflowManager.java:161)
      	at com.atlassian.jira.issue.fields.screen.DefaultProjectFieldScreenHelper.getProjectsForFieldScreen(DefaultProjectFieldScreenHelper.java:54)
      	... 2 filtered
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
      	at com.sun.proxy.$Proxy503.getProjectsForFieldScreen(Unknown Source)
      	... 2 filtered
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
      	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)
      	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70)
      	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      	at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
      	at com.sun.proxy.$Proxy1704.getProjectsForFieldScreen(Unknown Source)
      	at com.atlassian.jira.projectconfig.issuetypes.fields.DefaultIssueTypeConfigFieldsHelper.getOtherProjectsSharingScreen(DefaultIssueTypeConfigFieldsHelper.java:63)
      	at com.atlassian.jira.projectconfig.issuetypes.fields.DefaultIssueTypeConfigFieldsHelper.getFieldsData(DefaultIssueTypeConfigFieldsHelper.java:46)
      	at com.atlassian.jira.projectconfig.rest.project.IssueTypeConfigFieldsResource.getFieldsData(IssueTypeConfigFieldsResource.java:45)
      	... 3 filtered
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	... 18 filtered
      	at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:154)
      	... 1 filtered
      	at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:68)
      	... 36 filtered
      	at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
      	... 42 filtered
      	at com.resolution.atlasplugins.samlsso.servlet.RedirectToSsoFilter.doFilter(RedirectToSsoFilter.java:52)
      	... 14 filtered
      	at com.atlassian.jira.security.JiraSecurityFilter.lambda$doFilter$0(JiraSecurityFilter.java:76)
      	... 1 filtered
      	at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:74)
      	... 16 filtered
      	at com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:37)
      	... 20 filtered
      	at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(CorrelationIdPopulatorFilter.java:30)
      	... 10 filtered
      	at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
      	... 4 filtered
      	at com.atlassian.web.servlet.plugin.LocationCleanerFilter.doFilter(LocationCleanerFilter.java:36)
      	... 29 filtered
      	at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25)
      	... 27 filtered
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: java.lang.NullPointerException
      	at java.util.Comparator.lambda$comparing$77a9974f$1(Comparator.java:469)
      	at java.util.TimSort.countRunAndMakeAscending(TimSort.java:355)
      	at java.util.TimSort.sort(TimSort.java:220)
      	at java.util.Arrays.sort(Arrays.java:1512)
      	at java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:348)
      	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
      	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
      	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
      	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
      	at com.atlassian.jira.scheme.AbstractSchemeManager.getProjects(AbstractSchemeManager.java:481)
      	at com.atlassian.jira.workflow.DefaultWorkflowSchemeManager$WorkflowSupplier.get(DefaultWorkflowSchemeManager.java:1045)
      	at com.atlassian.jira.workflow.DefaultWorkflowSchemeManager$WorkflowSupplier.get(DefaultWorkflowSchemeManager.java:1036)
      	at com.atlassian.cache.memory.MemoryCacheManager$1$1.load(MemoryCacheManager.java:93)
      	at com.atlassian.cache.memory.MemoryCacheManager$1$1.load(MemoryCacheManager.java:69)
      	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527)
      	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2319)
      	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2282)
      	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2197)
      	at com.google.common.cache.LocalCache.get(LocalCache.java:3937)
      	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3941)
      	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4824)
      	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4830)
      	at com.atlassian.cache.memory.DelegatingCachedReference.getUnderLock(DelegatingCachedReference.java:94)
      	at com.atlassian.cache.memory.DelegatingCachedReference.get(DelegatingCachedReference.java:79)
      	... 270 more
      

              Unassigned Unassigned
              pczuj Przemyslaw Czuj
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: