SQL error converting to 4.2.2: Executing DDL commands failed.

1
I have updated my project from 3.2.1 to 4.2.2. I will get an error after I select synchronise database in 2 different cases: Firstly, the relation [administration$account_contractmanager] exists and the table was empty. Secondly, the relation was deleted. Is this a bug? Request action: executeddlcommands Message: Executing DDL commands failed. Cause: Error (SQL State: S0001, Error Code: 3728) on executing: ALTER TABLE [administration$account_contractmanager] DROP CONSTRAINT [null] All changes are rolled back. Stack trace: com.mendix.m2ee.api.AdminException: Executing DDL commands failed. at com.mendix.core.MxRuntime.d(SourceFile:530) Caused by: l: Error (SQL State: S0001, Error Code: 3728) on executing: ALTER TABLE [administration$account_contractmanager] DROP CONSTRAINT [null] All changes are rolled back. at bq.a(SourceFile:86) Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: 'null' is not a constraint. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216) at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515) at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:792) at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:689) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155) at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(SQLServerStatement.java:662) at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264) at org.apache.commons.dbcp.DelegatingStatement.execute(DelegatingStatement.java:264) at bq.a(SourceFile:177) at bq.a(SourceFile:48) at h.a(SourceFile:196) at h.a(SourceFile:191) at h.c(SourceFile:172) at com.mendix.core.MxRuntime.d(SourceFile:525) at fJ.a(SourceFile:30) at fO.execute(SourceFile:26) at com.mendix.m2ee.server.handler.HttpAdminHandler.handle(HttpAdminHandler.java:121) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111) at org.eclipse.jetty.server.Server.handle(Server.java:351) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454) at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:642) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534) at java.lang.Thread.run(Thread.java:662)
asked
2 answers
0

Marco, can you answer to our reactions to your tickets about this problem?

This problem mostly occur if there are one or more tables without a primary key. Mendix always creates primary keys for its tables and Mendix relies on their existance when it is upgrading a database from Mendix 3.* to 4.*.

Sometimes the primary keys are lost during a backup and restore of the database. In the case above at least the table 'administration$account_contractmanager' does not have a primary key.

Sanne Appel, can you check if this is also the problem in your case? Can you check the backups of your database and see whether and when some primary keys are lost?

answered
0

Hmmm,

I now got this error when upgrading from 3.3.2 to 3.3.3.

Request action: execute_ddl_commands
Message: Executing DDL commands failed.
Cause: Error (SQL State: 42P07, Error Code: 0) on executing:

CREATE TABLE "rapportage$factuurregelterugfenc_factuurregel" (
    "rapportage$factuurregelterugfencid" int4 NOT NULL,
    "facturen$factuurregelid" int4 NOT NULL,
    PRIMARY KEY("rapportage$factuurregelterugfencid","facturen$factuurregelid"))



All changes are rolled back.
Stack trace: com.mendix.m2ee.api.AdminException: Executing DDL commands failed.
    at com.mendix.core.MxRuntime.d(SourceFile:509)
Caused by: d: Error (SQL State: 42P07, Error Code: 0) on executing:

CREATE TABLE "rapportage$factuurregelterugfenc_factuurregel" (
    "rapportage$factuurregelterugfencid" int4 NOT NULL,
    "facturen$factuurregelid" int4 NOT NULL,
    PRIMARY KEY("rapportage$factuurregelterugfencid","facturen$factuurregelid"))

Could this be recent introduced bug then?

answered