Duplicate key Issue in Strong Camunda UIID

We have multiple processes deployed on our environment. The environment has cluster implemented with single database source point. We were facing below error:

Cause: org.hibernate.exception.ConstraintViolationException: Duplicate entry ‘f976ea69-75df-11ed-a7db-0ab42a375bc2’ for key ‘ACT_HI_VARINST.PRIMARY’'. Flush summary:

We have implemented UIID for all the Camunda processes to address above issue still we are facing the same issue. We are seeking for help. Attaching the log here for your reference.

org.camunda.bpm.engine.ProcessEngineException: ENGINE-03083 Exception while executing Batch Database Operations with message ’

Error flushing statements. Cause: org.hibernate.exception.ConstraintViolationException: Duplicate entry ‘f976ea69-75df-11ed-a7db-0ab42a375bc2’ for key ‘ACT_HI_VARINST.PRIMARY’

Cause: org.hibernate.exception.ConstraintViolationException: Duplicate entry ‘f976ea69-75df-11ed-a7db-0ab42a375bc2’ for key ‘ACT_HI_VARINST.PRIMARY’'. Flush summary:

[
INSERT HistoricVariableInstanceEntity[23d639fc-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableInstanceEntity[23d6882f-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableInstanceEntity[23d6ae62-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableInstanceEntity[23d6d592-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableInstanceEntity[23d6d596-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableInstanceEntity[23d6d5a8-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableInstanceEntity[23d6d5be-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableInstanceEntity[23d6d5ca-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableInstanceEntity[23d6d5d8-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableInstanceEntity[23d6d5da-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableInstanceEntity[23d6d5e1-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableInstanceEntity[23d6fcfc-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableInstanceEntity[f97340bb-75df-11ed-a7db-0ab42a375bc2]
INSERT HistoricVariableInstanceEntity[f97340be-75df-11ed-a7db-0ab42a375bc2]
INSERT HistoricVariableInstanceEntity[f97340cd-75df-11ed-a7db-0ab42a375bc2]
INSERT HistoricVariableInstanceEntity[f97340d3-75df-11ed-a7db-0ab42a375bc2]
INSERT HistoricVariableInstanceEntity[f97340d4-75df-11ed-a7db-0ab42a375bc2]
INSERT HistoricVariableInstanceEntity[f97340d8-75df-11ed-a7db-0ab42a375bc2]
INSERT HistoricVariableInstanceEntity[f97340d9-75df-11ed-a7db-0ab42a375bc2]
INSERT HistoricVariableInstanceEntity[f976ea69-75df-11ed-a7db-0ab42a375bc2]
INSERT HistoricVariableUpdateEventEntity[23d639fd-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableUpdateEventEntity[23d63a04-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableUpdateEventEntity[23d66119-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableUpdateEventEntity[23d68830-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableUpdateEventEntity[23d68837-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableUpdateEventEntity[23d6ae5d-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableUpdateEventEntity[23d6ae63-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableUpdateEventEntity[23d6d593-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableUpdateEventEntity[23d6d597-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableUpdateEventEntity[23d6d5a9-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableUpdateEventEntity[23d6d5bf-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableUpdateEventEntity[23d6d5cb-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableUpdateEventEntity[23d6d5d9-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableUpdateEventEntity[23d6d5db-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableUpdateEventEntity[23d6d5e2-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableUpdateEventEntity[23d6d5e6-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableUpdateEventEntity[23d6fcf7-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableUpdateEventEntity[23d6fcfd-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableUpdateEventEntity[23d6fd00-7cff-11ed-9f73-0ab42a375bc2]
INSERT HistoricVariableUpdateEventEntity[23d72412-7cff-11ed-9f73-0ab42a375bc2]
INSERT VariableInstanceEntity[23d639fc-7cff-11ed-9f73-0ab42a375bc2]
INSERT VariableInstanceEntity[23d639fe-7cff-11ed-9f73-0ab42a375bc2]
INSERT VariableInstanceEntity[23d639ff-7cff-11ed-9f73-0ab42a375bc2]
INSERT VariableInstanceEntity[23d63a00-7cff-11ed-9f73-0ab42a375bc2]
INSERT VariableInstanceEntity[23d63a01-7cff-11ed-9f73-0ab42a375bc2]
INSERT VariableInstanceEntity[23d63a02-7cff-11ed-9f73-0ab42a375bc2]
INSERT VariableInstanceEntity[23d63a03-7cff-11ed-9f73-0ab42a375bc2]
INSERT VariableInstanceEntity[23d66115-7cff-11ed-9f73-0ab42a375bc2]
INSERT VariableInstanceEntity[23d66116-7cff-11ed-9f73-0ab42a375bc2]
INSERT VariableInstanceEntity[23d66117-7cff-11ed-9f73-0ab42a375bc2]
]
at org.camunda.bpm.engine.impl.db.EnginePersistenceLogger.flushDbOperationsException(EnginePersistenceLogger.java:698) ~[camunda-engine-7.9.0.jar:7.9.0]
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flushDbOperations(DbEntityManager.java:355) ~[camunda-engine-7.9.0.jar:7.9.0]
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flushDbOperationManager(DbEntityManager.java:318) ~[camunda-engine-7.9.0.jar:7.9.0]
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flush(DbEntityManager.java:290) ~[camunda-engine-7.9.0.jar:7.9.0]
at org.camunda.bpm.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:203) ~[camunda-engine-7.9.0.jar:7.9.0]
at

Kindly help…
this issue is in Production and Impacting so many cases. Need solution on Urgent basis.

Hi @mira.limbad

What do you mean when you say “We have implemented UIID”? Are you using your own UUID implementation or are you using Camunda’s default?

BR
Michael

we have used stronguuid generator which is provided by camunda and preferred for production environment. Thanks for your response.

Can anyone help in this?

We have used stronguuid generator which is provided by camunda and preferred for the production environment. Thanks for your response.

May we please get help on the posted issue at the earliest?

@Kanak_Darji and @mira.limbad - from the error logs, it looks like you are using version 7.9.0, which is quite old (released in 2018). The first thing I would try is to upgrade to the latest release, 7.18.0. We have the upgrade path fully documented.

Let me know if you are still having issues after upgrading!

@nathan.loding
Hi Nathan,

Thank you for your response. Upgrade would be an issue for us as we have many processes running on production with the 7.9.0.

Due to other dependencies upgrading camunda version will not be immediately possible.

Please if you can suggest what are the possible reasons why this is happening with Strong uuid and any way to identify root cause of it.

Thank you once again.

@Kanak_Darji - unfortunately maintenance for 7.9.0 ended in November 2019. I strongly suggest looking into how to upgrade to a more recent version. If you cannot upgrade all the way to 7.18.0, perhaps try upgrading to 7.10.0 and incrementally moving up over a longer period of time?

I would be curious to know what is preventing an upgrade?

I cannot say why the issue may be happening, as this version is quite old and there have been a lot of changes since its release. Camunda Platform 7 is fully open source (direct link to v7.9.0 source), so one alternative to upgrading may be to review the differences between 7.9 and later versions and see if you can identify the core issue.

I’m sorry I can’t be more helpful, but I do believe that upgrading Camunda is your best bet to resolve the issue.