Null pointer exception while job execution

Hi Folks,

I’m getting below null pointer exception frequently on my application. i’m using camunda platform 7, springboot embedded process engine, and application connected to a 5 node Mysql cluster. apps are being deployed in an active active mode.

The exception is on setParent method of PvmExecutionImpl class. my process model is simple, without any sub process or not being called from a sub process. not understanding why still this setParent method is getting called when it doesn’t have a parent process instance. please help if any one knows why this behaviour.


java.lang.NullPointerException
        at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.setParent(PvmExecutionImpl.java:1383)
        at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.createExecution(ExecutionEntity.java:262)
        at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.createExecution(ExecutionEntity.java:99)
        at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationCreateScope.execute(PvmAtomicOperationCreateScope.java:40)
        at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationCreateScope.execute(PvmAtomicOperationCreateScope.java:28)
        at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:99)
        at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.invokeNext(CommandInvocationContext.java:131)
        at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext.performNext(CommandInvocationContext.java:118)
        at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext$1.call(CommandInvocationContext.java:102)
        at org.camunda.bpm.engine.impl.interceptor.CommandInvocationContext$1.call(CommandInvocationContext.java:100) ```

Attaching my process model for reference.

[StarterPackProvisioning.bpmn|attachment](upload://uTOqxqY5CCbjreqnHO4bt1Jpt1o.bpmn) (28.3 KB)

Hi @_akhil ,

first of all, can you please reupload the attached process model? It seems like it is not correctly embedded.

Towards you question: The java docs of a PvmScope (also inherited by activities) describe that every element that has an own scope (also called local scope) needs a separate scope execution to be created (JavaDocs of PvmScope#isScope). So, this is what happens, it tries to create a child scope for your activity.

Without knowing your specific process model I am not able to give you any more help. I hope it already gives you a little insight on what is happening.

Kind regards,
Adagatiya

Hi @Adagatiya

Thanks for your response. reattaching my process model.

StarterPackProvisioning.bpmn (28.3 KB)

Hi @_akhil ,

sadly I am not able to reproduce locally using an in-memory database.

The only constellation I can imagine this error happening is database lookup to not find the parent execution (your process) in the database (refering to ExecutionEntity.java#L1273). Just for the sake of completeness, I assumed you did not change the flag isExecutionTreePrefetchEnabled in your process engine configuration which is enabled by default.

Could you please check if this error keeps happening if you only have a single node cluster behind Camunda?

Kind regards
Adagatiya

Hi @Adagatiya

Thanks a lot for your help and guidance.

We haven’t faced this issue when connected to a single node cluster. it was working fine without any errors. we recently started to notice these errors in our production server, where it was changed to a 5 node cluster from a 3 node one.

Also this error does not occur more frequently. less than 1% of process instances will fail with this error. for instance, we have tested a load with 25k process instance creation, among 25k, 11 of them failed with this error. we could complete the failed process instance from the cockpit after sometime, by opening the incidents and retrying the job.

As a workaround, now I’m trying to retry such jobs automatically by leveraging retry functionality of job executor. if you find any new observations or solution to this problem, kindly share with me.

Thanks & Regards
Akhil