BonitaBpm 7.0.2 Error duplicate key value violates unique constraint

1
0
-1

Hi, i'm having a hard time restoring the production environment that filed after a network problem.

After i have restarted bonita service (database is in a postgresql), i get the error " duplicate key value violates unique constraint "

I understand that this is not an auto-sequentce, so the error is incrementing with sequence +1.

the postgresql log:

"021-09-15 16:39:00 EEST [3765-13800] bonita@bonita STATEMENT: insert into process_instance (name, processDefinitionId, description, startDate, startedBy, startedBySubstitute, endDate, stateId, stateCategory, lastUpdate, containerId, rootProcessInstanceId, callerId, callerType, interruptingEventId, stringIndex1, stringIndex2, stringIndex3, stringIndex4, stringIndex5, tenantid, id) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22)
2021-09-15 16:39:00 EEST [3765-13801] bonita@bonita ERROR: duplicate key value violates unique constraint "process_instance_pkey"
2021-09-15 16:39:00 EEST [3765-13802] bonita@bonita DETAIL: Key (tenantid, id)=(1, 288091) already exists.
2021-09-15 16:39:00 EEST [3765-13803] bonita@bonita STATEMENT: insert into process_instance (name, processDefinitionId, description, startDate, startedBy, startedBySubstitute, endDate, stateId, stateCategory, lastUpdate, containerId, rootProcessInstanceId, callerId, callerType, interruptingEventId, stringIndex1, stringIndex2, stringIndex3, stringIndex4, stringIndex5, tenantid, id) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22)
2021-09-15 16:39:00 EEST [3765-13804] bonita@bonita ERROR: duplicate key value violates unique constraint "process_instance_pkey"
2021-09-15 16:39:00 EEST [3765-13805] bonita@bonita DETAIL: Key (tenantid, id)=(1, 288092) already exists.
2021-09-15 16:39:00 EEST [3765-13806] bonita@bonita STATEMENT: insert into process_instance (name, processDefinitionId, description, startDate, startedBy, startedBySubstitute, endDate, stateId, stateCategory, lastUpdate, containerId, rootProcessInstanceId, callerId, callerType, interruptingEventId, stringIndex1, stringIndex2, stringIndex3, stringIndex4, stringIndex5, tenantid, id) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22)
2021-09-15 16:39:00 EEST [3765-13807] bonita@bonita ERROR: duplicate key value violates unique constraint "process_instance_pkey"
2021-09-15 16:39:00 EEST [3765-13808] bonita@bonita DETAIL: Key (tenantid, id)=(1, 288093) already exists.
"

As u can see, the id keeps changes with +1 with each error.

After postgresql querry SELECT max(id) from process_instance; i get answer " 965905 " so i'm at 288092 out of 965905.

How can i change the sequence so it can start insert starting from 965905 +1 ? somehow it got back to 1 and after a lot of errors went to 288092.

I could wait it out until it reaches that number, but it would mean weeks...

No answers yet.
Notifications