Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-36842

docker in docker fail with @tmp permission denied

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • docker
    • None
    • Jenkins2 docker

      I work on jenkins 2.13 with docker slave.

      when i want to run pipeline
      node ('docker-slave')
      docker.image('dockerregistrydev.socrate.vsct.fr/labs/npm:5.11.1').inside

      { sh ("pwd") }

      }

      i get this error:
      sh: /home/jenkins/workspace/test-SGL@tmp/durable-0f3eb18d/pid: No such file or directory
      sh: /home/jenkins/workspace/test-SGL@tmp/durable-0f3eb18d/jenkins-log.txt: No such file or directory
      sh: /home/jenkins/workspace/test-SGL@tmp/durable-0f3eb18d/jenkins-result.txt: No such file or directory

      if i connect on my docker host hand run same command:
      docker run -t -d -u 1000:1000 -w /home/jenkins/workspace/test-SGL -v /home/jenkins/workspace/test-SGL:/home/jenkins/workspace/test-SGL:rw -v /home/jenkins/workspace/test-SGL@tmp:/home/jenkins/workspace/test-SGL@tmp:rw dockerregistrydev.socrate.vsct.fr/labs/npm:5.11.1 cat

      and docker exec <container_id> touch /home/jenkins/workspace/test-SGL@tmp/test,
      i get the same error.

      By default docker create folder /home/jenkins/workspace/test-SGL@tmp with drwxr-xr-x. 2 root root

      If i change privilege with chmod 777 and restart docker exec <container_id> touch /home/jenkins/workspace/test-SGL@tmp/test,

      this is GOOD.

      I think docker can't mount folder with @tmp with the write permission.
      Is it possible to change @tmp by another folder name?

          [JENKINS-36842] docker in docker fail with @tmp permission denied

          I have old job that work with
          -u 0:0

          but after many plugin upgrade, i see than docker run has change and now user -u 1000:1000

          this is the problem.

          sébastien glon added a comment - I have old job that work with -u 0:0 but after many plugin upgrade, i see than docker run has change and now user -u 1000:1000 this is the problem.

          I use docker 1.10.2

          sébastien glon added a comment - I use docker 1.10.2

          if i made watch /home/jenkins/workspace/test-SGL@tmp/
          i can the folder and file created on my jenkins slave but always error

          If i mount on my slave the same container than jenkins pipeline, and check than i can write; all is good.

          I think that come with jenkins-Durable-plugin or method to execute sh step.

          sébastien glon added a comment - if i made watch /home/jenkins/workspace/test-SGL@tmp/ i can the folder and file created on my jenkins slave but always error If i mount on my slave the same container than jenkins pipeline, and check than i can write; all is good. I think that come with jenkins-Durable-plugin or method to execute sh step.

          Anton Hughes added a comment - - edited

          Im also getting this.

          • Kubernetes plugin: 0.10 0.10-SNAPSHOT (private-70e60d4e-jamesrawlings)
          • OpenShift Pipeline Jenkins Plugin: 1.0.4-SNAPSHOT (private-e437d877-jamesrawlings)
          • OpenShift Master: v1.4.1+3f9807a
          • Kubernetes Master: v1.4.0+776c994
          • Docker version 1.12.5, build 047e51b/1.12.5

          Anton Hughes added a comment - - edited Im also getting this. Kubernetes plugin: 0.10 0.10-SNAPSHOT (private-70e60d4e-jamesrawlings) OpenShift Pipeline Jenkins Plugin: 1.0.4-SNAPSHOT (private-e437d877-jamesrawlings) OpenShift Master: v1.4.1+3f9807a Kubernetes Master: v1.4.0+776c994 Docker version 1.12.5, build 047e51b/1.12.5

          I am also hitting this. Is there no workaround / solution for this yet? It basically makes the docker environment completely unusable for pipeline builds.

          Kevin Phillips added a comment - I am also hitting this. Is there no workaround / solution for this yet? It basically makes the docker environment completely unusable for pipeline builds.

          Hmmm - so, in my case it looks like the errors were caused by an out of date plugin. Apparently when I updated the main pipeline plugins I missed the docker pipeline one. After updating it my builds started working again.

          Based on my brief review of the build logs, it looks like the previous version of the plugin I was using wasn't mounting the @tmp folders to the container, which made those folders non-existent in the container resulting in the build errors.

          Sorry for the false alarm.

          Kevin Phillips added a comment - Hmmm - so, in my case it looks like the errors were caused by an out of date plugin. Apparently when I updated the main pipeline plugins I missed the docker pipeline one. After updating it my builds started working again. Based on my brief review of the build logs, it looks like the previous version of the plugin I was using wasn't mounting the @tmp folders to the container, which made those folders non-existent in the container resulting in the build errors. Sorry for the false alarm.

          I'm also experience this issue

          Alexander Kondaurov added a comment - I'm also experience this issue

          scott carlson added a comment - - edited

          I also just experienced this... workaround? anyone?

           

          ndeloof,

          All of these seem to be closely related and they are all closed?  I am wondering why since the issue persist.

           https://issues.jenkins-ci.org/browse/JENKINS-34194

          https://issues.jenkins-ci.org/browse/JENKINS-29760

          https://issues.jenkins-ci.org/browse/JENKINS-33962

          https://issues.jenkins-ci.org/browse/JENKINS-33632

          https://issues.jenkins-ci.org/browse/JENKINS-33761

           

          scott carlson added a comment - - edited I also just experienced this... workaround? anyone?   ndeloof , All of these seem to be closely related and they are all closed?  I am wondering why since the issue persist.   https://issues.jenkins-ci.org/browse/JENKINS-34194 https://issues.jenkins-ci.org/browse/JENKINS-29760 https://issues.jenkins-ci.org/browse/JENKINS-33962 https://issues.jenkins-ci.org/browse/JENKINS-33632 https://issues.jenkins-ci.org/browse/JENKINS-33761  

            Unassigned Unassigned
            sebglon sébastien glon
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: