Abort a hung build in Jenkins

Abort a hung build in Jenkins

This section provides the instruction on how to abort the hung Jenkins build if it does not restore after the Jenkins dedicated node is restared, for example.

To abort a hung build, select from the following options

  • Abort the job build from the Jenkins web UI:

    1. Log in to the Jenkins web UI as an Administrator using the FQDN of your cloud endpoint and the 8081 port. For example, https://cloud.example.com:8081.

    2. Navigate to Manage Jenkins > Script Console.

    3. Run the following script setting the job name and number of the hung build accordingly:

      def build = Jenkins.instance.getItemByFullName("jobName").getBuildByNumber(jobNumber)
      build.doStop()
      build.doKill()
      
  • Abort the job build from a cid node (if the previous option did not help):

    1. Log in to any cid node.

    2. Run:

      cd /srv/volumes/jenkins/jobs/<job-name>/builds/
      rm -rf <hung-build-number>
      
    3. Log in to the Jenkins web UI as an Administrator using the FQDN of your cloud endpoint and the 8081 port. For example, https://cloud.example.com:8081.

    4. Navigate to Manage Jenkins > Reload Configuration from Disk, click to reload. Or restart the Jenkins instance.