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

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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?

            Assignee:
            Vivek Pandey
            Reporter:
            James Dumay
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: