Failed to commit - The duplicate key value. (SQL State: 23000, Error Code: 2627)

0
Hello, We have migrated our application from Mendix 6 to Mendix 7 and since that moment,nin production, we have the following error :  "com.mendix.core.CoreException: com.mendix.modules.microflowengine.MicroflowException: Failed to commit at RDR2.AT_RDR2_CreateOutboundRDRMessage (Commit : 'Commit 'NewRDRMessage' ') Advanced stacktrace: at com.mendix.basis.component.InternalCoreBase.execute(InternalCoreBase.java:389) Caused by: com.mendix.modules.microflowengine.MicroflowException: Failed to commit at RDR2.AT_RDR2_CreateOutboundRDRMessage (Commit : 'Commit 'NewRDRMessage' ') Advanced stacktrace: at com.mendix.modules.microflowengine.MicroflowUtil.processException(MicroflowUtil.java:146) Caused by: com.mendix.core.CoreRuntimeException: Failed to commit at com.mendix.basis.component.CommitHandler.commit(CommitHandler.scala:155) Caused by: com.mendix.core.CoreRuntimeException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.core.CoreException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.systemwideinterfaces.connectionbus.data.UniqueConstraintViolationRuntimeException: Duplicate column value violates its unique constraint: Violation of PRIMARY KEY constraint 'PK__system$f__3213E83F26D4843F'. Cannot insert duplicate key in object 'dbo.system$filedocument'. The duplicate key value is (157907461934722529). (SQL State: 23000, Error Code: 2627) at com.mendix.basis.actionmanagement.ActionManagerBase.executeInTransactionSync(ActionManagerBase.java:125) Caused by: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.core.CoreException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.systemwideinterfaces.connectionbus.data.UniqueConstraintViolationRuntimeException: Duplicate column value violates its unique constraint: Violation of PRIMARY KEY constraint 'PK__system$f__3213E83F26D4843F'. Cannot insert duplicate key in object 'dbo.system$filedocument'. The duplicate key value is (157907461934722529). (SQL State: 23000, Error Code: 2627) at com.mendix.basis.actionmanagement.ActionManagerBase.executeSync(ActionManagerBase.java:159) Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.core.CoreException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.systemwideinterfaces.connectionbus.data.UniqueConstraintViolationRuntimeException: Duplicate column value violates its unique constraint: Violation of PRIMARY KEY constraint 'PK__system$f__3213E83F26D4843F'. Cannot insert duplicate key in object 'dbo.system$filedocument'. The duplicate key value is (157907461934722529). (SQL State: 23000, Error Code: 2627) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:36) Caused by: com.mendix.core.CoreException: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.systemwideinterfaces.connectionbus.data.UniqueConstraintViolationRuntimeException: Duplicate column value violates its unique constraint: Violation of PRIMARY KEY constraint 'PK__system$f__3213E83F26D4843F'. Cannot insert duplicate key in object 'dbo.system$filedocument'. The duplicate key value is (157907461934722529). (SQL State: 23000, Error Code: 2627) at com.mendix.basis.actionmanagement.SyncEventExtendedAction.executeAction(SyncEventExtendedAction.java:43) Caused by: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.systemwideinterfaces.connectionbus.data.UniqueConstraintViolationRuntimeException: Duplicate column value violates its unique constraint: Violation of PRIMARY KEY constraint 'PK__system$f__3213E83F26D4843F'. Cannot insert duplicate key in object 'dbo.system$filedocument'. The duplicate key value is (157907461934722529). (SQL State: 23000, Error Code: 2627) at com.mendix.basis.actionmanagement.ActionManagerBase.executeSync(ActionManagerBase.java:159) Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.systemwideinterfaces.connectionbus.data.UniqueConstraintViolationRuntimeException: Duplicate column value violates its unique constraint: Violation of PRIMARY KEY constraint 'PK__system$f__3213E83F26D4843F'. Cannot insert duplicate key in object 'dbo.system$filedocument'. The duplicate key value is (157907461934722529). (SQL State: 23000, Error Code: 2627) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:36) Caused by: com.mendix.systemwideinterfaces.connectionbus.data.UniqueConstraintViolationRuntimeException: Duplicate column value violates its unique constraint: Violation of PRIMARY KEY constraint 'PK__system$f__3213E83F26D4843F'. Cannot insert duplicate key in object 'dbo.system$filedocument'. The duplicate key value is (157907461934722529). (SQL State: 23000, Error Code: 2627) at com.mendix.basis.action.user.CommitAction$$anonfun$commitPersistableObjects$4.applyOrElse(CommitAction.scala:104) at com.mendix.basis.action.user.CommitAction$$anonfun$commitPersistableObjects$4.applyOrElse(CommitAction.scala:102) at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:38) at scala.util.Failure.recoverWith(Try.scala:236) at com.mendix.basis.action.user.CommitAction.commitPersistableObjects(CommitAction.scala:102) at com.mendix.basis.action.user.CommitAction.executeAction(CommitAction.scala:59) at com.mendix.basis.action.user.CommitAction.executeAction(CommitAction.scala:29) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:46) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:79) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:57) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:55) at com.mendix.basis.actionmanagement.ActionManagerBase$1.execute(ActionManagerBase.java:150) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32) at com.mendix.basis.actionmanagement.ActionManagerBase.executeSync(ActionManagerBase.java:155) at com.mendix.basis.actionmanagement.SyncEventExtendedAction.executeAction(SyncEventExtendedAction.java:41) at com.mendix.basis.actionmanagement.EventExtendedAction.execute(EventExtendedAction.java:102) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:79) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:57) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:55) at com.mendix.basis.actionmanagement.ActionManagerBase$1.execute(ActionManagerBase.java:153) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32) at com.mendix.basis.actionmanagement.ActionManagerBase.executeSync(ActionManagerBase.java:155) at com.mendix.basis.actionmanagement.ActionManagerBase.executeInTransactionSync(ActionManagerBase.java:118) at com.mendix.basis.component.CommitHandler.$anonfun$storeObjectsAndAutoCommittedObjects$1(CommitHandler.scala:169) at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:286) at scala.collection.immutable.List.foreach(List.scala:431) at scala.collection.TraversableLike.map(TraversableLike.scala:286) at scala.collection.TraversableLike.map$(TraversableLike.scala:279) at scala.collection.immutable.List.map(List.scala:305) at com.mendix.basis.component.CommitHandler.storeObjectsAndAutoCommittedObjects(CommitHandler.scala:167) at com.mendix.basis.component.CommitHandler.commit(CommitHandler.scala:127) at com.mendix.basis.component.CommitHandler.commit$(CommitHandler.scala:109) at com.mendix.basis.component.InternalCore.commit(InternalCore.scala:10) at com.mendix.basis.component.CommitHandler.commitWithEvents(CommitHandler.scala:68) at com.mendix.basis.component.CommitHandler.commit(CommitHandler.scala:48) at com.mendix.basis.component.CommitHandler.commit$(CommitHandler.scala:47) at com.mendix.basis.component.InternalCore.commit(InternalCore.scala:10) at com.mendix.basis.component.CommitHandler.commit(CommitHandler.scala:24) at com.mendix.basis.component.CommitHandler.commit$(CommitHandler.scala:24) at com.mendix.basis.component.InternalCore.commit(InternalCore.scala:10) at com.mendix.modules.microflowengine.actions.mxobject.CommitAction.execute(CommitAction.scala:32) at com.mendix.modules.microflowengine.actions.mxobject.CommitAction.execute(CommitAction.scala:16) at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.java:47) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.java:201) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.java:157) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:46) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:79) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:57) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:55) at com.mendix.basis.actionmanagement.ActionManagerBase$1.execute(ActionManagerBase.java:150) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32) at com.mendix.basis.actionmanagement.ActionManagerBase.executeSync(ActionManagerBase.java:155) at com.mendix.basis.component.InternalCoreBase.execute(InternalCoreBase.java:383) at com.mendix.basis.component.InternalCoreBase.execute(InternalCoreBase.java:398) at com.mendix.webui.actions.client.ExecuteMicroflowAction.runMicroflow(ExecuteMicroflowAction.scala:46) at com.mendix.webui.actions.client.ExecuteMicroflowAction.apply(ExecuteMicroflowAction.scala:32) at com.mendix.webui.actions.client.ExecuteMicroflowAction.apply(ExecuteMicroflowAction.scala:15) at com.mendix.webui.actions.client.RegularClientAction.$anonfun$execute$4(RegularClientAction.scala:46) at com.mendix.webui.requesthandling.helpers.StateHandling.withState(StateHandling.scala:35) at com.mendix.webui.requesthandling.helpers.StateHandling.withState$(StateHandling.scala:23) at com.mendix.webui.actions.client.RegularClientAction.withState(RegularClientAction.scala:21) at com.mendix.webui.actions.client.RegularClientAction.$anonfun$execute$3(RegularClientAction.scala:44) at scala.util.Try$.apply(Try.scala:213) at com.mendix.webui.actions.client.RegularClientAction.$anonfun$execute$2(RegularClientAction.scala:44) at com.mendix.webui.actions.client.RegularClientAction.$anonfun$execute$2$adapted(RegularClientAction.scala:42) at com.mendix.webui.requesthandling.helpers.ContextHandling.$anonfun$inContext$6(ContextHandling.scala:47) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) at com.mendix.basis.actionmanagement.IMonitoredAction$$anon$1.execute(IMonitoredAction.scala:47) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32) at com.mendix.basis.actionmanagement.IMonitoredAction.monitor(IMonitoredAction.scala:49) at com.mendix.basis.actionmanagement.IMonitoredAction.monitor$(IMonitoredAction.scala:25) at com.mendix.webui.requesthandling.helpers.ContextHandling$ClientMonitoredAction.monitor(ContextHandling.scala:59) at com.mendix.webui.requesthandling.helpers.ContextHandling.inContext(ContextHandling.scala:47) at com.mendix.webui.requesthandling.helpers.ContextHandling.inContext$(ContextHandling.scala:27) at com.mendix.webui.actions.client.RegularClientAction.inContext(RegularClientAction.scala:21) at com.mendix.webui.requesthandling.helpers.ContextHandling.inContext(ContextHandling.scala:24) at com.mendix.webui.requesthandling.helpers.ContextHandling.inContext$(ContextHandling.scala:19) at com.mendix.webui.actions.client.RegularClientAction.inContext(RegularClientAction.scala:21) at com.mendix.webui.actions.client.RegularClientAction.$anonfun$execute$1(RegularClientAction.scala:42) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) at com.mendix.webui.requesthandling.helpers.ProfileHandling.profileRequest(ProfileHandling.scala:14) at com.mendix.webui.requesthandling.helpers.ProfileHandling.profileRequest$(ProfileHandling.scala:10) at com.mendix.webui.actions.client.RegularClientAction.profileRequest(RegularClientAction.scala:21) at com.mendix.webui.actions.client.RegularClientAction.execute(RegularClientAction.scala:39) at com.mendix.webui.requesthandling.ClientRequestHandler.handleAction(ClientRequestHandler.scala:124) at com.mendix.webui.requesthandling.ClientRequestHandler.processRequest(ClientRequestHandler.scala:101) at com.mendix.externalinterface.connector.RequestHandler.doProcessRequest(RequestHandler.java:40) at com.mendix.external.connector.MxRuntimeConnector$1.execute(MxRuntimeConnector.java:72) at com.mendix.external.connector.MxRuntimeConnector$1.execute(MxRuntimeConnector.java:69) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32) at com.mendix.external.connector.MxRuntimeConnector.processRequest(MxRuntimeConnector.java:75) at com.mendix.basis.impl.MxRuntimeImpl.processRequest(MxRuntimeImpl.java:953) at com.mendix.m2ee.appcontainer.server.handler.RuntimeHandler.service(RuntimeHandler.java:42) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) at org.eclipse.jetty.server.Server.handle(Server.java:516) at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:388) at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:633) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:380) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:386) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) at java.lang.Thread.run(Unknown Source)" It appear in several microflows. Can you help us to resolve this problem ? Thank you, Benoît Lebrun
asked
1 answers
0

Hello Benoit,

It seems you are associating multiple objects of RDRMessage with one filedocument and the association in your model does not allow this because it is 1-1. Check the creation of your objects and add proper validation. 

answered