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

stash step on ARM loses execute bit

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: pipeline
    • Environment:
    • Similar Issues:

      Description

      We have a Jenkins server with both x86 and ARM slaves. When running a `stash` pipeline step on the ARM slave, the resulting stash does not preserve the execute bit on files. Of course, it might be some other difference between the slaves than the actual architecture, but I'll need assistance in narrowing down the cause.

      As a demonstration, this pipeline job

      node('tegra-cuda') {
          deleteDir()
          sh 'dd if=/dev/zero of=dummy bs=1M count=1; chmod +x dummy; ls -l dummy'
          stash 'source'
      }
      
      node('tegra-cuda') {
          deleteDir()
          unstash 'source'
          sh 'ls -l dummy'
      }
      

      produces this output:

      [Pipeline] node
      Running on e5f011df5aa1-e069b02f in /var/lib/jenkins/workspace/ARM stash test
      [Pipeline] {
      [Pipeline] deleteDir
      [Pipeline] sh
      [ARM stash test] Running shell script
      + dd if=/dev/zero of=dummy bs=1M count=1
      1+0 records in
      1+0 records out
      1048576 bytes (1.0 MB) copied, 0.00465561 s, 225 MB/s
      + chmod +x dummy
      + ls -l dummy
      -rwxr-xr-x 1 kat kat 1048576 Jul 25 10:40 dummy
      [Pipeline] stash
      Stashed 1 file(s)
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] node
      Running on e5f011df5aa1-e069b02f in /var/lib/jenkins/workspace/ARM stash test
      [Pipeline] {
      [Pipeline] deleteDir
      [Pipeline] unstash
      [Pipeline] sh
      [ARM stash test] Running shell script
      + ls -l dummy
      -rw-r--r-- 1 kat kat 1048576 Jul 25 10:40 dummy
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      Finished: SUCCESS
      

      where `tegra-cuda` is a label for the Tegra X1 slave. The problem seems to be on the creation side rather than the unstashing side (verified by moving one or the other to an the x86_64 node). Using tar in an `sh` step, stashing the tarball, unstashing it, and unpacking it preserves the execute bit.

      This is a newly installed (about a week ago) Jenkins, with no data imported from old versions.

      I've filed this against core rather than a plugin, because a brief bit of code digging shows that stash is eventually implemented by `FilePath.archive`.

        Attachments

          Issue Links

            Activity

            Hide
            olivpasss Oliver Moessinger added a comment -

            same here! I tested some variants:

            Stash on swarm-client node, unstash on swarm-client node:

            node() {
                deleteDir()
                sh 'dd if=/dev/zero of=dummy bs=1M count=1; chmod +x dummy; ls -l dummy'
                stash 'source'
            }
            
            node() {
                deleteDir()
                unstash 'source'
                sh 'ls -l dummy'
            }
            

            Fail, the execute permission is not set after unstash:

            Started by user Admin
            [Pipeline] node
            Running on swarm-testing-3-ae72911c in /workspace/olli
            [Pipeline] {
            [Pipeline] deleteDir
            [Pipeline] sh
            [olli] Running shell script
            + dd if=/dev/zero of=dummy bs=1M count=1
            1+0 records in
            1+0 records out
            + chmod +x dummy
            + ls -l dummy
            -rwxr-xr-x    1 root     root       1048576 Sep 27 10:11 dummy
            [Pipeline] stash
            Stashed 1 file(s)
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] node
            Running on swarm-testing-3-ae72911c in /workspace/olli
            [Pipeline] {
            [Pipeline] deleteDir
            [Pipeline] unstash
            [Pipeline] sh
            [olli] Running shell script
            + ls -l dummy
            -rw-r--r--    1 root     root       1048576 Sep 27 10:11 dummy
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            Finished: SUCCESS
            

            Stash on node "master", unstash on swarm-client node:

            node("master") {
                deleteDir()
                sh 'dd if=/dev/zero of=dummy bs=1M count=1; chmod +x dummy; ls -l dummy'
                stash 'source'
            }
            
            node() {
                deleteDir()
                unstash 'source'
                sh 'ls -l dummy'
            }
            

            works:

             

            Started by user Admin
            [Pipeline] node
            Running on master in /var/jenkins_home/workspace/olli
            [Pipeline] {
            [Pipeline] deleteDir
            [Pipeline] sh
            [olli] Running shell script
            + dd if=/dev/zero of=dummy bs=1M count=1
            1+0 records in
            1+0 records out
            1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.00373751 s, 281 MB/s
            + chmod +x dummy
            + ls -l dummy
            -rwxr-xr-x 1 jenkins jenkins 1048576 Sep 27 10:12 dummy
            [Pipeline] stash
            Stashed 1 file(s)
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] node
            Running on swarm-testing-4-b7e1c8ae in /workspace/olli
            [Pipeline] {
            [Pipeline] deleteDir
            [Pipeline] unstash
            [Pipeline] sh
            [olli] Running shell script
            + ls -l dummy
            -rwxr-xr-x    1 root     root       1048576 Sep 27 10:12 dummy
            [Pipeline] }
            [Pipeline] // node
            [Pipeline] End of Pipeline
            Finished: SUCCESS
            
            

             

            Show
            olivpasss Oliver Moessinger added a comment - same here! I tested some variants: Stash on swarm-client node, unstash on swarm-client node: node() {     deleteDir()     sh 'dd if =/dev/zero of=dummy bs=1M count=1; chmod +x dummy; ls -l dummy'     stash 'source' } node() {     deleteDir()     unstash 'source'     sh 'ls -l dummy' } Fail, the execute permission is not set after unstash: Started by user Admin [Pipeline] node Running on swarm-testing-3-ae72911c in /workspace/olli [Pipeline] { [Pipeline] deleteDir [Pipeline] sh [olli] Running shell script + dd if =/dev/zero of=dummy bs=1M count=1 1+0 records in 1+0 records out + chmod +x dummy + ls -l dummy -rwxr-xr-x 1 root root 1048576 Sep 27 10:11 dummy [Pipeline] stash Stashed 1 file(s) [Pipeline] } [Pipeline] // node [Pipeline] node Running on swarm-testing-3-ae72911c in /workspace/olli [Pipeline] { [Pipeline] deleteDir [Pipeline] unstash [Pipeline] sh [olli] Running shell script + ls -l dummy -rw-r--r-- 1 root root 1048576 Sep 27 10:11 dummy [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline Finished: SUCCESS Stash on node "master", unstash on swarm-client node: node( "master" ) {     deleteDir()     sh 'dd if =/dev/zero of=dummy bs=1M count=1; chmod +x dummy; ls -l dummy'     stash 'source' } node() {     deleteDir()     unstash 'source'     sh 'ls -l dummy' } works:   Started by user Admin [Pipeline] node Running on master in / var /jenkins_home/workspace/olli [Pipeline] { [Pipeline] deleteDir [Pipeline] sh [olli] Running shell script + dd if =/dev/zero of=dummy bs=1M count=1 1+0 records in 1+0 records out 1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.00373751 s, 281 MB/s + chmod +x dummy + ls -l dummy -rwxr-xr-x 1 jenkins jenkins 1048576 Sep 27 10:12 dummy [Pipeline] stash Stashed 1 file(s) [Pipeline] } [Pipeline] // node [Pipeline] node Running on swarm-testing-4-b7e1c8ae in /workspace/olli [Pipeline] { [Pipeline] deleteDir [Pipeline] unstash [Pipeline] sh [olli] Running shell script + ls -l dummy -rwxr-xr-x 1 root root 1048576 Sep 27 10:12 dummy [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline Finished: SUCCESS  

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                bmerry Bruce Merry
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: