-
Bug
-
Resolution: Unresolved
-
Major
-
Jenkins Master - Linux
Remote Host - Linux
Remote Directory - /opt/bix/home/int/Phase1_Automation/
Remote File - TEST_AUTOMATION_New.ksh
While executing the job which takes 3 parameters from the "Build with parameter" option to execute the remotely placed script,it failed with below error :-
org.hidetake.groovy.ssh.session.BadExitStatusException: Command returned exit status 8: ksh
The script works fine when executed on remote host independently.
Pipeline Script
pipeline {
agent {
kubernetes {
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set
// take job name -1 (dash) - build number length
label "${JOB_NAME.replaceAll("[^a-z0-9A-Z]+", "").replaceAll("^[^a-z0-9A-Z]*", "").take(63 - 1 - BUILD_NUMBER.length())}${BUILD_NUMBER}"
inheritFrom "jenkins-slave"
}
}
stages {
stage("ssh") {
steps {
script {
withCredentials([usernamePassword(credentialsId: "<CRED_ID>", usernameVariable: "USERNAME", passwordVariable: "PASSWORD")])
}
}
}
}
}
[JENKINS-62736] sshCommand returns - org.hidetake.groovy.ssh.session.BadExitStatusException: Command returned exit status 8
Description |
Original:
While executing the job which takes 3 parameters from the "Build with parameter" option to execute the remotely placed script,it failed with below error :- org.hidetake.groovy.ssh.session.BadExitStatusException: Command returned exit status 8: ksh The script works fine when executed on remote host independently. *Pipeline Script * pipeline { agent { kubernetes { // https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set // take job name -1 (dash) - build number length label "${JOB_NAME.replaceAll("[^a-z0-9A-Z]+", "-").replaceAll("^[^a-z0-9A-Z]*", "").take(63 - 1 - BUILD_NUMBER.length())}-${BUILD_NUMBER}" inheritFrom "jenkins-slave" } } stages { stage("ssh") { steps { script { withCredentials([usernamePassword(credentialsId: "<CRED_ID>", usernameVariable: "USERNAME", passwordVariable: "PASSWORD")]) { Map remote = [ name: <HOST_NAME>, host: <HOST>, password: "$PASSWORD", allowAnyHosts: true, user: "$USERNAME", pty: true ] sshCommand remote: remote, command: "/opt/bix/home/int/Phase1_Automation/TEST_AUTOMATION_New.ksh $REL_NAME $TEST_ITERATION $CHECK_TYPE" } } } } } } |
New:
While executing the job which takes 3 parameters from the "Build with parameter" option to execute the remotely placed script,it failed with below error :- org.hidetake.groovy.ssh.session.BadExitStatusException: Command returned exit status 8: ksh The script works fine when executed on remote host independently. *Pipeline Script * pipeline { agent { kubernetes { // https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set // take job name -1 (dash) - build number length label "${JOB_NAME.replaceAll("[^a-z0-9A-Z]+", "-").replaceAll("^[^a-z0-9A-Z]*", "").take(63 - 1 - BUILD_NUMBER.length())}-${BUILD_NUMBER}" inheritFrom "jenkins-slave" } } stages { stage("ssh") { steps { script { withCredentials([usernamePassword(credentialsId: "<CRED_ID>", usernameVariable: "USERNAME", passwordVariable: "PASSWORD")]) { Map remote = [ name: <HOST_NAME>, host: <HOST>, password: "$PASSWORD", allowAnyHosts: true, user: "$USERNAME", pty: true ] sshCommand remote: remote, command: "ksh /opt/bix/home/int/Phase1_Automation/TEST_AUTOMATION_New.ksh $REL_NAME $TEST_ITERATION $CHECK_TYPE" } } } } } } |
Status | Original: Open [ 1 ] | New: In Progress [ 3 ] |
Status | Original: In Progress [ 3 ] | New: Open [ 1 ] |