Today I would like to share some insight with you, on how to troubleshoot the "com.lombardisoftware.core.TeamWorksRuntimeException: Error updating branch removing 1 ids: updated 0 rows, not 1" exception during a BPM Snapshot deployment.
This patient complained about intense pain, without having the appropriate pain killers. It was about an offline deployment of his application he was trying to perform onto his Process Server. He mentioned that for any reason the offline deployment failed. Looking into the logs, he saw exceptions like the following:
com.lombardisoftware.core.TeamWorksRuntimeException: Error updating branch removing 1 ids: updated 0 rows, not 1
Let's take our instruments and start to analyze. Since this is about a deployment, we collected the deployment trace from the AppTarget (only on Process Server because it was an offline deployment). For your reference, the deployment trace string:
This is something support often asks for when you report issues with deployments. So it's always handy to have that noted somewhere.
Looking at the traces, what do we have..
..here the offline deployment started:
[1/14/16 11:34:22:753 GMT+04:00] 000001f2 CommandServic I PALAdminCommands processServerOfflineDeploy Entering
..ok, the installation of the process app itself worked:
[1/14/16 11:34:31:569 GMT+04:00] 000001f2 InstallMessag I CWLLG3579I: [END] Starting the installation of process application TestApp(TA), snapshot s1 as user admin.
So far so good!
..here we see the installation of library items and assets is triggered:
[1/14/16 11:34:33:556 GMT+04:00] 000001f2 InstallMessag I CWLLG3580I: [BEGIN] Installing the library items and assets for the process application and referenced toolkits.
..then several toolkits get installed which do have a dependency to the process application. One of them is the KolbanTK. Here we see that the installation of KolbanTK begins:
[1/14/16 11:34:39:500 GMT+04:00] 000001f2 InstallMessag I CWLLG3581I: [BEGIN] Installing toolkit KolbanTK(KOLBTK), snapshot 2015-04-23-1-8.5.6(20150_3).
..now it's getting more interesting since here we can see a „FAIL“ is being logged:
[1/14/16 11:34:39:822 GMT+04:00] 000001f2 InstallMessag I CWLLG3581I: [FAIL] Installing toolkit KolbanTK(KOLBTK), snapshot 2015-04-23-1-8.5.6(20150_3).
→ According to that it seems that the KolbanTK is causing the deployment problem.
..looking at a few lines earlier in the tracewe can discover the following:
[1/14/16 11:34:39:817 GMT+04:00] 000001f2 clientinfoplu >
prepareStatement Entry com.ibm.ws.rsadapter.jdbc.WSJccSQLJPDQConnection@dd574657
BRANCH_ID = ?
AND END_SEQ_NUM = 999999999999
AND PO_TYPE = ?
AND PO_ID IN
TYPE FORWARD ONLY (1003)
CONCUR READ ONLY (1007)
[1/14/16 11:34:39:819 GMT+04:00] 000001f2 ExceptionHand 1
com.lombardisoftware.core.ExceptionHandler ensureSerializable ensureSerializable(com.lombardisoftware.core.TeamWorksRuntimeException: Error updating branch removing 1 ids: updated 0 rows, not 1)
→ It seems that the installation of KolbanTK fails because removing some id did not work.
This leads to further exceptions (Yay! Exceptions!):
[1/14/16 11:34:39:838 GMT+04:00] 000001f2 InstallMessag E CWLLG3561E:
Process application snapshot 2015-04-23-1-8.5.6 was not installed because of the following error: Error updating branch removing 1 ids: updated 0 rows, not 1.
[1/14/16 11:34:39:838 GMT+04:00] 000001f2 InstallMessag I com.lombardisoftware.client.delegate.BusinessDelegateException: Error updating branch removing 1 ids: updated 0 rows, not 1
Caused by: com.lombardisoftware.core.TeamWorksRuntimeException: Error updating branch removing 1 ids: updated 0 rows, not 1
→ This exception shows the stacktrace of the issue. Here, especially "com.lombardisoftware.core.deployment.ImportHelper.addDependencies" and "com.lombardisoftware.server.ejb.persistence.versioning.MutableSnapshotContextImpl.removeRowsByID" caught my eyes.
It seems that the patient has an inconsistency related to the KolbanTK in the affected process application. A diagnosis what caused this inconsistency can be very difficult since it was introduced anytime in the past (e.g. by import of KolbanTK, working on related artifacts, export of process app from Process Center) which in turn should have been logged and traced.
However, let's brainstorm about approaches to resolve this particular deployment problem.
I think the following treatments can quickly help the patient:
- Create a new application, add the KolbanTK as dependency and perform a deployment. Afterwards, retry the deployment of the affected process app.
- Clone the KolbanTK, make a snapshot of the cloned TK, remove the old TK dependency from process app, add a new TK dependency (clone), make a snapshot of the process app and perform a deployment.
- Remove the dependency to KolbanTK in the process app (if not needed).
The patient decided to use the first approach. He created a new application, added a dependency to the KolbanTK and performed a deployment. After that he successfully ran the offline deployment of the affected application.
Please note that the KolbanTK is already on the Process Server by that and hence, the installation of this toolkit is skipped in the deployment of the affected application.
This pain killer helped the patient. By following that procedure he was able to work around the inconsistency without removing the toolkit.
I hope that some day this might help you as well. And if it does not, take two of these and call me in the morning.