-
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 ] |
We experience the same error. I added a comment about the behaviour in JENKINS-49278:
When Upgrading from docker-workflow-plugin 1.14 to 1.15 we do not only face the Error Message (JENKINS-49278) but also stopping long running Docker Containers without any reason.
E.G. we have a Gradle Docker-Image with a "gradle" Entrypoint within the Docker-Image itself and a long running Build Process. Since the Upgrade the Docker Container gets stopped after approx. 1 Minute.
Downgraded to 1.14 and everything works fine again.
The Log Difference is as follows: