-
Bug
-
Resolution: Duplicate
-
Critical
-
None
After updating to docker-workflow 1.15 all of my builds that folllow this pattern started exiting with status -1 or -2:
stage ('Unit Tests') { try { dir ("./somewhere/somepath") { sh "./somewhere/some.sh" } def userid = sh(script: 'grep Uid /proc/self/status | cut -f2', returnStdout: true).trim() image.inside("-v ${env.WORKSPACE}:/target -e USER=${env.USER} -e USERID=${userid} -e BRANCH_NAME=${BRANCH_NAME} -u ${userid} --link ...") { c -> sh "./somewhere/someother.sh" junit 'nosetests.xml' step([$class: 'CoberturaPublisher', /* ... */ ]) sh "git clean -fdx" } } finally { sh "./somewhere/somefinal.sh || true" } }
All of the scripts here would run, but somewhere/someother.sh on some jobs would exit early and other jobs (different projects, same format) would complete successfully but still return a -1, such as:
ERROR: script returned exit code -2
Reverting to docker-workflow 1.14 alleviated the problems.
I started with docker-engine 17.06 running on Debian Stretch and while diagnosing these problems upgraded to docker-ce (17.12.0-ce, build c97c6d6). Upgrading docker made no difference.
- blocks
-
JENKINS-49278 cat command in docker agents not detected correctly
-
- Reopened
-
- relates to
-
JENKINS-49278 cat command in docker agents not detected correctly
-
- Reopened
-
[JENKINS-49385] containers exit early in docker-workflow 1.15
Description |
Original:
After updating to docker-workflow 1.15 all of my builds that folllow this pattern started exiting with status -1 or -2: ERROR: script returned exit code -2 in the middle of performing blocks like this: {code:java} sh "something.sh"{code} Reverting to docker-workflow 1.14 alleviated the problems. All of the scripts here would run, but somewhere/someother.sh would exit (as about with a -2) or all of the scripts would complete successfully but still return a -1. {code:java} stage ('Unit Tests') { try { dir ("./somewhere/somepath") { sh "./somewhere/some.sh" } def userid = sh(script: 'grep Uid /proc/self/status | cut -f2', returnStdout: true).trim() image.inside("-v ${env.WORKSPACE}:/target -e USER=${env.USER} -e USERID=${userid} -e BRANCH_NAME=${BRANCH_NAME} -u ${userid} --link ...") { c -> sh "./somewhere/someother.sh" junit 'nosetests.xml' step([$class: 'CoberturaPublisher', /* ... */ ]) sh "git clean -fdx" } } finally { sh "./somewhere/somefinal.sh || true" } }{code} |
New:
After updating to docker-workflow 1.15 all of my builds that folllow this pattern started exiting with status -1 or -2: {code:java} stage ('Unit Tests') { try { dir ("./somewhere/somepath") { sh "./somewhere/some.sh" } def userid = sh(script: 'grep Uid /proc/self/status | cut -f2', returnStdout: true).trim() image.inside("-v ${env.WORKSPACE}:/target -e USER=${env.USER} -e USERID=${userid} -e BRANCH_NAME=${BRANCH_NAME} -u ${userid} --link ...") { c -> sh "./somewhere/someother.sh" junit 'nosetests.xml' step([$class: 'CoberturaPublisher', /* ... */ ]) sh "git clean -fdx" } } finally { sh "./somewhere/somefinal.sh || true" } }{code} All of the scripts here would run, but somewhere/someother.sh would exit (as about with a -2) or all of the scripts would complete successfully but still return a -1, such as: {code:java} ERROR: script returned exit code -2{code} Reverting to docker-workflow 1.14 alleviated the problems. |
Description |
Original:
After updating to docker-workflow 1.15 all of my builds that folllow this pattern started exiting with status -1 or -2: {code:java} stage ('Unit Tests') { try { dir ("./somewhere/somepath") { sh "./somewhere/some.sh" } def userid = sh(script: 'grep Uid /proc/self/status | cut -f2', returnStdout: true).trim() image.inside("-v ${env.WORKSPACE}:/target -e USER=${env.USER} -e USERID=${userid} -e BRANCH_NAME=${BRANCH_NAME} -u ${userid} --link ...") { c -> sh "./somewhere/someother.sh" junit 'nosetests.xml' step([$class: 'CoberturaPublisher', /* ... */ ]) sh "git clean -fdx" } } finally { sh "./somewhere/somefinal.sh || true" } }{code} All of the scripts here would run, but somewhere/someother.sh would exit (as about with a -2) or all of the scripts would complete successfully but still return a -1, such as: {code:java} ERROR: script returned exit code -2{code} Reverting to docker-workflow 1.14 alleviated the problems. |
New:
After updating to docker-workflow 1.15 all of my builds that folllow this pattern started exiting with status -1 or -2: {code:java} stage ('Unit Tests') { try { dir ("./somewhere/somepath") { sh "./somewhere/some.sh" } def userid = sh(script: 'grep Uid /proc/self/status | cut -f2', returnStdout: true).trim() image.inside("-v ${env.WORKSPACE}:/target -e USER=${env.USER} -e USERID=${userid} -e BRANCH_NAME=${BRANCH_NAME} -u ${userid} --link ...") { c -> sh "./somewhere/someother.sh" junit 'nosetests.xml' step([$class: 'CoberturaPublisher', /* ... */ ]) sh "git clean -fdx" } } finally { sh "./somewhere/somefinal.sh || true" } }{code} All of the scripts here would run, but somewhere/someother.sh on some jobs would exit early and other jobs (different projects, same format) would complete successfully but still return a -1, such as: {code:java} ERROR: script returned exit code -2{code} Reverting to docker-workflow 1.14 alleviated the problems. |
Description |
Original:
After updating to docker-workflow 1.15 all of my builds that folllow this pattern started exiting with status -1 or -2: {code:java} stage ('Unit Tests') { try { dir ("./somewhere/somepath") { sh "./somewhere/some.sh" } def userid = sh(script: 'grep Uid /proc/self/status | cut -f2', returnStdout: true).trim() image.inside("-v ${env.WORKSPACE}:/target -e USER=${env.USER} -e USERID=${userid} -e BRANCH_NAME=${BRANCH_NAME} -u ${userid} --link ...") { c -> sh "./somewhere/someother.sh" junit 'nosetests.xml' step([$class: 'CoberturaPublisher', /* ... */ ]) sh "git clean -fdx" } } finally { sh "./somewhere/somefinal.sh || true" } }{code} All of the scripts here would run, but somewhere/someother.sh on some jobs would exit early and other jobs (different projects, same format) would complete successfully but still return a -1, such as: {code:java} ERROR: script returned exit code -2{code} Reverting to docker-workflow 1.14 alleviated the problems. |
New:
After updating to docker-workflow 1.15 all of my builds that folllow this pattern started exiting with status -1 or -2: {code:java} stage ('Unit Tests') { try { dir ("./somewhere/somepath") { sh "./somewhere/some.sh" } def userid = sh(script: 'grep Uid /proc/self/status | cut -f2', returnStdout: true).trim() image.inside("-v ${env.WORKSPACE}:/target -e USER=${env.USER} -e USERID=${userid} -e BRANCH_NAME=${BRANCH_NAME} -u ${userid} --link ...") { c -> sh "./somewhere/someother.sh" junit 'nosetests.xml' step([$class: 'CoberturaPublisher', /* ... */ ]) sh "git clean -fdx" } } finally { sh "./somewhere/somefinal.sh || true" } }{code} All of the scripts here would run, but somewhere/someother.sh on some jobs would exit early and other jobs (different projects, same format) would complete successfully but still return a -1, such as: {code:java} ERROR: script returned exit code -2{code} Reverting to docker-workflow 1.14 alleviated the problems. I started with docker-engine 17.06 running on Debian Stretch and while diagnosing these problems upgraded to docker-ce (17.12.0-ce, build c97c6d6). Upgrading docker made no difference. |
Link | New: This issue relates to JENKINS-49278 [ JENKINS-49278 ] |
Priority | Original: Minor [ 4 ] | New: Critical [ 2 ] |
Resolution | New: Fixed [ 1 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |
Resolution | Original: Fixed [ 1 ] | |
Status | Original: Resolved [ 5 ] | New: Reopened [ 4 ] |
Assignee | New: Nicolas De Loof [ ndeloof ] |
Link | New: This issue blocks JENKINS-49278 [ JENKINS-49278 ] |
Resolution | New: Duplicate [ 3 ] | |
Status | Original: Reopened [ 4 ] | New: Resolved [ 5 ] |