How to stop an unstoppable zombie job on Jenkins without restarting the server?

前端 未结 27 1625
南旧
南旧 2020-11-27 09:18

Our Jenkins server has a job that has been running for three days, but is not doing anything. Clicking the little X in the corner does nothing, and the console output log do

27条回答
  •  爱一瞬间的悲伤
    2020-11-27 09:26

    In case you got a Multibranch Pipeline-job (and you are a Jenkins-admin), use in the Jenkins Script Console this script:

    Jenkins.instance
    .getItemByFullName("")
    .getBranch("")
    .getBuildByNumber()
    .finish(hudson.model.Result.ABORTED, new java.io.IOException("Aborting build"));
    

    From https://issues.jenkins-ci.org/browse/JENKINS-43020

    If you aren't sure what the full name (path) of the job is, you may use the following snippet to list the full name of all items:

      Jenkins.instance.getAllItems(AbstractItem.class).each {
        println(it.fullName)
      };
    

    From https://support.cloudbees.com/hc/en-us/articles/226941767-Groovy-to-list-all-jobs

提交回复
热议问题