Fixing Workflows with Duplicate occurrence of action
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the server and data center platforms.
Summary
- Unable to view or edit workflows
- Navigating to the Statuses page throws a "Sorry, we had some technical problems during your last operation."
- Workflows section displays the error:
"The JIRA server was contacted but has returned an error response. We are unsure of the result of this operation."
The following appears in the JIRA log:
Error converting XML to workflow descriptor.: root cause: Duplicate occurance of action ID 131 found in step 7
Cause
For unknown reasons a JIRA workflow became corrupt and contains a duplicate action. The XML can't be parsed correctly and the Workflows section fails to be displayed.
Solution
Manually remove the duplicate action from the database.
Find the affected workflow:
from the Error message in the logs, use the ID number to search in the database for workflow that has 2 sets of the same action:SELECT id, workflowname FROM jiraworkflows WHERE descriptor like '%<action id="<ID>"%<action id="<ID>"%';
should return only one workflow. You'll use the id returned in step 5
Extract the descriptor:
Copy (SELECT descriptor FROM jiraworkflows WHERE descriptor like '%<action id="<ID>"%<action id="<ID>"%') to '/tmp/desc.csv' DELIMITER ',' QUOTE '''' CSV;
will create a /tmp/desc.csv file with the workflow XML
Manually search for the step mentioned in the Error and it will contain 2 action IDs exactly the same.
- Remove one ID from <action id= to </action>
Update the Workflow in the DB
Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
UPDATE jiraworkflows SET descriptor = '<paste here the full edited XML>' where id = '<database workflow id returned from step 1>';