Fixing Workflows with Duplicate occurrence of action

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

要約

  • 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


原因 1

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. Follow Solution 1 for the fix.

原因 2

The workflow contains a post-function that executes a groovy script. The script manipulates the workflow object and injects a workflow action ID action.id that does not exist. Follow Solution 2 for the fix.

原因 3

In cases where neither of the above two causes apply, corrupt temporary files in the Jira working directory can also cause this problem. Follow Solution 3 for the fix.


ソリューション 1

Manually remove the duplicate action from the database.

  1. 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

  2. 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

  3. Manually search for the step mentioned in the Error and it will contain 2 action IDs exactly the same.

    expand to see example...
     <step id="7" name="App Approved">
          <meta name="jira.status.id">12104</meta>
          <actions>
    
            .... some actions ...
    
            <action id="131" name="Cancel">
              <meta name="jira.description"></meta>
              <meta name="jira.fieldscreen.id"></meta>
              <results>
                <unconditional-result old-status="null" status="null" step="3">
                  <post-functions>
                    <function type="class">
                      <arg name="class.name">com.atlassian.jira.workflow.function.issue.UpdateIssueStatusFunction</arg>
                    </function>
                    <function type="class">
                      <arg name="class.name">com.atlassian.jira.workflow.function.misc.CreateCommentFunction</arg>
                    </function>
                    <function type="class">
                      <arg name="class.name">com.atlassian.jira.workflow.function.issue.GenerateChangeHistoryFunction</arg>
                    </function>
                    <function type="class">
                      <arg name="class.name">com.atlassian.jira.workflow.function.issue.IssueReindexFunction</arg>
                    </function>
                    <function type="class">
                      <arg name="eventTypeId">13</arg>
                      <arg name="class.name">com.atlassian.jira.workflow.function.event.FireIssueEventFunction</arg>
                    </function>
                  </post-functions>
                </unconditional-result>
              </results>
            </action>
            <action id="131" name="Cancel">
              <meta name="jira.description"></meta>
              <meta name="jira.fieldscreen.id"></meta>
              <results>
                <unconditional-result old-status="null" status="null" step="3">
                  <post-functions>
                    <function type="class">
                      <arg name="class.name">com.atlassian.jira.workflow.function.issue.UpdateIssueStatusFunction</arg>
                    </function>
                    <function type="class">
                      <arg name="class.name">com.atlassian.jira.workflow.function.misc.CreateCommentFunction</arg>
                    </function>
                    <function type="class">
                      <arg name="class.name">com.atlassian.jira.workflow.function.issue.GenerateChangeHistoryFunction</arg>
                    </function>
                    <function type="class">
                      <arg name="class.name">com.atlassian.jira.workflow.function.issue.IssueReindexFunction</arg>
                    </function>
                    <function type="class">
                      <arg name="eventTypeId">13</arg>
                      <arg name="class.name">com.atlassian.jira.workflow.function.event.FireIssueEventFunction</arg>
                    </function>
                  </post-functions>
                </unconditional-result>
              </results>
            </action>
          </actions>
        </step>
  4. Remove one ID from <action id= to </action>
  5. Update the Workflow in the DB

    データベースの変更を行う場合は必ず事前にバックアップを取得してください。可能な場合は、まずステージング サーバーで SQL コマンドの変更、挿入、更新、または削除を行うようにします。

    UPDATE jiraworkflows SET descriptor = '<paste here the full edited XML>' where id = '<database workflow id returned from step 1>';

ソリューション 2

  • Identify the script that executes as part of the impacted workflow.
  • Inspect the script and look for action id assignment, make sure the hardcoded ID exists.
    • Note: It is possible to oversee equality evaluation "==" that has been set as an assignment "=" and this will lead to described error.

ソリューション 3

Clear the contents of the work directory and restart Jira:

  1. Jira を停止します。
  2. Delete the contents of the JIRA_INSTALL/work directory.
    (warning) Do not delete the entire directory itself, just its contents!
  3. Jira を再起動します。



最終更新日 2024 年 4 月 3 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.