Error when trying to cancel process

Error when trying to cancel process

When I try to cancel a process through API or cockpit, I’m getting the following error:

18-06-2018 18:45:57 [http-nio-8080-exec-19] ERROR org.camunda.commons.logging.BaseLogger.logError 156 - ENGINE-16004 Exception while closing command context: null
java.lang.NullPointerException: null
	at org.camunda.bpm.engine.impl.persistence.entity.TaskEntity.delete(TaskEntity.java:271) ~[camunda-engine-7.4.0.jar:7.4.0]
	at org.camunda.bpm.engine.impl.persistence.entity.TaskEntity.delete(TaskEntity.java:277) ~[camunda-engine-7.4.0.jar:7.4.0]
	at org.camunda.bpm.engine.impl.persistence.entity.TaskManager.deleteTasksByProcessInstanceId(TaskManager.java:53) ~[camunda-engine-7.4.0.jar:7.4.0]
	at org.camunda.bpm.engine.impl.persistence.entity.ExecutionManager.deleteProcessInstance(ExecutionManager.java:78) ~[camunda-engine-7.4.0.jar:7.4.0]
	at  

Seems that it is trying to delete 2 tasks but there is only one user task at this point of the process.

When I check the process in Camunda cockpit, it is showing only one active task in the BPMN, but 2 in the list.

The weird thing is the first activity (task id 3416be8e-4f90-11e7-9ef…) which has no name. The second activity is right.

Does someone has any idea about how to solve this problem?

Hi Denis,

It seems that you’re using Camunda 7.4 which isn’t one of the latest versions.
Could you please try to reproduce the issue with 7.9.
Maybe this has been resolve in the gap of 5 releases. :thinking:

Best regards,
Yana

Hi Yana! Thanks for your reply!

You’re right, we’re using Camunda 7.4. The problem is that this issue is in production :frowning:

Is there any workaround to solve this issue besides migrate to Camunda 7.9?

Thanks!

Hi Denis,

The phantom task also is quite old 12.06.2017. Do you know something about it?
If you want you can try to remove it from the database.
However this action always needs to be perform with caution.

Best regards,
Yana

Hi Yana!

Unfortunately, I wasn’t aware of these phantom tasks.

So, the way will be deleting all data related to this process from database…

Alright then. Thanks!

Best regards,
Denis