upgrading from 6.10 2.2

2
When I upgrade my app to 7.2 at some stage the modeller needs to upgrade the database:   CREATE TABLE "mendixsystem$unique_constraint" (     "name" varchar(255) NOT NULL,     "table_id" varchar(36) NOT NULL,     "column_id" varchar(36) NOT NULL,     PRIMARY KEY("name","column_id")); UPDATE "mendixsystem$version"  SET "preanalysismigrationversionnumber" = '3.0.0';   After the start of the app I get the follwoing error when I use postgress Database, With build in database it runs without a problem.   Mendix.Modeler.M2EEConnector.M2EEException: The server encountered an error.    at Mendix.Modeler.M2EEConnector.M2EEResponse.CheckSuccess() in C:\jenkins\workspace\Modeler-Build\modeler\Mendix.Modeler.M2EEConnector\M2EEResponse.cs:line 57    at Mendix.Modeler.M2EEConnector.StartupManager.StartRuntime(IM2EEClient client, StartupInfo info) in C:\jenkins\workspace\Modeler-Build\modeler\Mendix.Modeler.M2EEConnector\StartupManager.cs:line 105    at Mendix.Modeler.M2EEConnector.StartupManager.PerformStartup(StartupInfo info, IM2EEClient client) in C:\jenkins\workspace\Modeler-Build\modeler\Mendix.Modeler.M2EEConnector\StartupManager.cs:line 48    at Mendix.Modeler.M2EEConnector.RuntimeController.Start(StartupInfo info, LogLevel autoSubscribeLogLevel) in C:\jenkins\workspace\Modeler-Build\modeler\Mendix.Modeler.M2EEConnector\RuntimeController.cs:line 133    at Mendix.Modeler.Utility.BackgroundUtil.<>c__DisplayClass1_0`1.<Do>b__0(Object s, DoWorkEventArgs e) in C:\jenkins\workspace\Modeler-Build\modeler\Mendix.Modeler.Utility\BackgroundUtil.cs:line 28    at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)    at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)   It seems there is some issue with postgress?
asked
4 answers
3

In order to avoid this kind of exceptions you should never downgrade the version of the Mendix Modeler, but upgrade only. In your case, after deploying an app with 7.2, the same app had been accidentally deployed with the lower version of the Mendix Modeler. It introduced small inconsistency in the database, which can simply be solved by deleting  "mendixsystem$unique_constraint" table and running the app with 7.2 or higher.

answered
1

Is that all you see in the logfiles? I'm missing the root cause of the error.

answered
1

I was wrong, the cosole shows:

 

com.mendix.m2ee.api.AdminException: Executing DDL commands for component MyFirstComponent failed.
    at com.mendix.basis.component.internal.LocalComponentImpl.executeDDLCommands(LocalComponentImpl.scala:115)

Caused by: com.mendix.basis.connectionbus.ConnectionBusException: Error (SQL State: 42P07, Error Code: 0) on executing:

CREATE TABLE "mendixsystem$unique_constraint" (
    "name" varchar(255) NOT NULL,
    "table_id" varchar(36) NOT NULL,
    "column_id" varchar(36) NOT NULL,
    PRIMARY KEY("name","column_id"))

All changes are rolled back.
    at com.mendix.connectionbus.modelsynchronization.DdlCommandExecutor.execute(DdlCommandExecutor.java:77)

Caused by: org.postgresql.util.PSQLException: ERROR: relation "mendixsystem$unique_constraint" already exists
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2412)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2125)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:297)
    at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:428)
    at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:354)
    at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:301)
    at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:287)
    at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:264)
    at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:260)
    at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:291)
    at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:291)
    at com.mendix.connectionbus.modelsynchronization.DdlCommandExecutor.executeDdlCommands(DdlCommandExecutor.java:134)
    at com.mendix.connectionbus.modelsynchronization.DdlCommandExecutor.execute(DdlCommandExecutor.java:41)
    at com.mendix.connectionbus.modelsynchronization.SynchronizationManager.synchronizeModel(SynchronizationManager.scala:151)
    at com.mendix.connectionbus.modelsynchronization.SynchronizationManager.executeImpl(SynchronizationManager.scala:142)
    at com.mendix.connectionbus.modelsynchronization.SynchronizationManager.execute(SynchronizationManager.scala:90)
    at com.mendix.connectionbus.ConnectionBusImpl.executeDDLCommands(ConnectionBusImpl.java:402)
    at com.mendix.basis.component.internal.LocalComponentImpl.executeDDLCommands(LocalComponentImpl.scala:112)
    at com.mendix.basis.impl.MxRuntimeImpl.executeDDLCommands(MxRuntimeImpl.java:999)
    at com.mendix.basis.action.admin.ExecuteDDLCommandsAction.call(ExecuteDDLCommandsAction.java:27)
    at com.mendix.basis.action.admin.RuntimeAdminAction.execute(RuntimeAdminAction.java:18)
    at com.mendix.m2ee.appcontainer.server.handler.HttpAdminHandler.handle(HttpAdminHandler.java:122)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.Server.handle(Server.java:368)
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
    at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:942)
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1004)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:647)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
    at java.lang.Thread.run(Thread.java:745)
 

answered
0

I have a similar issue:

 

CREATE TABLE "mendixsystem$unique_constraint" (
    "name" VARCHAR_IGNORECASE(255) NOT NULL,
    "table_id" VARCHAR_IGNORECASE(36) NOT NULL,
    "column_id" VARCHAR_IGNORECASE(36) NOT NULL,
    PRIMARY KEY("name","column_id"));

UPDATE "mendixsystem$version"
 SET "preanalysismigrationversionnumber" = '3.0.0';
 

answered