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

Unable to stop multi-branch pipeline build

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • workflow-job-plugin
    • None
    • Jenkins ver. 2.32.3
      Pipeline: Multibranch plugin ver. 2.14

      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.

            Unassigned Unassigned
            omervk Omer van Kloeten
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: