Uploaded image for project: 'Jira Platform Cloud'
  1. Jira Platform Cloud
  2. JRACLOUD-44681

"Commit failed, rollback previously requested by nested transaction" Error when using Automatic Parent transitions

      NOTE: This bug report is for JIRA Cloud. Using JIRA Server? See the corresponding bug report.

      Summary

      On JIRA 7 when using the jira-misc-workflow-extensions 'Transition Parent issue', some transitions will fail if the parent transition cannot be completed

      Environment

      JIRA 7
      Plugin: JIRA Misc Workflow Extensions

      Steps to Reproduce

      1. Create a workflow with the following post function: On Open to In Progress: "Transition Parent with ID X" (transition parent issue from open to in progress for example)
      2. Create a Task and put it to the 'In Progress' Status
      3. Create a subtask and transition it from Open to In Progress (the transition where you've configured the post function in step 1)

      Expected Results

      In JIRA 6.X the Sub Task transitions normally, an error will be logged but the transition completes.

      Actual Results

      In JIRA 7, the Parent Task can't be transition using the ID because that transition only applies to the Open status.
      Since the Parent Task can't be transitioned, the Sub Task now also fails to transition.

      2015-08-04 10:31:09,435 ajp-nio-127.0.0.104-8009-exec-177 ERROR n06963 631x33611x2 27g572 160.67.51.136,131.103.27.33 /secure/WorkflowUIDispatcher.jspa [c.a.jira.workflow.OSWorkflowManager] Caught exception while attempting to perform action 4 from workflow 111781 on issue 'EX-1'
      @4000000055c078571a3be394 com.opensymphony.workflow.InvalidActionException: Action 4 is invalid
      @4000000055c078571a3be394       at com.opensymphony.workflow.AbstractWorkflow.doAction(AbstractWorkflow.java:559)
      @4000000055c078571a3c0aa4       at com.atlassian.jira.workflow.OSWorkflowManager.doWorkflowActionInsideTxn(OSWorkflowManager.java:995)
      @4000000055c078571a3c0e8c       at com.atlassian.jira.workflow.OSWorkflowManager.doWorkflowAction(OSWorkflowManager.java:947)
      @4000000055c078571a3c0e8c       at com.atlassian.jira.workflow.WorkflowTransitionUtilImpl.progress(WorkflowTransitionUtilImpl.java:417)
      @4000000055c078571a3c1274       at com.innovalog.jmwe.plugins.functions.TransitionParentIssueFunction.executeFunction(TransitionParentIssueFunction.java:78)
      @4000000055c078571a3c1a44       at com.innovalog.jmwe.plugins.functions.AbstractPreserveChangesPostFunction.execute(AbstractPreserveChangesPostFunction.java:123)
      @4000000055c078571a3c1a44       at com.opensymphony.workflow.AbstractWorkflow.executeFunction(AbstractWorkflow.java:1050)
      @4000000055c078571a3c29e4       at com.opensymphony.workflow.AbstractWorkflow.transitionWorkflow(AbstractWorkflow.java:1446)
      @4000000055c078571a3c29e4       at com.opensymphony.workflow.AbstractWorkflow.doAction(AbstractWorkflow.java:564)
      @4000000055c078571a3c2dcc       at com.atlassian.jira.workflow.OSWorkflowManager.doWorkflowActionInsideTxn(OSWorkflowManager.java:995)
      @4000000055c078571a3c31b4       at com.atlassian.jira.workflow.OSWorkflowManager.doWorkflowAction(OSWorkflowManager.java:947)
      @4000000055c078571a3c359c       at com.atlassian.jira.bc.issue.DefaultIssueService.transition(DefaultIssueService.java:500)
      @4000000055c078571a3c3984       at com.atlassian.jira.web.action.workflow.SimpleWorkflowAction.doExecute(SimpleWorkflowAction.java:32)
      @4000000055c078571a3c3984       ... 1 filtered
      @4000000055c078571a3c3d6c       at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:67)
      @4000000055c078571a3c4154       ... 7 filtered
      @4000000055c078571a3c4154       at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
      @4000000055c078571a3c453c       ... 50 filtered
      ...
      @4000000055c078572c0d90a4 2015-08-04 10:31:09,729 ajp-nio-127.0.0.104-8009-exec-177 ERROR n06963 631x33611x2 27g572 160.67.51.136,131.103.27.33 /secure/WorkflowUIDispatcher.jspa [c.a.jira.transaction.TransactionSupportImpl] Unable to commit transaction : Commit failed, rollback previously requested by nested transaction.
      @4000000055c078572c0da044 org.ofbiz.core.entity.GenericTransactionException: Commit failed, rollback previously requested by nested transaction.
      @4000000055c078572c0da42c       at org.ofbiz.core.entity.TransactionUtil.commitLocalTransaction(TransactionUtil.java:342)
      @4000000055c078572c0dc754       at com.atlassian.core.ofbiz.util.CoreTransactionUtil.commit(CoreTransactionUtil.java:46)
      @4000000055c078572c0dcb3c       at com.atlassian.jira.transaction.TransactionSupportImpl$TransactionImpl.commit(TransactionSupportImpl.java:94)
      @4000000055c078572c0dd30c       at com.atlassian.jira.workflow.OSWorkflowManager.doWorkflowActionInsideTxn(OSWorkflowManager.java:1012)
      @4000000055c078572c0dd6f4       at com.atlassian.jira.workflow.OSWorkflowManager.doWorkflowAction(OSWorkflowManager.java:947)
      @4000000055c078572c0df634       at com.atlassian.jira.bc.issue.DefaultIssueService.transition(DefaultIssueService.java:500)
      @4000000055c078572c0dfa1c       at com.atlassian.jira.web.action.workflow.SimpleWorkflowAction.doExecute(SimpleWorkflowAction.java:32)
      @4000000055c078572c0e0da4       ... 1 filtered
      @4000000055c078572c0e118c       at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:67)
      @4000000055c078572c0e1574       ... 7 filtered
      @4000000055c078572c0e1574       at javax.servlet.http.HttpServlet
      

      Notes

      This behaviour has changed from JIRA 6 to JIRA 7, it will affect all customers using this Post Function.

      Workaround provided by David from Innovalog

      Use transition Names instead of Transition IDs when specifying the Transition to execute on the Parent (or Linked) Issue. When you use transition names, if the specified transition is not applicable for the current status of the parent (or linked) issue, a WARN will be logged but the current transition (on the subtask) will complete successfully.

      A fix will be applied shortly to JMWE to provide the same behavior when specifying transition IDs.

            [JRACLOUD-44681] "Commit failed, rollback previously requested by nested transaction" Error when using Automatic Parent transitions

            dmeyer Note that the bug still exists with Validators: if the parent or linked issue being transitioned automatically has a Validator that fails, the same exception will be triggered.

            David [old account] added a comment - dmeyer Note that the bug still exists with Validators: if the parent or linked issue being transitioned automatically has a Validator that fails, the same exception will be triggered.

            Thanks for the clarification.

            Steven F Behnke added a comment - Thanks for the clarification.

            I'm afraid I completely forgot to notify it here, but the issue was fixed late last year in JMWE for both Server and Cloud.

            David [old account] added a comment - I'm afraid I completely forgot to notify it here, but the issue was fixed late last year in JMWE for both Server and Cloud.

            For the record, Transition Parent post-functions still work in JIRA Cloud with the Sub-Task Blocking Condition. You must place the Transition Parent post-function after the Index Issue post-function otherwise the parent condition cannot be met! If the Sub-Task hasn't had it's status indexed, the Parent condition is failing (as it should).

            There's no issue here and I've been able to duplicate the auto-transition behavior in a current cloud instance.

            Steven F Behnke added a comment - For the record, Transition Parent post-functions still work in JIRA Cloud with the Sub-Task Blocking Condition. You  must place the Transition Parent post-function after the Index Issue post-function otherwise the parent condition cannot be met! If the Sub-Task hasn't had it's status indexed, the Parent condition is failing (as it should). There's no issue here and I've been able to duplicate the auto-transition behavior in a current cloud instance.

            I completely agree. Why would you want to remove functionality that was so useful.

            Any chance on re-opening the issue?
            JRA-45379 relates to this issue as well.

            Stetson Baldwin added a comment - I completely agree. Why would you want to remove functionality that was so useful. Any chance on re-opening the issue? JRA-45379 relates to this issue as well.

            Sean, Likewise, I can easily transition (globally) a parent to an updated status (for instance, from "Open" to "In Progress") when any of the children subtasks transition from "Open" to something now in work. I also, prior to the latest JIRA build, could globally transition a parent to "Done" based on the conditional that all child subtasks were done. That's the rub now. The conditional rule in the parent based upon the state of all the children subtasks no longer works. While I've read up on many blogs, I still don't grasp why this is the case. Yes, I understand this feature was made available through the JIRA Misc Workflow Extensions plugin, developed by a third party vendor, but it doesn't explain why this feature would be removed when it appears so many were relying on it.

            For now.....I have removed the conditional and added a viewable transition on the parent so when all of the subtasks are in a Done status, a supporting team member can"Press Done" thus effectively babysitting the parent through its completion. Blah.

            That's my two-cents and a half vent. Moving on.

            Michael Durkin added a comment - Sean, Likewise, I can easily transition (globally) a parent to an updated status (for instance, from "Open" to "In Progress") when any of the children subtasks transition from "Open" to something now in work. I also, prior to the latest JIRA build, could globally transition a parent to "Done" based on the conditional that all child subtasks were done. That's the rub now. The conditional rule in the parent based upon the state of all the children subtasks no longer works. While I've read up on many blogs, I still don't grasp why this is the case. Yes, I understand this feature was made available through the JIRA Misc Workflow Extensions plugin, developed by a third party vendor, but it doesn't explain why this feature would be removed when it appears so many were relying on it. For now.....I have removed the conditional and added a viewable transition on the parent so when all of the subtasks are in a Done status, a supporting team member can"Press Done" thus effectively babysitting the parent through its completion. Blah. That's my two-cents and a half vent. Moving on.

            Thanks David - that makes sense.

            I've created a new bug (https://jira.atlassian.com/browse/JRA-45379) and linked it to this issue. I'm going to reopen a support request directly with Atlassian that I originally had open for this and link to the bug I have just created.

            Sean Bedford added a comment - Thanks David - that makes sense. I've created a new bug ( https://jira.atlassian.com/browse/JRA-45379 ) and linked it to this issue. I'm going to reopen a support request directly with Atlassian that I originally had open for this and link to the bug I have just created.

            bedfordsean Actually, the fix in JMWE was only intended to avoid errors when the transition requested on the parent issue is not applicable to the parent issue's current state. The problem you are encountering is different: the transition you trigger on the parent issue is valid, it is just prevented by a Condition. In that case, JIRA 7 will indeed not only fail the transition (which is expected) but also rollback the entire transaction (which is a regression).

            Here is what I suggest: you should raise a new issue with Atlassian support, adding my description and requested that Innovalog be added to the support issue. Although there is probably nothing much that can be done in JMWE itself, it will at least make Atlassian aware of the broader issue.

            David

            David [old account] added a comment - bedfordsean Actually, the fix in JMWE was only intended to avoid errors when the transition requested on the parent issue is not applicable to the parent issue's current state. The problem you are encountering is different: the transition you trigger on the parent issue is valid, it is just prevented by a Condition. In that case, JIRA 7 will indeed not only fail the transition (which is expected) but also rollback the entire transaction (which is a regression). Here is what I suggest: you should raise a new issue with Atlassian support, adding my description and requested that Innovalog be added to the support issue. Although there is probably nothing much that can be done in JMWE itself, it will at least make Atlassian aware of the broader issue. David

            Ok, so for me, this approach does not work.

            I am doing the following:

            • I have a "stories" workflow which contains "Selected for Development", "In Progress", "Awaiting test", "Done" states and global transitions.
            • I have a "tasks" workflow which contains "Selected for Development", "In progress", "Awaiting test", "Ready for Release" states.
            • The "tasks" workflow has post functions in it's transitions to push through stories to "In progress" as soon as any sub-task of that story is "In Progress" or "Awaiting test". Likewise for pushing stories back in to "In progress" upon test failures, etc. These post function transition changes are using the names for the global transitions in the "stories" workflow.
            • The "stories" workflow has sub-task blocking conditions on it's global transitions to prevent the story transitioning to an invalid state if further sub tasks are created (e.g. the story can't go from "In progress" to "Awaiting test" until all of it's sub-tasks are "Ready for release").

            This set up was previously working before JIRA 7. It was also working fine /with/ JIRA 7 and groovy expressions. This flow is now broken. It seems that the intended fix as detailed in this ticket doesn't work. Has anyone managed to get this working successfully?

            Sean Bedford added a comment - Ok, so for me, this approach does not work . I am doing the following: I have a "stories" workflow which contains "Selected for Development", "In Progress", "Awaiting test", "Done" states and global transitions. I have a "tasks" workflow which contains "Selected for Development", "In progress", "Awaiting test", "Ready for Release" states. The "tasks" workflow has post functions in it's transitions to push through stories to "In progress" as soon as any sub-task of that story is "In Progress" or "Awaiting test". Likewise for pushing stories back in to "In progress" upon test failures, etc. These post function transition changes are using the names for the global transitions in the "stories" workflow. The "stories" workflow has sub-task blocking conditions on it's global transitions to prevent the story transitioning to an invalid state if further sub tasks are created (e.g. the story can't go from "In progress" to "Awaiting test" until all of it's sub-tasks are "Ready for release"). This set up was previously working before JIRA 7. It was also working fine /with/ JIRA 7 and groovy expressions. This flow is now broken. It seems that the intended fix as detailed in this ticket doesn't work. Has anyone managed to get this working successfully?

            I third Joe's comment - this is exactly how we use our workflow too (and I think is a perfectly reasonable use case!)

            The reason we do this is so that we have a product level "Stories" board, as well as sub-tasks of those stories which exist independently on a "Tasks" board. This set up allows developers to work on the tasks and have the stories automatically bubble through to completion.

            Sean Bedford added a comment - I third Joe's comment - this is exactly how we use our workflow too (and I think is a perfectly reasonable use case!) The reason we do this is so that we have a product level "Stories" board, as well as sub-tasks of those stories which exist independently on a "Tasks" board. This set up allows developers to work on the tasks and have the stories automatically bubble through to completion.

              Unassigned Unassigned
              imaduro Ivan Maduro (Inactive)
              Affected customers:
              0 This affects my team
              Watchers:
              29 Start watching this issue

                Created:
                Updated:
                Resolved: