Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-5060

NPE when opening Process Definition view after performing a MI instance modification

    • Icon: Bug Report Bug Report
    • Resolution: Won't Fix
    • Icon: L3 - Default L3 - Default
    • 7.4.x, 7.5.x
    • 7.4.0
    • engine

      What are the steps to reproduce your problem?

      • Have a process instance with a multi-instance activity
      • Use Cockpit to start before the activity (not the MI body)
      • Apply modification
      • Go to process definition view

      What is the problem?

      • No tokens displayed in Process Definition view
      • Server Error:The server reported an internal error. Try to refresh the page or login and out of the application.
      • Stacktrace:
        11:30:58,154 WARNING [ExceptionHandler] (http-/127.0.0.1:8080-2) java.lang.NullPointerException
        	at org.camunda.bpm.engine.rest.dto.repository.ActivityStatisticsResultDto.fromActivityStatistics(ActivityStatisticsResultDto.java:26)
        	at org.camunda.bpm.engine.rest.sub.repository.impl.ProcessDefinitionResourceImpl.getActivityStatistics(ProcessDefinitionResourceImpl.java:219)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        	at java.lang.reflect.Method.invoke(Method.java:606)
        	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167)
        	at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257)
        	at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222)
        	at org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:159)
        	at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:107)
        	at org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:154)
        	at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:92)
        	at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542)
        	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524)
        	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126)
        	at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
        	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
        	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
        	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
        	at org.camunda.bpm.engine.rest.filter.CacheControlFilter.doFilter(CacheControlFilter.java:41)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
        	at org.camunda.bpm.webapp.impl.security.filter.SecurityFilter.doFilterSecure(SecurityFilter.java:67)
        	at org.camunda.bpm.webapp.impl.security.filter.SecurityFilter.doFilter(SecurityFilter.java:51)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
        	at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter$1.execute(AuthenticationFilter.java:59)
        	at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter$1.execute(AuthenticationFilter.java:56)
        	at org.camunda.bpm.webapp.impl.security.SecurityActions.runWithAuthentications(SecurityActions.java:38)
        	at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter.doFilter(AuthenticationFilter.java:56)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
        	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
        	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)
        	at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)
        	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145)
        	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
        	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)
        	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)
        	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
        	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
        	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920)
        	at java.lang.Thread.run(Thread.java:724)
        
        11:37:05,028 WARNING [ExceptionHandler] (http-/127.0.0.1:8080-1) java.lang.NullPointerException
        	at org.camunda.bpm.engine.rest.dto.repository.ActivityStatisticsResultDto.fromActivityStatistics(ActivityStatisticsResultDto.java:26)
        	at org.camunda.bpm.engine.rest.sub.repository.impl.ProcessDefinitionResourceImpl.getActivityStatistics(ProcessDefinitionResourceImpl.java:219)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        	at java.lang.reflect.Method.invoke(Method.java:606)
        	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167)
        	at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257)
        	at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222)
        	at org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:159)
        	at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:107)
        	at org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:154)
        	at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:92)
        	at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542)
        	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524)
        	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126)
        	at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
        	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
        	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
        	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
        	at org.camunda.bpm.engine.rest.filter.CacheControlFilter.doFilter(CacheControlFilter.java:41)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
        	at org.camunda.bpm.webapp.impl.security.filter.SecurityFilter.doFilterSecure(SecurityFilter.java:67)
        	at org.camunda.bpm.webapp.impl.security.filter.SecurityFilter.doFilter(SecurityFilter.java:51)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
        	at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter$1.execute(AuthenticationFilter.java:59)
        	at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter$1.execute(AuthenticationFilter.java:56)
        	at org.camunda.bpm.webapp.impl.security.SecurityActions.runWithAuthentications(SecurityActions.java:38)
        	at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter.doFilter(AuthenticationFilter.java:56)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
        	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
        	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
        	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)
        	at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)
        	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145)
        	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
        	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)
        	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)
        	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
        	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
        	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920)
        	at java.lang.Thread.run(Thread.java:724)
        

      What would be the expected behavior:

      • Process Definition view is displayed with tokens showing the status of instances.
      • No NPE

        This is the controller panel for Smart Panels app

            [CAM-5060] NPE when opening Process Definition view after performing a MI instance modification

            thorben.lindhauer let's investigate

            Robert Gimbel added a comment - thorben.lindhauer let's investigate

            Thorben Lindhauer added a comment - - edited

            Assessment:

            • the problem exists on the current master, 7.3 maintenance and 7.3.0
            • the problem exists with every operation that introduces concurrent execution in a scope where there was only a single path of execution before (i.e. process instance modification, non-interrupting boundary events, non-interrupting event sub processes, etc.)
            • for problem reason see below
            • I'm not 100% sure but from what I saw, this problem is not relevant for successful process execution (or else we should have some test failures)

            Reason:

            Solution ideas:

            • fix the isActive flag for these concurrent intermediate executions
            • make the activity statistics query more robust (i.e. use IS_ACTIVE_ = true and ACT_ID_ is not null as the condition); this should also be a fix for everyone who have the corrupt datastructure in their database

            Thorben Lindhauer added a comment - - edited Assessment: the problem exists on the current master, 7.3 maintenance and 7.3.0 the problem exists with every operation that introduces concurrent execution in a scope where there was only a single path of execution before (i.e. process instance modification, non-interrupting boundary events, non-interrupting event sub processes, etc.) for problem reason see below I'm not 100% sure but from what I saw, this problem is not relevant for successful process execution (or else we should have some test failures) Reason: whenever we create a new concurrent execution in a scope where there exists one active scope execution, we actually create two concurrent executions: one that becomes the new concurrent parent of the existing execution and one that is the actual new execution (see https://github.com/camunda/camunda-bpm-platform/blob/master/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java#L458-L465 ) the activity statistics query identifies leaf executions only by IS_ACTIVE_ = true and selects the activity ids for them (see https://github.com/camunda/camunda-bpm-platform/blob/master/engine/src/main/resources/org/camunda/bpm/engine/impl/mapping/entity/Statistics.xml#L396-L408 ) it therefore selects these concurrent executions that haven't got an activity id however => NullPointerException in postprocessing of statement result Solution ideas: fix the isActive flag for these concurrent intermediate executions make the activity statistics query more robust (i.e. use IS_ACTIVE_ = true and ACT_ID_ is not null as the condition); this should also be a fix for everyone who have the corrupt datastructure in their database

            The problem does not show in Cockpit on 7.3.0 and 7.3 maintenance release because the second part of the solution was already there. However, it was accidentally removed in this commit: https://github.com/camunda/camunda-bpm-platform/commit/441c5eaf79bba7fb19b5791e3b04204ce9e7d7f2#diff-287531d1e7c905a2bae35fa2d54586db

            Thorben Lindhauer added a comment - The problem does not show in Cockpit on 7.3.0 and 7.3 maintenance release because the second part of the solution was already there. However, it was accidentally removed in this commit: https://github.com/camunda/camunda-bpm-platform/commit/441c5eaf79bba7fb19b5791e3b04204ce9e7d7f2#diff-287531d1e7c905a2bae35fa2d54586db

            great analysis, thank you, we will not let this block our 7.4 release

            Robert Gimbel added a comment - great analysis, thank you, we will not let this block our 7.4 release

            I expect this to be fixed with CAM-5252. We should write a test for this case, though.

            Thorben Lindhauer added a comment - I expect this to be fixed with CAM-5252 . We should write a test for this case, though.

            We are closing this ticket as part of our backlog grooming. Reasons:

            • This problem does likely not exist anymore

            Thorben Lindhauer added a comment - We are closing this ticket as part of our backlog grooming. Reasons: This problem does likely not exist anymore

              Unassigned Unassigned
              matthijs.burke Matthijs
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: