Unique constraint error KEY NOT FOUND

0
Hi community,   I'm working on a app and was running it localy before, so theres preexisting data. Today when starting the app localy I got the error mentioned below and the app refused to start.   The strange thing is, other answers to similar questions in the community hinted that theres duplicate data in my domain model. But this can't be the fact for two reasons: The app was working before, I didnt change anything on that constraint, domain model, nor the data itself since the last time running the app The same error popped up for unique constraints on AutoKey attributes, and those can't be duplicates   I would love if somebody could help me solve this. Only way to get rid of the error I found currently was to remove the unique constraint completely. Even readding it afterwards didn't help.   Heres the full message and stacktrace: An error occurred while initializing the Runtime: key not found: uniq_issuetracking$tag_color -------- com.mendix.m2ee.api.AdminException: An error occurred while initializing the Runtime: key not found: uniq_issuetracking$tag_color at com.mendix.basis.impl.MxRuntimeImpl.start(MxRuntimeImpl.scala:233) Caused by: java.util.NoSuchElementException: key not found: uniq_issuetracking$tag_color at scala.collection.immutable.Map$EmptyMap$.apply(Map.scala:223) at scala.collection.immutable.Map$EmptyMap$.apply(Map.scala:219) at com.mendix.connectionbus.modelsynchronization.UniqueConstraintHelpers.$anonfun$recreateAllAssociationUniqueConstraints$3(UniqueConstraintHelpers.scala:43) at com.mendix.connectionbus.modelsynchronization.UniqueConstraintHelpers.$anonfun$recreateAllAssociationUniqueConstraints$3$adapted(UniqueConstraintHelpers.scala:42) at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:576) at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:574) at scala.collection.AbstractIterable.foreach(Iterable.scala:933) at com.mendix.connectionbus.modelsynchronization.UniqueConstraintHelpers.recreateAllAssociationUniqueConstraints(UniqueConstraintHelpers.scala:42) at com.mendix.connectionbus.modelsynchronization.UniqueConstraintHelpers.recreateAllAssociationUniqueConstraints$(UniqueConstraintHelpers.scala:31) at com.mendix.connectionbus.modelsynchronization.analysis.DatabaseAnalyzerBase.recreateAllAssociationUniqueConstraints(DatabaseAnalyzerBase.scala:18) at com.mendix.connectionbus.modelsynchronization.analysis.DatabaseAnalyzer.collectAssociationUpdates(DatabaseAnalyzer.java:679) at com.mendix.connectionbus.modelsynchronization.analysis.DatabaseAnalyzer.collectDatabaseUpdates(DatabaseAnalyzer.java:218) at com.mendix.connectionbus.modelsynchronization.analysis.DatabaseAnalyzerBase.getModelRelatedDbChangeInfo(DatabaseAnalyzerBase.scala:103) at com.mendix.connectionbus.modelsynchronization.analysis.DatabaseAnalyzerBase.analyzeExistingDatabase(DatabaseAnalyzerBase.scala:90) at com.mendix.connectionbus.modelsynchronization.analysis.DatabaseAnalyzerBase.$anonfun$analyzeAndFillMigrationCommands$1(DatabaseAnalyzerBase.scala:45) at scala.Option.map(Option.scala:242) at com.mendix.connectionbus.modelsynchronization.analysis.DatabaseAnalyzerBase.analyzeAndFillMigrationCommands(DatabaseAnalyzerBase.scala:45) at com.mendix.connectionbus.modelsynchronization.ModelSynchronizationUpdater.analyzeAndFillMigrationCommands(ModelSynchronizationUpdater.scala:76) at com.mendix.connectionbus.modelsynchronization.ModelSynchronizationUpdater.analyzeAndRender(ModelSynchronizationUpdater.scala:34) at com.mendix.connectionbus.modelsynchronization.SynchronizationManager.analyzeMappingModel(SynchronizationManager.scala:226) at com.mendix.connectionbus.modelsynchronization.SynchronizationManager.analyzeCurrentDatabase(SynchronizationManager.scala:145) at com.mendix.connectionbus.modelsynchronization.SynchronizationManager.$anonfun$stateMachine$3(SynchronizationManager.scala:74) at com.mendix.connectionbus.modelsynchronization.SimpleStateMachine$SimpleStateMachine.effect(SynchronizationManager.scala:45) at com.mendix.connectionbus.modelsynchronization.SynchronizationManager.analyzeCopying(SynchronizationManager.scala:188) at com.mendix.connectionbus.modelsynchronization.SynchronizationManager.$anonfun$stateMachine$2(SynchronizationManager.scala:73) at com.mendix.connectionbus.modelsynchronization.SimpleStateMachine$SimpleStateMachine.effect(SynchronizationManager.scala:45) at com.mendix.connectionbus.modelsynchronization.SynchronizationManager.analyzeSourceStructureForCopy(SynchronizationManager.scala:153) at com.mendix.connectionbus.modelsynchronization.SynchronizationManager.$anonfun$stateMachine$1(SynchronizationManager.scala:72) at com.mendix.connectionbus.modelsynchronization.SimpleStateMachine$SimpleStateMachine.effect(SynchronizationManager.scala:45) at com.mendix.connectionbus.modelsynchronization.SynchronizationManager.analyze(SynchronizationManager.scala:132) at com.mendix.connectionbus.ConnectionBusImpl.collectDatabaseSynchronizationInformation(ConnectionBusImpl.scala:273) at com.mendix.basis.impl.MxRuntimeImpl.collectDdlCommands(MxRuntimeImpl.scala:401) at com.mendix.basis.impl.MxRuntimeImpl.doSynchronization(MxRuntimeImpl.scala:364) at com.mendix.basis.impl.MxRuntimeImpl.startConnectionBus(MxRuntimeImpl.scala:355) at com.mendix.basis.impl.MxRuntimeImpl.launchConnectionBus(MxRuntimeImpl.scala:261) at com.mendix.basis.impl.MxRuntimeImpl.$anonfun$start$1(MxRuntimeImpl.scala:219) at com.mendix.util.startupmeter.StartUpMeter.measure(StartUpMeter.scala:66) at com.mendix.basis.impl.MxRuntimeImpl.start(MxRuntimeImpl.scala:213) at com.mendix.m2ee.appcontainer.actions.StartAction.startRuntime(StartAction.scala:33) at com.mendix.m2ee.appcontainer.actions.StartAction.execute(StartAction.scala:17) at com.mendix.m2ee.appcontainer.server.handler.HttpAdminHandlerBase.service(HttpAdminHandlerBase.java:130) at javax.servlet.http.HttpServlet.service(HttpServlet.java:590) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:764) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:529) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1384) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:484) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1306) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122) at org.eclipse.jetty.server.Server.handle(Server.java:563) at org.eclipse.jetty.server.HttpChannel$RequestDispatchable.dispatch(HttpChannel.java:1598) at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:753) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:501) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:287) at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:314) at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100) at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53) at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:421) at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:390) at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:277) at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:199) at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:411) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:969) at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1194) at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1149) at java.base/java.lang.Thread.run(Thread.java:829)  
asked
1 answers
1

To resolve the NoSuchElementException related to the unique constraint uniq_issuetracking$tag_color, try the following steps:

  1. Check Database: Verify if the unique constraint exists in the database schema.
  2. Run Migrations: Ensure all database migrations are applied by using the Mendix Modeler or command line.
  3. Recreate Constraint: Temporarily remove the unique constraint from the domain model, start the app, then re-add it and restart.
  4. Inspect Logs: Look for additional error messages in the Mendix logs for more context.
  5. Contact Support: If unresolved, reach out to Mendix support or community forums for assistance.

These steps should help you troubleshoot and fix the issue.

answered