• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • kubernetes-plugin
    • None
    • kubernetes plugin v0.12 or current master
      Jenkins 2.62
      container step running in a _debian_ container

      podTemplate(name: "mypod", label: "label", containers: [
                              containerTemplate(name: 'debian',
                                      image: 'debian',
                                      ttyEnabled: true,
                                      command: 'cat',
                              )
      ]) {
          node("label") {
              container('debian') {
                  sh 'for i in $(seq 1 1000); do echo $i; sleep 0.3; done'
              }
          }
      }
      

      leads to

      [Pipeline] podTemplate
      [Pipeline] {
      [Pipeline] node
      Running on horst-nwmsn-32h5h in /home/jenkins/workspace/full
      [Pipeline] {
      [Pipeline] container
      [Pipeline] {
      [Pipeline] sh
      [full] Running shell script
      + seq 1 1000
      + echo 1
      1
      + sleep 0.3
      + echo 2
      2
      + sleep 0.3
      [Pipeline] }
      [Pipeline] // container
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] }
      [Pipeline] // podTemplate
      [Pipeline] End of Pipeline
      ERROR: script returned exit code -1
      Finished: FAILURE
      

      Sometimes it fails a bit faster.

      Might be related to the script being started with "nohup" now.

          [JENKINS-46651] container step "script returned exit code -1"

          Martin Sander created issue -
          Martin Sander made changes -
          Issue Type Original: New Feature [ 2 ] New: Bug [ 1 ]
          Martin Sander made changes -
          Environment New: kubernetes plugin v0.12 or current master
          Jenkins 2.62
          container step running in a _debian_ container

          Martin Sander added a comment -

          Note:

          Example works with busybox container.

          Martin Sander added a comment - Note: Example works with busybox container.

          Martin Sander added a comment -

          Also works in ubuntu..

          Martin Sander added a comment - Also works in ubuntu..
          Martin Sander made changes -
          Priority Original: Minor [ 4 ] New: Trivial [ 5 ]

          Martin Sander added a comment -

          Seems that the debian:latest container does not have ps by default, and durable-task uses it to check for the process.

          Should we document this?

          Martin Sander added a comment - Seems that the debian:latest container does not have ps by default, and durable-task uses it to check for the process. Should we document this?

          Martin Sander added a comment -

          Btw. workaround is to derive your own image from "debian" and install the procps package in it.

          Martin Sander added a comment - Btw. workaround is to derive your own image from "debian" and install the procps package in it.

          Max k added a comment - - edited

          I have similar problem with exit -1 error but i do have procps package installed and its happens only with 10+ concurrent build of same project.

          kubernetes plugin v1.0
          Jenkins 2.37
          Here is my pipeline:

          tag = env.BUILD_TAG
          podTemplate(label: tag,
              volumes: [
              hostPathVolume(mountPath: '/var/lib/docker', hostPath: '/tmp/'+tag)
              ],
              containers: [
                  containerTemplate(name: 'jnlp', image: 'localreg:5000/jenkinsci/jnlp-slave', args: '${computer.jnlpmac} ${computer.name}'),
                  containerTemplate(name: 'java', image: 'localreg:5000/base/java', ttyEnabled: true, command: 'cat'),
                  containerTemplate(name: 'dind', image: 'localreg:5000/base-builders/dind:1.0.0', ttyEnabled: true, privileged: true, alwaysPullImage: true)
            ]) {
              node(tag) {
                  try {
                      container('jnlp') {
                          stage('Preparing') {
                              checkout scm
                              setGitEnvironmentVariables()
                              setSimpleEnvironmentVariables()
                          }
                      }
                      container('java') {
                          stage('Build a Maven project') {
                              sh 'env'
                          }
                      }
                      container('dind') {
                          stage('Build Docker') {
                              sh "docker build . || echo real bad exit code !"
                          }
                      }
                  } catch (error) {
                      throw error
                  }
              }
          }
          

          Sometimes i receive this error while 10+ concurrent builds are running:

          /home/jenkins/workspace/docker_builds_master-EHQCE25ZSFSE4QALBNHGET3HINBLMWZKHOXT7335PWTFXXMWNJDQ
          [Pipeline] sh
          [docker_builds_master-EHQCE25ZSFSE4QALBNHGET3HINBLMWZKHOXT7335PWTFXXMWNJDQ] Running shell script
          + docker build .
          Sending build context to Docker daemon 74.24 kB
          
          Step 1 : FROM localreg:5000/base/ubuntu-14.04
          latest: Pulling from base/ubuntu-14.04
          96c6a1f3c3b0: Pulling fs layer
          e8c945afff4f: Pulling fs layer
          b46adc58e13f: Pulling fs layer
          e8c945afff4f: Verifying Checksum
          e8c945afff4f: Download complete
          b46adc58e13f: Download complete
          96c6a1f3c3b0: Verifying Checksum
          96c6a1f3c3b0: Download complete
          [Pipeline] }
          [Pipeline] // stage
          [Pipeline] }
          [Pipeline] // container
          [Pipeline] }
          [Pipeline] // node
          [Pipeline] }
          [Pipeline] // podTemplate
          [Pipeline] End of Pipeline
          ERROR: script returned exit code -1
          Finished: FAILURE
          

          Any suggestions what can it be ?

          Max k added a comment - - edited I have similar problem with exit -1 error but i do have procps package installed and its happens only with 10+ concurrent build of same project. kubernetes plugin v1.0 Jenkins 2.37 Here is my pipeline: tag = env.BUILD_TAG podTemplate(label: tag, volumes: [ hostPathVolume(mountPath: '/ var /lib/docker' , hostPath: '/tmp/' +tag) ], containers: [ containerTemplate(name: 'jnlp' , image: 'localreg:5000/jenkinsci/jnlp-slave' , args: '${computer.jnlpmac} ${computer.name}' ), containerTemplate(name: 'java' , image: 'localreg:5000/base/java' , ttyEnabled: true , command: 'cat' ), containerTemplate(name: 'dind' , image: 'localreg:5000/base-builders/dind:1.0.0' , ttyEnabled: true , privileged: true , alwaysPullImage: true ) ]) { node(tag) { try { container( 'jnlp' ) { stage( 'Preparing' ) { checkout scm setGitEnvironmentVariables() setSimpleEnvironmentVariables() } } container( 'java' ) { stage( 'Build a Maven project' ) { sh 'env' } } container( 'dind' ) { stage( 'Build Docker' ) { sh "docker build . || echo real bad exit code !" } } } catch (error) { throw error } } } Sometimes i receive this error while 10+ concurrent builds are running: /home/jenkins/workspace/docker_builds_master-EHQCE25ZSFSE4QALBNHGET3HINBLMWZKHOXT7335PWTFXXMWNJDQ [Pipeline] sh [docker_builds_master-EHQCE25ZSFSE4QALBNHGET3HINBLMWZKHOXT7335PWTFXXMWNJDQ] Running shell script + docker build . Sending build context to Docker daemon 74.24 kB Step 1 : FROM localreg:5000/base/ubuntu-14.04 latest: Pulling from base/ubuntu-14.04 96c6a1f3c3b0: Pulling fs layer e8c945afff4f: Pulling fs layer b46adc58e13f: Pulling fs layer e8c945afff4f: Verifying Checksum e8c945afff4f: Download complete b46adc58e13f: Download complete 96c6a1f3c3b0: Verifying Checksum 96c6a1f3c3b0: Download complete [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // container [Pipeline] } [Pipeline] // node [Pipeline] } [Pipeline] // podTemplate [Pipeline] End of Pipeline ERROR: script returned exit code -1 Finished: FAILURE Any suggestions what can it be ?

          Martin Sander added a comment -

          omegam: Can you try setting org.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_FAILURE_TIMEOUT to something higher than the default 15 seconds, and see if that helps?

          Martin Sander added a comment - omegam : Can you try setting org.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_FAILURE_TIMEOUT to something higher than the default 15 seconds, and see if that helps?

            0x89 Martin Sander
            0x89 Martin Sander
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: