Unable to complete last task of workflow

At a time of complete last task of the workflow.

{“errorMsg”: "org.camunda.bpm.engine.ProcessEngineException: ENGINE-03004 Exception while executing Database Operation ‘DELETE ExecutionEntity[4500429]’ with message ’

Error flushing statements. Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.deleteExecution (batch index #3) failed. 2 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: (conn=123536) Cannot delete or update a parent row: a foreign key constraint fails

Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.deleteExecution (batch index #3) failed. 2 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: (conn=123536) Cannot delete or update a parent row: a foreign key constraint fails’. Flush summary:

[
INSERT HistoricActivityInstanceEventEntity[Event_11yjpx5:4500435]
DELETE TaskEntity[4500434]
DELETE ExecutionEntity[4500429]
UPDATE HistoricActivityInstanceEventEntity[Activity_132yx3q:4500433]
UPDATE HistoricProcessInstanceEventEntity[4500429]
UPDATE HistoricTaskInstanceEventEntity[4500434]
]"}

Can you take a look at the Style Guide? It’ll help you understand how to format code correctly and also help you create questions that are easy to understand and also easier to answer :slight_smile:

environment

  1. 7.13.0 version
  2. Spring boot 2.2.5
  3. Mysql cluster
  4. Setup application from single MySQL schema to cluster environment

Logger

{
@timestamp”: “2020-12-23T15:35:52.437+09:00”,
@version”: “1”,
“message”: “ENGINE-16004 Exception while closing command context: ENGINE-03004 Exception while executing Database Operation ‘DELETE ExecutionEntity[4500429]’ with message ‘### Error flushing statements. Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.deleteExecution (batch index #3) failed. 2 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: (conn=123466) Cannot delete or update a parent row: a foreign key constraint fails### Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.deleteExecution (batch index #3) failed. 2 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: (conn=123466) Cannot delete or update a parent row: a foreign key constraint fails’. Flush summary: [ INSERT HistoricActivityInstanceEventEntity[Event_11yjpx5:4500452] DELETE TaskEntity[4500434] DELETE ExecutionEntity[4500429] UPDATE HistoricActivityInstanceEventEntity[Activity_132yx3q:4500433] UPDATE HistoricProcessInstanceEventEntity[4500429] UPDATE HistoricTaskInstanceEventEntity[4500434]]”,
“logger_name”: “org.camunda.bpm.engine.context”,
“thread_name”: “http-nio-8081-exec-6”,
“level”: “ERROR”,
“level_value”: 40000,
“stack_trace”: “<#25eb963a> j.sql.SQLException: Cannot delete or update a parent row: a foreign key constraint fails\tat o.m.j.i.p.AbstractQueryProtocol.readErrorPacket(AbstractQueryProtocol.java:1674)\tat o.m.j.i.p.AbstractQueryProtocol.readPacket(AbstractQueryProtocol.java:1536)\tat o.m.j.i.p.AbstractQueryProtocol.getResult(AbstractQueryProtocol.java:1499)\tat o.m.j.i.p.AsyncMultiRead.call(AsyncMultiRead.java:150)\t… 5 common frames omittedWrapped by: <#fc558c28> o.m.j.i.u.e.MariaDbSqlException: Cannot delete or update a parent row: a foreign key constraint fails\tat o.m.j.i.u.e.MariaDbSqlException.of(MariaDbSqlException.java:34)\tat o.m.j.i.p.AbstractQueryProtocol.exceptionWithQuery(AbstractQueryProtocol.java:194)\tat o.m.j.i.p.AbstractQueryProtocol.access$000(AbstractQueryProtocol.java:108)\tat o.m.j.i.p.AbstractQueryProtocol$1.handleResultException(AbstractQueryProtocol.java:687)\tat o.m.j.i.p.AsyncMultiRead.call(AsyncMultiRead.java:159)\tat o.m.j.i.p.AsyncMultiRead.call(AsyncMultiRead.java:68)\tat j.u.c.FutureTask.run(FutureTask.java:266)\tat j.u.c.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\tat j.u.c.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\t… 1 common frames omittedWrapped by: <#ae654121> j.s.SQLIntegrityConstraintViolationException: (conn=123466) Cannot delete or update a parent row: a foreign key constraint fails\tat o.m.j.i.u.e.ExceptionFactory.createException(ExceptionFactory.java:70)\tat o.m.j.i.u.e.ExceptionFactory.create(ExceptionFactory.java:153)\tat o.m.j.MariaDbStatement.executeBatchExceptionEpilogue(MariaDbStatement.java:319)\t… 188 common frames omittedWrapped by: <#34722360> j.s.BatchUpdateException: (conn=123466) Cannot delete or update a parent row: a foreign key constraint fails\tat o.m.j.MariaDbStatement.executeBatchExceptionEpilogue(MariaDbStatement.java:323)\tat o.m.j.ClientSidePreparedStatement.executeBatch(ClientSidePreparedStatement.java:301)\tat c.z.h.p.ProxyStatement.executeBatch(ProxyStatement.java:128)\tat c.z.h.p.HikariProxyPreparedStatement.execute…”
}

This exception occurred at the time of complete the last task of the workflow.
is it possible camunda will work on multi-tenancy.

or I need to remove the delete cascade to execute smoothly on multi-instance DB

Query
what is the disadvantage of removing the delete/update constraint if I do?

Can you pay particular attention to the formatting mentioned in the style guide, your formatting makes it very hard to read what you’ve written.

I just upload h logger nothing more

@Nele or anyone can you please let me know about this issue ??

Caused by: org.camunda.bpm.engine.ProcessEngineException: ENGINE-03004 Exception while executing Database Operation 'INSERT VariableInstanceEntity[5a0603b9-3507-11ed-a731-005056a2e07e]' with message '
### Error flushing statements.  Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.insertVariableInstance (batch index #3) failed. 2 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: ORA-01461: can bind a LONG value only for insert into a LONG column

### Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.insertVariableInstance (batch index #3) failed. 2 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: ORA-01461: can bind a LONG value only for insert into a LONG column

java.sql.BatchUpdateException: ORA-01461: can bind a LONG value only for insert into a LONG column

java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column

'. Flush summary: 
 [
  INSERT ExecutionEntity[5a04cb34-3507-11ed-a731-005056a2e07e]
  INSERT ExecutionEntity[5b902631-3507-11ed-a731-005056a2e07e]
  INSERT ByteArrayEntity[5b8e9f8e-3507-11ed-a731-005056a2e07e]
  INSERT VariableInstanceEntity[5a0603b5-3507-11ed-a731-005056a2e07e]
  INSERT VariableInstanceEntity[5a0603b6-3507-11ed-a731-005056a2e07e]
  INSERT VariableInstanceEntity[5a0603b7-3507-11ed-a731-005056a2e07e]
  INSERT VariableInstanceEntity[5a0603b8-3507-11ed-a731-005056a2e07e]
  INSERT VariableInstanceEntity[5a0603b9-3507-11ed-a731-005056a2e07e]
  INSERT VariableInstanceEntity[5a062aca-3507-11ed-a731-005056a2e07e]
  INSERT VariableInstanceEntity[5a8c23ad-3507-11ed-a731-005056a2e07e]
  INSERT VariableInstanceEntity[5b8fd80f-3507-11ed-a731-005056a2e07e]
  INSERT VariableInstanceEntity[5b8fff20-3507-11ed-a731-005056a2e07e]
  INSERT ExternalTaskEntity[5b99ea33-3507-11ed-a731-005056a2e07e]
]
	at org.camunda.bpm.engine.impl.db.EnginePersistenceLogger.flushDbOperationException(EnginePersistenceLogger.java:132) ~[camunda-engine-7.17.0.jar:7.17.0]
	... 104 common frames omitted
Caused by: org.apache.ibatis.exceptions.PersistenceException: 
### Error flushing statements.  Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.insertVariableInstance (batch index #3) failed. 2 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: ORA-01461: can bind a LONG value only for insert into a LONG column

### Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.insertVariableInstance (batch index #3) failed. 2 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: ORA-01461: can bind a LONG value only for insert into a LONG column

	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) ~[mybatis-3.5.6.jar:3.5.6]
	at org.apache.ibatis.session.defaults.DefaultSqlSession.flushStatements(DefaultSqlSession.java:254) ~[mybatis-3.5.6.jar:3.5.6]
	at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.flushBatchOperations(DbSqlSession.java:444) ~[camunda-engine-7.17.0.jar:7.17.0]
	at org.camunda.bpm.engine.impl.db.sql.BatchDbSqlSession.executeDbOperations(BatchDbSqlSession.java:74) ~[camunda-engine-7.17.0.jar:7.17.0]
	at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flushDbOperations(DbEntityManager.java:341) ~[camunda-engine-7.17.0.jar:7.17.0]

Environment:

  1. JDK 11,
  2. SpringBoot-2.7.1
  3. Camunda-Engine -7.17

@yadav1990 can you please share workflow xml for better understanding. as pr
logs i can predict you are going to execute something in asynchronously and while updating variable data your are getting this exception.

1 more thing what is the value of jdbc batch processing in your camunda process engine configuration.

@pinturjs the issue got resolved and can’t share the workflow but the issue was with externalTask ,seems external task have some limitation on variable length so I am saving the variable as json not string literal.

1 Like