Error flushing statements

I’m getting so many error to flush statements in my process. Its getting very annoying coz i need to keep retrying the incidents. In some number between 800 process instances, i’m getting like 50 errors… I’ve updated my BPMN with some ASYNC BEFORE or ASYNC AFTER only to save some info and dont lose my entire process. I cant give you any test case coz it happens in any service task. Sometimes in service task A, sometimes in service task B.

I have a lot of timers in my process, and a lot of these errors happens when the timer completes.

Another strange error i get is “org.camunda.bpm.engine.ProcessEngineException: Unknown property used in expression: ${myDelegate}.”. Its happening a lot when I retry the incidents in cockpit.

I have my class correct, and the bean name is exactly like the class name but with first letter lowercase. Many process find my delegate, but some gives this error and i have to retry it. How could it find the delegate sometimes and sometimes not??? I’m using only the @component annotation in my delegates.

Iam using spring boot starter 2.0.2.RELEASE and camunda springboot starter 3.0.0.
Also using mysql as database, and deploying my camunda in docker with 3 containers, using the sabe database.

Do you have any ideas of what its happening?? We already have many process definitions, in different java projects, different servers and databases, but in every camunda process we get these types of annoying errors.

July 4th 2018, 16:43:58.024	### Error flushing statements.  Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.deleteByteArray (batch index #6) failed. 5 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails (`camunda`.`ACT_RU_VARIABLE`, CONSTRAINT `ACT_FK_VAR_BYTEARRAY` FOREIGN KEY (`BYTEARRAY_ID_`) REFERENCES `ACT_GE_BYTEARRAY` (`ID_`))
July 4th 2018, 16:43:58.023	### Error flushing statements.  Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.deleteByteArray (batch index #6) failed. 5 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails (`camunda`.`ACT_RU_VARIABLE`, CONSTRAINT `ACT_FK_VAR_BYTEARRAY` FOREIGN KEY (`BYTEARRAY_ID_`) REFERENCES `ACT_GE_BYTEARRAY` (`ID_`))
July 4th 2018, 16:43:58.022	### Error flushing statements.  Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.deleteByteArray (batch index #6) failed. 5 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails (`camunda`.`ACT_RU_VARIABLE`, CONSTRAINT `ACT_FK_VAR_BYTEARRAY` FOREIGN KEY (`BYTEARRAY_ID_`) REFERENCES `ACT_GE_BYTEARRAY` (`ID_`))
July 4th 2018, 16:43:58.021	### Error flushing statements.  Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.deleteByteArray (batch index #6) failed. 5 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails (`camunda`.`ACT_RU_VARIABLE`, CONSTRAINT `ACT_FK_VAR_BYTEARRAY` FOREIGN KEY (`BYTEARRAY_ID_`) REFERENCES `ACT_GE_BYTEARRAY` (`ID_`))
July 4th 2018, 16:43:58.020	### Error flushing statements.  Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.deleteByteArray (batch index #6) failed. 5 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails (`camunda`.`ACT_RU_VARIABLE`, CONSTRAINT `ACT_FK_VAR_BYTEARRAY` FOREIGN KEY (`BYTEARRAY_ID_`) REFERENCES `ACT_GE_BYTEARRAY` (`ID_`))
July 4th 2018, 16:43:58.019	### Error flushing statements.  Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.deleteByteArray (batch index #6) failed. 5 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Cannot delete or update a parent row: a foreign key constraint fails (`camunda`.`ACT_RU_VARIABLE`, CONSTRAINT `ACT_FK_VAR_BYTEARRAY` FOREIGN KEY (`BYTEARRAY_ID_`) REFERENCES `ACT_GE_BYTEARRAY` (`ID_`))

Hi Jean,

I was wondering if you found a solution to the FK errors. We have been experiencing this same error (FK on ACT_GE_BYTEARRAY) for some tine now, and have not figured out the root cause. Any hints would be great!

Thanks,
Galen

Hi @Jean_Robert_Alves

I have the same issue. What did you do to fix this error ?

### Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.deleteByteArrayNoRevisionCheck (batch index #4) failed. 3 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Batch entry 0 delete from ACT_GE_BYTEARRAY where ID_ = '29820e10-6a8e-11e9-af24-96773572eef7' was aborted.  Call getNextException to see the cause.
java.sql.BatchUpdateException: Batch entry 0 delete from ACT_GE_BYTEARRAY where ID_ = '29820e10-6a8e-11e9-af24-96773572eef7' was aborted.  Call getNextException to see the cause.
org.postgresql.util.PSQLException: ERROR: update or delete on table "act_ge_bytearray" violates foreign key constraint "act_fk_job_exception" on table "act_ru_job"
  Detail: Key (id_)=(29820e10-6a8e-11e9-af24-96773572eef7) is still referenced from table "act_ru_job".
'. Flush summary: 
 [
  INSERT HistoricJobLogEventEntity[29976ae1-6a8e-11e9-af24-96773572eef7]
  INSERT HistoricActivityInstanceEventEntity[ExclusiveGateway_1qhwq0p:2996f5b0-6a8e-11e9-af24-96773572eef7]
  DELETE MessageEntity[29245d95-6a8e-11e9-af24-96773572eef7]
  DELETE_BULK deleteByteArrayNoRevisionCheck 29820e10-6a8e-11e9-af24-96773572eef7
  UPDATE ExecutionEntity[289dc844-6a8e-11e9-af24-96773572eef7]
  UPDATE ExecutionEntity[2441e7c9-6a8e-11e9-af24-96773572eef7]
]
	at org.camunda.bpm.engine.impl.db.EnginePersistenceLogger.flushDbOperationsException(EnginePersistenceLogger.java:698)
	at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flushDbOperations(DbEntityManager.java:355)
	at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flushDbOperationManager(DbEntityManager.java:318)
	at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flush(DbEntityManager.java:290)
	at org.camunda.bpm.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:203)
	at org.camunda.bpm.engine.impl.interceptor.CommandContext.close(CommandContext.java:132)
	at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:113)
	at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:66)
	at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
	at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobHelper.executeJob(ExecuteJobHelper.java:36)
	at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobHelper.executeJob(ExecuteJobHelper.java:29)
	at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.executeJob(ExecuteJobsRunnable.java:88)
	at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunnable.java:57)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Same problem, still not fixed.