AnsweredAssumed Answered

Update on Table "act_ru_execution" error after migration from 5.22 to 6.0

Question asked by pavel.lu on Sep 5, 2018

Hello, we have updated our engine from 5.22 to 6.0. But our processes end with an error: insert or update on table "act_ru_execution" violates foreign key constraint "act_fk_exe_procinst"

 

here is the stack trace :

org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: org.postgresql.util.PSQLException: ERROR: insert or update on table "act_ru_execution" violates foreign key constraint "act_fk_exe_procinst"
Detail: Key (proc_inst_id_)=(3e9280ac-b118-11e8-bb5e-005056837ccf) is not present in table "act_ru_execution".
### The error may involve org.activiti.engine.impl.persistence.entity.ExecutionEntityImpl.insertExecution-Inline
### The error occurred while setting parameters
### SQL: insert into activiti_v6.ACT_RU_EXECUTION (ID_, REV_, PROC_INST_ID_, BUSINESS_KEY_, PROC_DEF_ID_, ACT_ID_, IS_ACTIVE_, IS_CONCURRENT_, IS_SCOPE_,IS_EVENT_SCOPE_, IS_MI_ROOT_, PARENT_ID_, SUPER_EXEC_, ROOT_PROC_INST_ID_, SUSPENSION_STATE_, TENANT_ID_, NAME_, START_TIME_, START_USER_ID_, IS_COUNT_ENABLED_, EVT_SUBSCR_COUNT_, TASK_COUNT_, JOB_COUNT_, TIMER_JOB_COUNT_, SUSP_JOB_COUNT_, DEADLETTER_JOB_COUNT_, VAR_COUNT_, ID_LINK_COUNT_) values ( ?, 1, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
### Cause: org.postgresql.util.PSQLException: ERROR: insert or update on table "act_ru_execution" violates foreign key constraint "act_fk_exe_procinst"
Detail: Key (proc_inst_id_)=(3e9280ac-b118-11e8-bb5e-005056837ccf) is not present in table "act_ru_execution".
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) ~[mybatis-3.4.2.jar!/:3.4.2]
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:200) ~[mybatis-3.4.2.jar!/:3.4.2]
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:185) ~[mybatis-3.4.2.jar!/:3.4.2]
at org.activiti.engine.impl.db.DbSqlSession.flushRegularInsert(DbSqlSession.java:649) ~[activiti-engine-6.0.0.jar!/:6.0.0]
at org.activiti.engine.impl.db.DbSqlSession.flushInsertEntities(DbSqlSession.java:544) ~[activiti-engine-6.0.0.jar!/:6.0.0]
at org.activiti.engine.impl.db.DbSqlSession.flushInserts(DbSqlSession.java:527) ~[activiti-engine-6.0.0.jar!/:6.0.0]
at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:417) ~[activiti-engine-6.0.0.jar!/:6.0.0]
at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:197) [activiti-engine-6.0.0.jar!/:6.0.0]
at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:75) [activiti-engine-6.0.0.jar!/:6.0.0]
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:72) [activiti-engine-6.0.0.jar!/:6.0.0]
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47) [activiti-spring-6.0.0.jar!/:6.0.0]
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) [spring-tx-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45) [activiti-spring-6.0.0.jar!/:6.0.0]
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:29) [activiti-engine-6.0.0.jar!/:6.0.0]
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:44) [activiti-engine-6.0.0.jar!/:6.0.0]
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:39) [activiti-engine-6.0.0.jar!/:6.0.0]
at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:94) [activiti-engine-6.0.0.jar!/:6.0.0]

 

We have tried to rollback to v 5.22 and there is everything all right, please don't you have any piece of advice?

Outcomes