My application is implemented with Camunda 7 and Mysql 8.0.30 both running on Dockers. Everthing works fine but sometime we have errors related with Database in the Camunda ouput. Camunda keeps working but slowly for some time until recover. Looks like some issue related with “insertAuthorization” on some request. Any ideia to fix my problem?
The error message is that:
SEVERE [http-nio-8080-exec-12940] org.camunda.commons.logging.BaseLogger.logError ENGINE-16004 Exception while closing command context: An exception occurred in the persistence layer. Please check the server logs for a detailed message and the entire exception stack trace.
org.camunda.bpm.engine.ProcessEngineException: An exception occurred in the persistence layer. Please check the server logs for a detailed message and the entire exception stack trace.
at org.camunda.bpm.engine.impl.util.ExceptionUtil.wrapPersistenceException(ExceptionUtil.java:263)
at org.camunda.bpm.engine.impl.db.EnginePersistenceLogger.flushDbOperationException(EnginePersistenceLogger.java:132)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flushDbOperations(DbEntityManager.java:364)
…
Caused by: org.camunda.bpm.engine.ProcessEngineException: ENGINE-03004 Exception while executing Database Operation ‘INSERT AuthorizationEntity[7b692910-a7b2-11ed-8cf1-02425542710d]’ with message ’
### Error flushing statements. Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.AuthorizationEntity.insertAuthorization (batch index #2) failed. 1 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Duplicate entry ‘isabel.martins-1-7-3133d097-a7b2-11ed-8cf1-02425542710d’ for key ‘ACT_RU_AUTHORIZATION.ACT_UNIQ_AUTH_USER’
Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.AuthorizationEntity.insertAuthorization (batch index #2) failed. 1 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Duplicate entry ‘isabel.martins-1-7-3133d097-a7b2-11ed-8cf1-02425542710d’ for key ‘ACT_RU_AUTHORIZATION.ACT_UNIQ_AUTH_USER’
java.sql.BatchUpdateException: Duplicate entry ‘isabel.martins-1-7-3133d097-a7b2-11ed-8cf1-02425542710d’ for key ‘ACT_RU_AUTHORIZATION.ACT_UNIQ_AUTH_USER’
java.sql.SQLIntegrityConstraintViolationException: Duplicate entry ‘isabel.martins-1-7-3133d097-a7b2-11ed-8cf1-02425542710d’ for key ‘ACT_RU_AUTHORIZATION.ACT_UNIQ_AUTH_USER’
'. Flush summary:
[
INSERT TaskMeterLogEntity[7b692912-a7b2-11ed-8cf1-02425542710d]
INSERT AuthorizationEntity[7b692910-a7b2-11ed-8cf1-02425542710d]
INSERT UserOperationLogEntryEventEntity[7b695024-a7b2-11ed-8cf1-02425542710d]
INSERT HistoricIdentityLinkLogEventEntity[7b692911-a7b2-11ed-8cf1-02425542710d]
UPDATE TaskEntity[3133d097-a7b2-11ed-8cf1-02425542710d]
UPDATE HistoricActivityInstanceEventEntity[return_to_booth:3133d096-a7b2-11ed-8cf1-02425542710d]
UPDATE HistoricTaskInstanceEventEntity[3133d097-a7b2-11ed-8cf1-02425542710d]
]
at org.camunda.bpm.engine.impl.db.EnginePersistenceLogger.flushDbOperationException(EnginePersistenceLogger.java:131)
… 70 more
Caused by: org.apache.ibatis.exceptions.PersistenceException:
Error flushing statements. Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.AuthorizationEntity.insertAuthorization (batch index #2) failed. 1 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Duplicate entry ‘isabel.martins-1-7-3133d097-a7b2-11ed-8cf1-02425542710d’ for key ‘ACT_RU_AUTHORIZATION.ACT_UNIQ_AUTH_USER’
Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.AuthorizationEntity.insertAuthorization (batch index #2) failed. 1 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Duplicate entry ‘isabel.martins-1-7-3133d097-a7b2-11ed-8cf1-02425542710d’ for key ‘ACT_RU_AUTHORIZATION.ACT_UNIQ_AUTH_USER’
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSession.flushStatements(DefaultSqlSession.java:254)
at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.flushBatchOperations(DbSqlSession.java:444)
at org.camunda.bpm.engine.impl.db.sql.BatchDbSqlSession.executeDbOperations(BatchDbSqlSession.java:74)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flushDbOperations(DbEntityManager.java:341)
... 69 more
Caused by: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.AuthorizationEntity.insertAuthorization (batch index #2) failed. 1 prior sub executor(s) completed successfully, but will be rolled back. Cause: java.sql.BatchUpdateException: Duplicate entry 'isabel.martins-1-7-3133d097-a7b2-11ed-8cf1-02425542710d' for key 'ACT_RU_AUTHORIZATION.ACT_UNIQ_AUTH_USER'
at org.apache.ibatis.executor.BatchExecutor.doFlushStatements(BatchExecutor.java:149)
at org.apache.ibatis.executor.BaseExecutor.flushStatements(BaseExecutor.java:129)
at org.apache.ibatis.executor.BaseExecutor.flushStatements(BaseExecutor.java:122)
at org.apache.ibatis.executor.CachingExecutor.flushStatements(CachingExecutor.java:114)
at org.apache.ibatis.session.defaults.DefaultSqlSession.flushStatements(DefaultSqlSession.java:252)
... 72 more
Caused by: java.sql.BatchUpdateException: Duplicate entry 'isabel.martins-1-7-3133d097-a7b2-11ed-8cf1-02425542710d' for key 'ACT_RU_AUTHORIZATION.ACT_UNIQ_AUTH_USER'
at jdk.internal.reflect.GeneratedConstructorAccessor209.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at com.mysql.cj.util.Util.handleNewInstance(Util.java:192)
at com.mysql.cj.util.Util.getInstance(Util.java:167)
at com.mysql.cj.util.Util.getInstance(Util.java:174)
at com.mysql.cj.jdbc.exceptions.SQLError.createBatchUpdateException(SQLError.java:224)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchSerially(ClientPreparedStatement.java:853)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchInternal(ClientPreparedStatement.java:435)
at com.mysql.cj.jdbc.StatementImpl.executeBatch(StatementImpl.java:794)
at jdk.internal.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:114)
at com.sun.proxy.$Proxy7.executeBatch(Unknown Source)
at org.apache.ibatis.executor.BatchExecutor.doFlushStatements(BatchExecutor.java:123)
... 76 more
Caused by: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry 'isabel.martins-1-7-3133d097-a7b2-11ed-8cf1-02425542710d' for key 'ACT_RU_AUTHORIZATION.ACT_UNIQ_AUTH_USER'
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:117)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1092)
at com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchSerially(ClientPreparedStatement.java:832)
... 84 more