Uploaded image for project: 'Infrastructure'
  1. Infrastructure
  2. INFRA-3016

Jenkins Docker Image's Test Harness fails with "touch: cannot touch '/var/jenkins_home/copy_reference_file.log': Permission denied[2021-06-17T00:16:11.834Z] # Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?"



    • Similar Issues:


      Marcin Cieślak reported the following in the #jenkins-infra IRC channel:

      the following: "touch: cannot touch '/var/jenkins_home/copy_reference_file.log': Permission denied" appears in lots of tests in CI (https://ci.jenkins.io/job/Packaging/job/docker/job/PR-1118/1/consoleText). I also got it locally on Docker 19.03.13 running on Fedora 33, but not on Docker 20.10.7 running on Debian 10.9... why this happens?

      The error in ci.jenkins.io probably has the same root cause as INFRA-3006: by changing the UID of the user jenkins in agent VMs of ci.jenkins.io (INFRA-2954 -> UID changed from 1000 to 1001), the test harness fails because of permission issue in a Docker volume.

      Error message is quite specific:

      2021-06-17T00:16:11.834Z] not ok 3 [8-debian-buster-hotspot] permissions are propagated from override file
      [2021-06-17T00:16:11.834Z] # (from function `assert_success' in file tests/test_helper/bats-assert/src/assert.bash, line 114,
      [2021-06-17T00:16:11.834Z] # in test file tests/functions.bats, line 40)
      [2021-06-17T00:16:11.834Z] # `assert_success' failed
      [2021-06-17T00:16:11.834Z] #
      [2021-06-17T00:16:11.834Z] # – command failed –
      [2021-06-17T00:16:11.834Z] # status : 1
      [2021-06-17T00:16:11.834Z] # output (2 lines):
      [2021-06-17T00:16:11.834Z] # touch: cannot touch '/var/jenkins_home/copy_reference_file.log': Permission denied
      [2021-06-17T00:16:11.834Z] # Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?
      [2021-06-17T00:16:11.834Z] # –
      [2021-06-17T00:16:11.834Z] #

      Please note that INFRA-2955 (user rootless docker) might also have impact in the future as it would also namespace users (and UIDs), so there is definitively an improvement to be done on the test harness to avoid such issues in the future.



          dduportal Damien Duportal created issue -
          dduportal Damien Duportal made changes -
          Field Original Value New Value
          Assignee Tim Jacomb [ timja ]
          timja Tim Jacomb made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          timja Tim Jacomb made changes -
          Remote Link This issue links to "https://github.com/jenkinsci/docker/pull/1125 (Web Link)" [ 26796 ]
          markewaite Mark Waite made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Closed [ 6 ]


            timja Tim Jacomb
            saper Marcin Cieślak
            0 Vote for this issue
            3 Start watching this issue