Issue
My Move/Copy/Promote operations seems to have hung. It’s been running for hours and I cannot abort it.
Environment
- CloudBees CI (CloudBees Core)
- CloudBees CI (CloudBees Core) on modern cloud platforms - Managed controller
- CloudBees CI (CloudBees Core) on modern cloud platforms - Operations Center
- CloudBees CI (CloudBees Core) on traditional platforms - Client controller
- CloudBees CI (CloudBees Core) on traditional platforms - Operations Center
- CloudBees Jenkins Enterprise - Managed controller
- CloudBees Jenkins Enterprise - Operations Center
- CloudBees Jenkins Platform - Client controller
- CloudBees Jenkins Platform - Operations Center
Resolution
The operation can be aborted by the following groovy script. Notice that <job or folder name>
needs to be replaced with the full
name of the item being moved, copied or promoted. Then in the script console of the controller, run:
use(groovy.time.TimeCategory) {
def delay = 1.hour
jenkins.model.Jenkins.instanceOrNull.getComputers()
.each { computer ->
computer.getAllExecutors().findAll { it.isBusy() }.each { exec ->
if (exec.elapsedTime > delay.toMilliseconds()) {
if(exec.currentExecutable instanceof com.cloudbees.opscenter.replication.ItemReplicationRecord
&& exec.currentExecutable.source.fullName=="<job or folder name>") {
println " * Aborting ${exec.currentExecutable} that spent ${exec.elapsedTime}ms building..."
// exec.interrupt(hudson.model.Result.ABORTED, new jenkins.model.CauseOfInterruption() {
// @Override
// String getShortDescription() {
// return "Build was suspended for too long. See Jenkins administrators"
// }
// })
}
}
}
}
}
return
Once you are confident that the script would abort the correct M/C/P operation, uncomment the 6 commented lines and re-run the script to actually abort the operation.
You may need to re-enable the job which was being acted on.
Tested product/plugin versions
- CloudBees CI (CloudBees Core) 2.138.4.3
- CloudBees CI (CloudBees Core) on modern cloud platforms - Managed controller 2.138.4.3
- CloudBees CI (CloudBees Core) on modern cloud platforms - Operations Center 2.138.4.3
- CloudBees CI (CloudBees Core) on traditional platforms - Client controller 2.138.4.3
- CloudBees CI (CloudBees Core) on traditional platforms - Operations Center 2.138.4.3
- CloudBees Jenkins Enterprise - Managed controller 2.138.4.3
- CloudBees Jenkins Enterprise - Operations Center 2.138.4.3
- CloudBees Jenkins Platform - Client controller 2.138.4.3
- CloudBees Jenkins Platform - Operations Center 2.138.4.3
0 Comments