Database Exception when Running Workflow Instance

We are running Camunda 7.11.0 with a MySQL DB.

When running a certain workflow, we consistently get the following database exception. It appears to be happening at the sync point for a user task which is run after several service tasks, some of which have been explicitly marked as Async Continue.

Does anyone have any ideas of what might be the cause of this.

20-Nov-2019 20:41:21.863 SEVERE [pool-2-thread-1] org.camunda.commons.logging.BaseLogger.logError ENGINE-16004 Exception while closing command context: ENGINE-03083 Exception while executing Batch Database Operations with message '
### Error flushing statements.  Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.insertExecution (batch index #8) failed. 7 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Cannot add or update a child row: a foreign key constraint fails (`dtm_camunda_dev`.`ACT_RU_EXECUTION`, CONSTRAINT `ACT_FK_EXE_PARENT` FOREIGN KEY (`PARENT_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`))
### Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.insertExecution (batch index #8) failed. 7 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Cannot add or update a child row: a foreign key constraint fails (`dtm_camunda_dev`.`ACT_RU_EXECUTION`, CONSTRAINT `ACT_FK_EXE_PARENT` FOREIGN KEY (`PARENT_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`))
java.sql.BatchUpdateException: Cannot add or update a child row: a foreign key constraint fails (`dtm_camunda_dev`.`ACT_RU_EXECUTION`, CONSTRAINT `ACT_FK_EXE_PARENT` FOREIGN KEY (`PARENT_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`))
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`dtm_camunda_dev`.`ACT_RU_EXECUTION`, CONSTRAINT `ACT_FK_EXE_PARENT` FOREIGN KEY (`PARENT_ID_`) REFERENCES `ACT_RU_EXECUTION` (`ID_`))
'. Flush summary: 
 [
  INSERT HistoricVariableInstanceEntity[17edab8d-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableInstanceEntity[17edd2a0-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableInstanceEntity[17edd2a2-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableInstanceEntity[17edf9b4-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableInstanceEntity[17edf9b6-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableInstanceEntity[17edf9b8-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableInstanceEntity[1b4ab852-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableInstanceEntity[1b4ab854-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableInstanceEntity[1b4adf66-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableInstanceEntity[1b562a0f-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricJobLogEventEntity[1b68c7b4-0bd6-11ea-b284-0242ac120004]
  INSERT AuthorizationEntity[1b5c1d82-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableUpdateEventEntity[17edab8f-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableUpdateEventEntity[17edd2a1-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableUpdateEventEntity[17edd2a3-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableUpdateEventEntity[17edf9b5-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableUpdateEventEntity[17edf9b7-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableUpdateEventEntity[17edf9b9-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableUpdateEventEntity[17edf9ba-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableUpdateEventEntity[185e6ecb-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableUpdateEventEntity[18654c9c-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableUpdateEventEntity[187244ed-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableUpdateEventEntity[1b4ab853-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableUpdateEventEntity[1b4ab855-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableUpdateEventEntity[1b4adf67-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableUpdateEventEntity[1b4adf68-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableUpdateEventEntity[1b53e019-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableUpdateEventEntity[1b54072a-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableUpdateEventEntity[1b54072b-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricVariableUpdateEventEntity[1b562a10-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricTaskInstanceEventEntity[1b562a11-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricIdentityLinkLogEventEntity[1b5c1d83-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricActivityInstanceEventEntity[14a5fa99-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricActivityInstanceEventEntity[18783861-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricActivityInstanceEventEntity[1b542e3c-0bd6-11ea-b284-0242ac120004]
  INSERT HistoricActivityInstanceEventEntity[1b562a0e-0bd6-11ea-b284-0242ac120004]
  INSERT ExecutionEntity[1b562a0d-0bd6-11ea-b284-0242ac120004]
  INSERT TaskEntity[1b562a11-0bd6-11ea-b284-0242ac120004]
  INSERT VariableInstanceEntity[17edab8d-0bd6-11ea-b284-0242ac120004]
  INSERT VariableInstanceEntity[17edd2a0-0bd6-11ea-b284-0242ac120004]
  INSERT VariableInstanceEntity[17edd2a2-0bd6-11ea-b284-0242ac120004]
  INSERT VariableInstanceEntity[17edf9b4-0bd6-11ea-b284-0242ac120004]
  INSERT VariableInstanceEntity[17edf9b6-0bd6-11ea-b284-0242ac120004]
  INSERT VariableInstanceEntity[17edf9b8-0bd6-11ea-b284-0242ac120004]
  INSERT VariableInstanceEntity[1b4ab852-0bd6-11ea-b284-0242ac120004]
  INSERT VariableInstanceEntity[1b4ab854-0bd6-11ea-b284-0242ac120004]
  INSERT VariableInstanceEntity[1b4adf66-0bd6-11ea-b284-0242ac120004]
  INSERT VariableInstanceEntity[1b562a0f-0bd6-11ea-b284-0242ac120004]
  DELETE MessageEntity[125ccde3-0bd6-11ea-b284-0242ac120004]
  UPDATE VariableInstanceEntity[02cf53bf-0bd6-11ea-b284-0242ac120004]
  UPDATE VariableInstanceEntity[02cf53c1-0bd6-11ea-b284-0242ac120004]
  UPDATE VariableInstanceEntity[02cf7ad3-0bd6-11ea-b284-0242ac120004]
  UPDATE VariableInstanceEntity[1082ddab-0bd6-11ea-b284-0242ac120004]
  UPDATE VariableInstanceEntity[1242dd3a-0bd6-11ea-b284-0242ac120004]
  UPDATE ExecutionEntity[0d7eec5f-0bd6-11ea-b284-0242ac120004]
  UPDATE HistoricVariableInstanceEntity[02cf53c1-0bd6-11ea-b284-0242ac120004]
]

digsig-harrision.bpmn (73.7 KB)

Can you upload the workflow in question?

I did do that. Do you not see the upload named digsig-harrision.bpmn?

Note that the failure looks like it might be occurring at the user task named “View File”. We see evidence that the workflow is then rolling back to the service task named “Digital Signature”.

I have a feeling that the problem might be related to the parallel branch named “Fill & SIgn (Parallel Branch”. Note that there is not a merge associated with the branch. So there might be something going on with the two user tasks “FIll & SIgn (Wait Task)” and “View File” running concurrently. Ideally, there should be a merge of the parallel branches, after the script task “Fill & Sign (Burn Complete)”. I haven’t had a chance to try this yet to see if it resolves the issue.

Update: I have inserted the parallel branch merge at the desired location in the model and I am no longer experiencing the failure. So this seems to have solved it.

But I do wonder, are there potential, inherent issues with parallel branches? For example, if there are two parallel branches, with a user task on each branch, is there a potential problem if those user tasks are hit concurrently, causing sync points, and thus DB synchronization, to happen concurrently? Also, we need to be concerned with potentially updating process variables concurrently on parallel branches?