• Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Critical Critical
    • docker-workflow-plugin
    • None

      Same title and description as the linked issue:

      create a job called "my job" with the following pipeline

      node ("master") {
          sh 'pwd'
          img = docker.image("ubuntu:16.04")
          img.inside {
              sh 'pwd'
          }
      }
      
      [Pipeline] node
      Running on principal in /var/lib/jenkins/workspace/QA/test@2
      [Pipeline] {
      [Pipeline] sh
      [test@2] Running shell script
      + pwd
      /var/lib/jenkins/workspace/QA/test@2
      [Pipeline] sh
      [test@2] Running shell script
      + docker inspect -f . ubuntu:16.04
      .
      [Pipeline] withDockerContainer
      $ docker run -t -d -u 0:0 -w /var/lib/jenkins/workspace/QA/test@2 -v /var/lib/jenkins/workspace/QA/test@2:/var/lib/jenkins/workspace/QA/test@2:rw -v /var/lib/jenkins/workspace/QA/test@2@tmp:/var/lib/jenkins/workspace/QA/test@2@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** ubuntu:16.04 cat
      [Pipeline] {
      [Pipeline] sh
      [test@2] Running shell script
      sh: 1: cannot create /var/lib/jenkins/workspace/QA/test@2@tmp/durable-c09e8ac6/pid: Directory nonexistent
      sh: 1: cannot create /var/lib/jenkins/workspace/QA/test@2@tmp/durable-c09e8ac6/jenkins-log.txt: Directory nonexistent
      sh: 1: cannot create /var/lib/jenkins/workspace/QA/test@2@tmp/durable-c09e8ac6/jenkins-result.txt: Directory nonexistent
      [Pipeline] }
      $ docker stop ca85a433cd90117673efd3a660ed6846b6a1c5181ebd0916d38bb4efd879a45a
      $ docker rm -f ca85a433cd90117673efd3a660ed6846b6a1c5181ebd0916d38bb4efd879a45a
      [Pipeline] // withDockerContainer
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      ERROR: script returned exit code -2
      Finished: FAILURE
      

      Opposed to JENKINS-33632, docker-workflow is already at 1.4 version

          [JENKINS-35217] docker.inside broken

          Javier Delgado created issue -
          Javier Delgado made changes -
          Link New: This issue is related to JENKINS-33632 [ JENKINS-33632 ]
          Javier Delgado made changes -
          Description Original: Same title and description as the linked issue:

          create a job called "my job" with the following pipeline

          {code:sh}
          node ("master") {
              sh 'pwd'
              img = docker.image("ubuntu:16.04")
              img.inside {
                  sh 'pwd'
              }
          }
          {code}

          {code:sh}
          [Pipeline] node
          Running on principal in /var/lib/jenkins/workspace/QA/test@2
          [Pipeline] {
          [Pipeline] sh
          [test@2] Running shell script
          + pwd
          /var/lib/jenkins/workspace/QA/test@2
          [Pipeline] sh
          [test@2] Running shell script
          + docker inspect -f . ubuntu:16.04
          .
          [Pipeline] withDockerContainer
          $ docker run -t -d -u 0:0 -w /var/lib/jenkins/workspace/QA/test@2 -v /var/lib/jenkins/workspace/QA/test@2:/var/lib/jenkins/workspace/QA/test@2:rw -v /var/lib/jenkins/workspace/QA/test@2@tmp:/var/lib/jenkins/workspace/QA/test@2@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** ubuntu:16.04 cat
          [Pipeline] {
          [Pipeline] sh
          [test@2] Running shell script
          sh: 1: cannot create /var/lib/jenkins/workspace/QA/test@2@tmp/durable-c09e8ac6/pid: Directory nonexistent
          sh: 1: cannot create /var/lib/jenkins/workspace/QA/test@2@tmp/durable-c09e8ac6/jenkins-log.txt: Directory nonexistent
          sh: 1: cannot create /var/lib/jenkins/workspace/QA/test@2@tmp/durable-c09e8ac6/jenkins-result.txt: Directory nonexistent
          [Pipeline] }
          $ docker stop ca85a433cd90117673efd3a660ed6846b6a1c5181ebd0916d38bb4efd879a45a
          $ docker rm -f ca85a433cd90117673efd3a660ed6846b6a1c5181ebd0916d38bb4efd879a45a
          [Pipeline] // withDockerContainer
          [Pipeline] }
          [Pipeline] // node
          [Pipeline] End of Pipeline
          ERROR: script returned exit code -2
          Finished: FAILURE
          {code}
          New: Same title and description as the linked issue:

          create a job called "my job" with the following pipeline

          {code:sh}
          node ("master") {
              sh 'pwd'
              img = docker.image("ubuntu:16.04")
              img.inside {
                  sh 'pwd'
              }
          }
          {code}

          {code:sh}
          [Pipeline] node
          Running on principal in /var/lib/jenkins/workspace/QA/test@2
          [Pipeline] {
          [Pipeline] sh
          [test@2] Running shell script
          + pwd
          /var/lib/jenkins/workspace/QA/test@2
          [Pipeline] sh
          [test@2] Running shell script
          + docker inspect -f . ubuntu:16.04
          .
          [Pipeline] withDockerContainer
          $ docker run -t -d -u 0:0 -w /var/lib/jenkins/workspace/QA/test@2 -v /var/lib/jenkins/workspace/QA/test@2:/var/lib/jenkins/workspace/QA/test@2:rw -v /var/lib/jenkins/workspace/QA/test@2@tmp:/var/lib/jenkins/workspace/QA/test@2@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** ubuntu:16.04 cat
          [Pipeline] {
          [Pipeline] sh
          [test@2] Running shell script
          sh: 1: cannot create /var/lib/jenkins/workspace/QA/test@2@tmp/durable-c09e8ac6/pid: Directory nonexistent
          sh: 1: cannot create /var/lib/jenkins/workspace/QA/test@2@tmp/durable-c09e8ac6/jenkins-log.txt: Directory nonexistent
          sh: 1: cannot create /var/lib/jenkins/workspace/QA/test@2@tmp/durable-c09e8ac6/jenkins-result.txt: Directory nonexistent
          [Pipeline] }
          $ docker stop ca85a433cd90117673efd3a660ed6846b6a1c5181ebd0916d38bb4efd879a45a
          $ docker rm -f ca85a433cd90117673efd3a660ed6846b6a1c5181ebd0916d38bb4efd879a45a
          [Pipeline] // withDockerContainer
          [Pipeline] }
          [Pipeline] // node
          [Pipeline] End of Pipeline
          ERROR: script returned exit code -2
          Finished: FAILURE
          {code}

          Opposed to JENKINS-33632, docker-workflow is already at 1.4 version

          Mike English added a comment -

          I am also experiencing this issue on Jenkins 2.7.
          Could it be related to JENKINS-27152 changes not being in sync somewhere?

          My Plugins:

          ace-editor:1.1
          ant:1.3
          antisamy-markup-formatter:1.3
          authentication-tokens:1.2
          branch-api:1.8
          build-timeout:1.16
          cloudbees-folder:5.11
          credentials-binding:1.7
          credentials:2.0.6
          docker-commons:1.3.1
          docker-workflow:1.4
          durable-task:1.10
          email-ext:2.42
          external-monitor-job:1.4
          git-client:1.19.6
          git-server:1.6
          git:2.4.4
          github-api:1.75
          github-branch-source:1.7
          github-organization-folder:1.3
          github:1.19.1
          gradle:1.24
          handlebars:1.1.1
          icon-shim:2.0.3
          javadoc:1.3
          jquery-detached:1.2.1
          junit:1.13
          ldap:1.12
          mailer:1.17
          mapdb-api:1.0.9.0
          matrix-auth:1.4
          matrix-project:1.7
          momentjs:1.1.1
          pam-auth:1.2
          pipeline-build-step:2.0
          pipeline-input-step:2.0
          pipeline-rest-api:1.4
          pipeline-stage-step:2.1
          pipeline-stage-view:1.4
          plain-credentials:1.2
          scm-api:1.2
          script-security:1.19
          ssh-credentials:1.12
          ssh-slaves:1.11
          structs:1.1
          subversion:2.5.7
          swarm:2.1
          timestamper:1.8.2
          token-macro:1.12.1
          windows-slaves:1.1
          workflow-aggregator:2.1
          workflow-api:2.0
          workflow-basic-steps:2.0
          workflow-cps-global-lib:2.0
          workflow-cps:2.4
          workflow-durable-task-step:2.0
          workflow-job:2.2
          workflow-multibranch:2.4
          workflow-scm-step:2.0
          workflow-step-api:2.1
          workflow-support:2.0
          ws-cleanup:0.29
          

          Let me know if there's any info I can provide to assist with troubleshooting.

          Mike English added a comment - I am also experiencing this issue on Jenkins 2.7. Could it be related to JENKINS-27152 changes not being in sync somewhere? My Plugins: ace-editor:1.1 ant:1.3 antisamy-markup-formatter:1.3 authentication-tokens:1.2 branch-api:1.8 build-timeout:1.16 cloudbees-folder:5.11 credentials-binding:1.7 credentials:2.0.6 docker-commons:1.3.1 docker-workflow:1.4 durable-task:1.10 email-ext:2.42 external-monitor-job:1.4 git-client:1.19.6 git-server:1.6 git:2.4.4 github-api:1.75 github-branch-source:1.7 github-organization-folder:1.3 github:1.19.1 gradle:1.24 handlebars:1.1.1 icon-shim:2.0.3 javadoc:1.3 jquery-detached:1.2.1 junit:1.13 ldap:1.12 mailer:1.17 mapdb-api:1.0.9.0 matrix-auth:1.4 matrix-project:1.7 momentjs:1.1.1 pam-auth:1.2 pipeline-build-step:2.0 pipeline-input-step:2.0 pipeline- rest -api:1.4 pipeline-stage-step:2.1 pipeline-stage-view:1.4 plain-credentials:1.2 scm-api:1.2 script-security:1.19 ssh-credentials:1.12 ssh-slaves:1.11 structs:1.1 subversion:2.5.7 swarm:2.1 timestamper:1.8.2 token-macro:1.12.1 windows-slaves:1.1 workflow-aggregator:2.1 workflow-api:2.0 workflow-basic-steps:2.0 workflow-cps-global-lib:2.0 workflow-cps:2.4 workflow-durable-task-step:2.0 workflow-job:2.2 workflow-multibranch:2.4 workflow-scm-step:2.0 workflow-step-api:2.1 workflow-support:2.0 ws-cleanup:0.29 Let me know if there's any info I can provide to assist with troubleshooting.
          Jesse Glick made changes -
          Component/s New: docker-workflow-plugin [ 20625 ]
          Component/s Original: workflow-plugin [ 18820 ]
          Jesse Glick made changes -
          Description Original: Same title and description as the linked issue:

          create a job called "my job" with the following pipeline

          {code:sh}
          node ("master") {
              sh 'pwd'
              img = docker.image("ubuntu:16.04")
              img.inside {
                  sh 'pwd'
              }
          }
          {code}

          {code:sh}
          [Pipeline] node
          Running on principal in /var/lib/jenkins/workspace/QA/test@2
          [Pipeline] {
          [Pipeline] sh
          [test@2] Running shell script
          + pwd
          /var/lib/jenkins/workspace/QA/test@2
          [Pipeline] sh
          [test@2] Running shell script
          + docker inspect -f . ubuntu:16.04
          .
          [Pipeline] withDockerContainer
          $ docker run -t -d -u 0:0 -w /var/lib/jenkins/workspace/QA/test@2 -v /var/lib/jenkins/workspace/QA/test@2:/var/lib/jenkins/workspace/QA/test@2:rw -v /var/lib/jenkins/workspace/QA/test@2@tmp:/var/lib/jenkins/workspace/QA/test@2@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** ubuntu:16.04 cat
          [Pipeline] {
          [Pipeline] sh
          [test@2] Running shell script
          sh: 1: cannot create /var/lib/jenkins/workspace/QA/test@2@tmp/durable-c09e8ac6/pid: Directory nonexistent
          sh: 1: cannot create /var/lib/jenkins/workspace/QA/test@2@tmp/durable-c09e8ac6/jenkins-log.txt: Directory nonexistent
          sh: 1: cannot create /var/lib/jenkins/workspace/QA/test@2@tmp/durable-c09e8ac6/jenkins-result.txt: Directory nonexistent
          [Pipeline] }
          $ docker stop ca85a433cd90117673efd3a660ed6846b6a1c5181ebd0916d38bb4efd879a45a
          $ docker rm -f ca85a433cd90117673efd3a660ed6846b6a1c5181ebd0916d38bb4efd879a45a
          [Pipeline] // withDockerContainer
          [Pipeline] }
          [Pipeline] // node
          [Pipeline] End of Pipeline
          ERROR: script returned exit code -2
          Finished: FAILURE
          {code}

          Opposed to JENKINS-33632, docker-workflow is already at 1.4 version
          New: Same title and description as the linked issue:

          create a job called "my job" with the following pipeline

          {code}
          node ("master") {
              sh 'pwd'
              img = docker.image("ubuntu:16.04")
              img.inside {
                  sh 'pwd'
              }
          }
          {code}

          {code:none}
          [Pipeline] node
          Running on principal in /var/lib/jenkins/workspace/QA/test@2
          [Pipeline] {
          [Pipeline] sh
          [test@2] Running shell script
          + pwd
          /var/lib/jenkins/workspace/QA/test@2
          [Pipeline] sh
          [test@2] Running shell script
          + docker inspect -f . ubuntu:16.04
          .
          [Pipeline] withDockerContainer
          $ docker run -t -d -u 0:0 -w /var/lib/jenkins/workspace/QA/test@2 -v /var/lib/jenkins/workspace/QA/test@2:/var/lib/jenkins/workspace/QA/test@2:rw -v /var/lib/jenkins/workspace/QA/test@2@tmp:/var/lib/jenkins/workspace/QA/test@2@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** ubuntu:16.04 cat
          [Pipeline] {
          [Pipeline] sh
          [test@2] Running shell script
          sh: 1: cannot create /var/lib/jenkins/workspace/QA/test@2@tmp/durable-c09e8ac6/pid: Directory nonexistent
          sh: 1: cannot create /var/lib/jenkins/workspace/QA/test@2@tmp/durable-c09e8ac6/jenkins-log.txt: Directory nonexistent
          sh: 1: cannot create /var/lib/jenkins/workspace/QA/test@2@tmp/durable-c09e8ac6/jenkins-result.txt: Directory nonexistent
          [Pipeline] }
          $ docker stop ca85a433cd90117673efd3a660ed6846b6a1c5181ebd0916d38bb4efd879a45a
          $ docker rm -f ca85a433cd90117673efd3a660ed6846b6a1c5181ebd0916d38bb4efd879a45a
          [Pipeline] // withDockerContainer
          [Pipeline] }
          [Pipeline] // node
          [Pipeline] End of Pipeline
          ERROR: script returned exit code -2
          Finished: FAILURE
          {code}

          Opposed to JENKINS-33632, docker-workflow is already at 1.4 version

          Jesse Glick added a comment -

          Working for me. Any known way to reproduce from scratch? (New Jenkins installation, etc.)

          Jesse Glick added a comment - Working for me. Any known way to reproduce from scratch? (New Jenkins installation, etc.)

          Mike English added a comment -

          jglick I just updated to the latest plugins and tried again. Still getting the same results.

          My setup is essentially a new Jenkins installation using docker images for both master and agents.
          The agents are registered using Jenkins Swarm and have docker installed (and the host's Docker socket mounted) so they can spin up additional containers...

          ...As I'm saying this I'm realizing that depending on how/where the tmp dir gets created and mounted, my "docker from docker" setup may actually be the root of my issue here.

          More details in this gist:
          https://gist.github.com/englishm-llnw/3a3409f03194cefa2d2d2b7ec6e7a67f

          Mike English added a comment - jglick I just updated to the latest plugins and tried again. Still getting the same results. My setup is essentially a new Jenkins installation using docker images for both master and agents. The agents are registered using Jenkins Swarm and have docker installed (and the host's Docker socket mounted) so they can spin up additional containers... ...As I'm saying this I'm realizing that depending on how/where the tmp dir gets created and mounted, my "docker from docker" setup may actually be the root of my issue here. More details in this gist: https://gist.github.com/englishm-llnw/3a3409f03194cefa2d2d2b7ec6e7a67f

          Mike English added a comment -

          Yep. Mounting /workspace:/workspace fixed my issue. Thanks for rubber-ducking with me. Sorry for the noise.

          https://gist.github.com/englishm-llnw/c4bd89d1438bd8cdf858302753217493#file-docker-compose-yml-L32

          Mike English added a comment - Yep. Mounting /workspace:/workspace fixed my issue. Thanks for rubber-ducking with me. Sorry for the noise. https://gist.github.com/englishm-llnw/c4bd89d1438bd8cdf858302753217493#file-docker-compose-yml-L32

          zbigniew jasinski added a comment - - edited

          Hi All, I got stuck with the same issue. Fresh install, Jenkins 2.7. I have similar configuration (master host, with docker server, jenkins running inside docker container). I want to spawn jobs on docker slaves (using the same docker server). Should Jenkins server and slave workspace be the same? Any hints?

          [Pipeline] node
          Running on master in /var/jenkins_home/workspace/pipeline-docker-test
          [Pipeline] {
          [Pipeline] withDockerServer
          [Pipeline] {
          [Pipeline] sh
          [pipeline-docker-test] Running shell script
          + docker inspect -f . ubuntu
          
          .
          
          [Pipeline] withDockerContainer
          $ docker run -t -d -u 1000:1000 -w /var/jenkins_home/workspace/pipeline-docker-test -v /var/jenkins_home/workspace/pipeline-docker-test:/var/jenkins_home/workspace/pipeline-docker-test:rw -v /var/jenkins_home/workspace/pipeline-docker-test@tmp:/var/jenkins_home/workspace/pipeline-docker-test@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** ubuntu cat
          [Pipeline] {
          [Pipeline] sh
          [pipeline-docker-test] Running shell script
          
          sh: 1: cannot create /var/jenkins_home/workspace/pipeline-docker-test@tmp/durable-faced352/pid: Directory nonexistent
          sh: 1: cannot create /var/jenkins_home/workspace/pipeline-docker-test@tmp/durable-faced352/jenkins-log.txt: Directory nonexistent
          sh: 1: cannot create /var/jenkins_home/workspace/pipeline-docker-test@tmp/durable-faced352/jenkins-result.txt: Directory nonexistent
          
          [Pipeline] }
          $ docker stop 1aa0ae54756d8f6d3027f961ef905f050e2546ed6a097602b22c98be13fd3b1d
          $ docker rm -f 1aa0ae54756d8f6d3027f961ef905f050e2546ed6a097602b22c98be13fd3b1d
          [Pipeline] // withDockerContainer
          [Pipeline] }
          [Pipeline] // withDockerServer
          [Pipeline] }
          [Pipeline] // node
          [Pipeline] End of Pipeline
          ERROR: script returned exit code -2
          Finished: FAILURE
          
          
          

          zbigniew jasinski added a comment - - edited Hi All, I got stuck with the same issue. Fresh install, Jenkins 2.7. I have similar configuration (master host, with docker server, jenkins running inside docker container). I want to spawn jobs on docker slaves (using the same docker server). Should Jenkins server and slave workspace be the same? Any hints? [Pipeline] node Running on master in /var/jenkins_home/workspace/pipeline-docker-test [Pipeline] { [Pipeline] withDockerServer [Pipeline] { [Pipeline] sh [pipeline-docker-test] Running shell script + docker inspect -f . ubuntu . [Pipeline] withDockerContainer $ docker run -t -d -u 1000:1000 -w /var/jenkins_home/workspace/pipeline-docker-test -v /var/jenkins_home/workspace/pipeline-docker-test:/var/jenkins_home/workspace/pipeline-docker-test:rw -v /var/jenkins_home/workspace/pipeline-docker-test@tmp:/var/jenkins_home/workspace/pipeline-docker-test@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** ubuntu cat [Pipeline] { [Pipeline] sh [pipeline-docker-test] Running shell script sh: 1: cannot create /var/jenkins_home/workspace/pipeline-docker-test@tmp/durable-faced352/pid: Directory nonexistent sh: 1: cannot create /var/jenkins_home/workspace/pipeline-docker-test@tmp/durable-faced352/jenkins-log.txt: Directory nonexistent sh: 1: cannot create /var/jenkins_home/workspace/pipeline-docker-test@tmp/durable-faced352/jenkins-result.txt: Directory nonexistent [Pipeline] } $ docker stop 1aa0ae54756d8f6d3027f961ef905f050e2546ed6a097602b22c98be13fd3b1d $ docker rm -f 1aa0ae54756d8f6d3027f961ef905f050e2546ed6a097602b22c98be13fd3b1d [Pipeline] // withDockerContainer [Pipeline] } [Pipeline] // withDockerServer [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline ERROR: script returned exit code -2 Finished: FAILURE

            jglick Jesse Glick
            witokondoria Javier Delgado
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: