Unable to stop pipeline job

1,057 views
Skip to first unread message

Sverre Moe

unread,
May 24, 2016, 3:08:03 AM5/24/16
to Jenkins Users
After loading a Pipeline script the job froze and I was unable to stop the build. 
Clicking X had no effect. 
Restarting Jenkins had no effect. 
Deleting the job had no effect. 
A second restart after I deleted the job then the build executor was emptied.

This is the output I got when loading a second Pipeline script.
[Pipeline] unstash
[Pipeline] load (../../../scriptler/scripts/package-information.groovy)
[Pipeline] load {
[Pipeline] } //load
Aborted by anonymous
Aborted by anonymous
Aborted by anonymous
Aborted by anonymous
Click here to forcibly terminate running steps
Click here to forcibly terminate running steps
Click here to forcibly terminate running steps
Click here to forcibly terminate running steps

My Pipeline script

node('master') {
    stage 'Checkout'
    
    checkout([$class: 'GitSCM',
        branches: [[name: '${BUILD_BRANCH}']],
        browser: [$class: 'GitWeb', repoUrl: 'http://git.company.com/gitweb/?p=domain/projectA.git'],
        doGenerateSubmoduleConfigurations: false,
        extensions: [[$class: 'CleanBeforeCheckout']],
        submoduleCfg: [],
        userRemoteConfigs: [[url: 'ssh://g...@git.company.com/domain/projectA.git']]])

    stage 'Init'

    def packageInformation = load '../../../scriptler/scripts/package-information.groovy'

    def packages = packageInformation.getPackages()
    println "Packages " + packages

    def buildRequirements = packageInformation.getBuildRequirements()
    println "buildRequirements " + buildRequirements

    stage 'Prebuild'
    println "Prebuild stage"
}

My second Pipeline script I am loading
import java.lang.StringBuilder

def projectName = ""
def packages = new StringBuilder()

def getProjectName() {
    projectName
}

def getPacakges() {
    packages
}

return this;

If I remove return this; I have no problem running the extra pipeline script. Code outside any functions defined are run. However I need to return some values from that script.

Baptiste Mathus

unread,
May 25, 2016, 4:47:02 PM5/25/16
to jenkins...@googlegroups.com
Did you try to click on the link in the logs, named "Click here to forcibly terminate running steps"?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e296a9fd-f0bb-4985-99b8-6e556cf42c36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sverre Moe

unread,
May 26, 2016, 3:45:12 AM5/26/16
to Jenkins Users, m...@batmat.net
Yes I did and it did not do anything. A bit cumbersome if I would have to enter the build console to cancel again.

Lars.M...@edict.de

unread,
May 26, 2016, 3:49:40 AM5/26/16
to jenkins...@googlegroups.com
I had also the same problem and fix that for now via the ScriptConsole of Jenkins with following command:
Jenkins.instance.getItemByFullName("jobName").getBuildByNumber(9).finish(hudson.model.Result.ABORTED, new java.io.IOException("Aborting build"));

.
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/81357d27-4f69-40f8-98e6-9e0cdc30dcdf%40googlegroups.com.
For more options, visit
https://groups.google.com/d/optout.

Craig Rodrigues

unread,
May 26, 2016, 2:45:37 PM5/26/16
to Jenkins Users, m...@batmat.net
Sverre,

I find that the existing user interface for "Click here to forcibly terminate running steps"
is very unintuitive, and as you found, sometimes it doesn't work.

I filed this ticket:

I'm not sure if anyone is working on that right now, but
you can monitor that ticket if you wish.
--
Craig


Reply all
Reply to author
Forward
0 new messages