You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that during a push there are multiple attempts to create the Channel Groups. An underlying DB primary key violation is being thrown. This occurs using the force option too.
←[39mDEBUG←[0;39m: posting xml to: /channelgroups/_bulkUpdate
clojure.lang.ExceptionInfo: clj-http: status 500 {:cached nil, :request-time 125, :repeatable? false, :protocol-version {:name "HTTP", :major 1, :minor 1}, :streaming? true, :http-client #object[org.apache.http.impl.client.InternalHttpClient 0x5a237731 "org.apache.http.impl.client.InternalHttpClient@5a237731"], :chunked? true, :type :clj-http.client/unexceptional-status, :reason-phrase "Internal Server Error", :headers {"Access-Control-Allow-Headers" "Content-Type", "Server" "nginx", "Content-Type" "application/xml", "Access-Control-Allow-Origin" "*", "X-Frame-Options" "DENY", "Strict-Transport-Security" ["max-age=31536000; includeSubDomains" "max-age=31536000; includeSubDomains"], "Connection" "close", "Transfer-Encoding" "chunked", "Access-Control-Allow-Methods" "GET, POST, DELETE, PUT", "Date" "Wed, 27 Apr 2022 15:27:01 GMT", "Access-Control-Allow-Credentials" "false", "Content-Security-Policy" ["frame-ancestors 'none'" "upgrade-insecure-requests"]}, :orig-content-encoding nil, :status 500, :length -1, :body "<com.mirth.connect.client.core.ControllerException>\n org.apache.ibatis.exceptions.PersistenceException:
\n### Error updating database. Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Violation of PRIMARY KEY constraint 'PK__CHANNEL___3214EC27E4615C0E'. Cannot insert duplicate key in object 'dbo.CHANNEL_GROUP'. The duplicate key value is (3e807410-ed18-4217-a4e7-d924df8cc5d4).
\n### The error may involve Channel.insertChannelGroup-Inline
\n### The error occurred while setting parameters
\n### SQL: INSERT INTO CHANNEL_GROUP (ID, NAME, REVISION, CHANNEL_GROUP) VALUES (?, ?, ?, ?)
\n### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Violation of PRIMARY KEY constraint 'PK__CHANNEL___3214EC27E4615C0E'. Cannot insert duplicate key in object 'dbo.CHANNEL_GROUP'. The duplicate key value is (3e807410-ed18-4217-a4e7-d924df8cc5d4).\n <cause class="com.mirth.connect.client.core.api.PersistenceException">\n
\n### Error updating database. Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Violation of PRIMARY KEY constraint 'PK__CHANNEL___3214EC27E4615C0E'. Cannot insert duplicate key in object 'dbo.CHANNEL_GROUP'. The duplicate key value is (3e807410-ed18-4217-a4e7-d924df8cc5d4).
\n### The error may involve Channel.insertChannelGroup-Inline
\n### The error occurred while setting parameters
\n### SQL: INSERT INTO CHANNEL_GROUP (ID, NAME, REVISION, CHANNEL_GROUP) VALUES (?, ?, ?, ?)
\n### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Violation of PRIMARY KEY constraint 'PK__CHANNEL___3214EC27E4615C0E'. Cannot insert duplicate key in object 'dbo.CHANNEL_GROUP'. The duplicate key value is (3e807410-ed18-4217-a4e7-d924df8cc5d4).\n <cause class="com.microsoft.sqlserver.jdbc.SQLServerException">\n Violation of PRIMARY KEY constraint 'PK__CHANNEL___3214EC27E4615C0E'. Cannot insert duplicate key in object 'dbo.CHANNEL_GROUP'. The duplicate key value is (3e807410-ed18-4217-a4e7-d924df8cc5d4).\n \n com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:262)\n com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1632)\n com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:602)\n com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:524)
The text was updated successfully, but these errors were encountered:
I did a fresh pull, deleted all the old channels in the target Mirth server, and then confirmed that the appropriate DB table was empty. I also grepped all the pulled files and both the channel GUID and channel name and they only appeared once. Also looked at issues #26 and #33.
Circling back on this now that I have a free environment to play around in. I tried creating a small working example that reproduces the issue, but I'm currently unable to successfully do so after having deleted all the channels and channel groups and starting from scratch. I did see that there is an "override" query string parameter for /channelgroups/_bulkUpdate POST method, which may have solved the problem. I did see that this is already referenced in the MirthSync project as a TODO here: apis.clj. If I run into this issue again I will provide a minimal example.
It seems that during a push there are multiple attempts to create the Channel Groups. An underlying DB primary key violation is being thrown. This occurs using the force option too.
←[39mDEBUG←[0;39m: posting xml to: /channelgroups/_bulkUpdate
clojure.lang.ExceptionInfo: clj-http: status 500 {:cached nil, :request-time 125, :repeatable? false, :protocol-version {:name "HTTP", :major 1, :minor 1}, :streaming? true, :http-client #object[org.apache.http.impl.client.InternalHttpClient 0x5a237731 "org.apache.http.impl.client.InternalHttpClient@5a237731"], :chunked? true, :type :clj-http.client/unexceptional-status, :reason-phrase "Internal Server Error", :headers {"Access-Control-Allow-Headers" "Content-Type", "Server" "nginx", "Content-Type" "application/xml", "Access-Control-Allow-Origin" "*", "X-Frame-Options" "DENY", "Strict-Transport-Security" ["max-age=31536000; includeSubDomains" "max-age=31536000; includeSubDomains"], "Connection" "close", "Transfer-Encoding" "chunked", "Access-Control-Allow-Methods" "GET, POST, DELETE, PUT", "Date" "Wed, 27 Apr 2022 15:27:01 GMT", "Access-Control-Allow-Credentials" "false", "Content-Security-Policy" ["frame-ancestors 'none'" "upgrade-insecure-requests"]}, :orig-content-encoding nil, :status 500, :length -1, :body "<com.mirth.connect.client.core.ControllerException>\n org.apache.ibatis.exceptions.PersistenceException: \n### Error updating database. Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Violation of PRIMARY KEY constraint 'PK__CHANNEL___3214EC27E4615C0E'. Cannot insert duplicate key in object 'dbo.CHANNEL_GROUP'. The duplicate key value is (3e807410-ed18-4217-a4e7-d924df8cc5d4). \n### The error may involve Channel.insertChannelGroup-Inline \n### The error occurred while setting parameters \n### SQL: INSERT INTO CHANNEL_GROUP (ID, NAME, REVISION, CHANNEL_GROUP) VALUES (?, ?, ?, ?) \n### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Violation of PRIMARY KEY constraint 'PK__CHANNEL___3214EC27E4615C0E'. Cannot insert duplicate key in object 'dbo.CHANNEL_GROUP'. The duplicate key value is (3e807410-ed18-4217-a4e7-d924df8cc5d4).\n <cause class="com.mirth.connect.client.core.api.PersistenceException">\n \n### Error updating database. Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Violation of PRIMARY KEY constraint 'PK__CHANNEL___3214EC27E4615C0E'. Cannot insert duplicate key in object 'dbo.CHANNEL_GROUP'. The duplicate key value is (3e807410-ed18-4217-a4e7-d924df8cc5d4). \n### The error may involve Channel.insertChannelGroup-Inline \n### The error occurred while setting parameters \n### SQL: INSERT INTO CHANNEL_GROUP (ID, NAME, REVISION, CHANNEL_GROUP) VALUES (?, ?, ?, ?) \n### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: Violation of PRIMARY KEY constraint 'PK__CHANNEL___3214EC27E4615C0E'. Cannot insert duplicate key in object 'dbo.CHANNEL_GROUP'. The duplicate key value is (3e807410-ed18-4217-a4e7-d924df8cc5d4).\n <cause class="com.microsoft.sqlserver.jdbc.SQLServerException">\n Violation of PRIMARY KEY constraint 'PK__CHANNEL___3214EC27E4615C0E'. Cannot insert duplicate key in object 'dbo.CHANNEL_GROUP'. The duplicate key value is (3e807410-ed18-4217-a4e7-d924df8cc5d4).\n \n com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:262)\n com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1632)\n com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:602)\n com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:524)
The text was updated successfully, but these errors were encountered: