Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-37880

Starting, stopping and replaying a run in quick succession does not work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Trivial Trivial
    • blueocean-plugin
    • None

      Steps to reproduce

      1. Create a new multi-branch pipeline using https://github.com/i386/hellonode
      2. Go to the branches screen
      3. Trigger a new build for master
      4. Open the run and click stop
      5. Then click replay again

      The goal here is to try starting, stopping then replaying really quickly.

      You will get a 500 error back from the replay action

      PUT http://localhost:8080/jenkins/blue/rest/organizations/jenkins/pipelines/hellonode/branches/master/runs/23/replay/ 500 (Server Error)

      {
      "message" : "Run was not added to queue.",
      "code" : 500,
      "errors" : [ ]
      }

      I attached a debugger when reproducing and got org.jenkinsci.plugins.workflow.cps.replay.ReplayAction#run2 returning null. Digging deeper it appears we can't get the flow owner

      private @CheckForNull CpsFlowExecution getExecution() {
              FlowExecutionOwner owner = ((FlowExecutionOwner.Executable) run).asFlowExecutionOwner();
              if (owner == null) {
                  return null;
              }
              FlowExecution exec = owner.getOrNull();
              return exec instanceof CpsFlowExecution ? (CpsFlowExecution) exec : null;
          }
      

      I suspect this is a bug in workflow?

            vivek Vivek Pandey
            jamesdumay James Dumay
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: