I'm using the Pipeline (formerly Workflow) plugin collection for Jenkins. I've somehow managed to create a workflow job on my Jenkins server that I cannot stop. Querying the current stack traces with Thread.getAllStackTraces().keySet().each() { t -> println(t.getName())}
does not return any executors in the output matching this job. On top of that, if this is the only live job in the Build Executor Status window, there are no executors listed at all.
Restarting the slave that the job was executing on had no effect. Restarting the Jenkins master server had no effect either. Any thoughts on how I could get rid of this thing?
You can mark the build as ABORTED, and then use the error step to cause the build to stop: if (! continueBuild) { currentBuild. result = 'ABORTED' error('Stopping early…') }
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:
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:
Jenkins.instance.getItemByFullName("jobName").getBuildByNumber(9).finish(hudson.model.Result.ABORTED, new java.io.IOException("Aborting build"));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With