How do I remove an unstoppable pipeline job in Jenkins?
I was able to stop the job by submitting a POST request to:
http://jenkins.fqdn:8080/job/$JobName/branch/$BranchName/8/term
(Note the $JobName and $BranchName variables)
I found this URI by doing the following:
- Click on the number next to the job to navigate to that exact job.
- Click the Console Output link.
- Right-Click the "Click here to forcibly terminate running steps" link.
- Click the Inspect menu item. (This is in Chrome; adjust this step for your preferred browser)
- Copy the URI from inside the Ajax.Request call. E.g.:
onclick="new Ajax.Request('
http://jenkins.fqdn:8080/job/$JobName/branch/$BranchName/8/term
'); false"
For some reason, clicking the Click here to forcibly terminate running steps
link didn't actually terminate the job, but submitting a post request manually did. I suspect it's probably just a little bug in the UI code.
I've got the same problem today and workaround from the comment above didn't help me as well as sending /kill
command instead of /term
.
I found working solution here:
- OPEN https://your.jenkins.fqdn/script
- PUT
Jenkins.instance.getItemByFullName("jobName").getBuildByNumber(9).finish(hudson.model.Result.ABORTED, new java.io.IOException("Aborting build"));
- PRESS "Run"