Unable to stop multi-branch pipeline build

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

XMLWordPrintable

      When trying to stop a multibranch pipeline build, I get the following error:

      POST is required for org.jenkinsci.plugins.workflow.job.WorkflowRun.doStop

      This error is followed by a button marked "Try POSTing" which goes to an error page (403, missing crumb).

      The workaround is going to the Script Console and running:

      Jenkins.instance
          .getItemByFullName("<BUILD NAME>")
          .getBranch("<BRANCH NAME>")
          .getBuildByNumber(<BUILD NUMBER>)
          .finish(hudson.model.Result.ABORTED, new java.io.IOException("Aborting build"));

      But this is incredibly hacky and leaves the workflow view for the build in a state of "in progress" even though the build is no longer running.

      Also, on the next restart of the Jenkins server, the build will resume running.

            Assignee:
            Unassigned
            Reporter:
            Omer van Kloeten
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: