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

(all files in zip) link generates a zip archive that doesn't maintain permissions

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: core
    • Labels:
    • Environment:
      Linux RHEL6 x86-64
    • Similar Issues:

      Description

      When using a the option to download all artifacts as a zip on a Linux job, the resulting archive doesn't maintain the permissions of the original file. A couple years ago, this used to work. It first broke for us when we upgrade to a 1.5x LTS release. We've recently switched to latest (1.598) and it is still broke.

      Here is an example from directory in a slave's workspace that is part of the archived artifacts:

      ls -l | head -4
      total 42288
      -rwxr-xr-x 1 goesrjen goesrsw    74575 Feb 10 10:01 CreateSizes
      -rwxr-xr-x 1 goesrjen goesrsw      832 Apr  2  2014 create-workspace
      -rw-r--r-- 1 goesrjen goesrsw 25816831 Jan 26 20:19 GroundServiceApp.jar
      

      When I download all artifacts as a zip, this is what is in the directory after extraction:

      ls -l | head -4
      total 42288
      -rw-r--r-- 1 davidsj2 goesrsw    74575 Feb 10 10:01 CreateSizes
      -rw-r--r-- 1 davidsj2 goesrsw      832 Apr  2  2014 create-workspace
      -rw-r--r-- 1 davidsj2 goesrsw 25816831 Jan 26 20:19 GroundServiceApp.jar
      

      If I manually "zip -r <dir>.zip <dir>" on the slave, and then unzip everything is fine, so it has something to do with how Jenkins is creating the zip file.

        Attachments

          Activity

          Hide
          danielbeck Daniel Beck added a comment -

          If I manually "zip -r <dir>.zip <dir>" on the slave, and then unzip everything is fine, so it has something to do with how Jenkins is creating the zip file.

          Build artifacts are stored on the master.

          Show
          danielbeck Daniel Beck added a comment - If I manually "zip -r <dir>.zip <dir>" on the slave, and then unzip everything is fine, so it has something to do with how Jenkins is creating the zip file. Build artifacts are stored on the master.
          Hide
          davidsj2 Josh Davidson added a comment -

          Fair enough, but it's the same problem:

          -bash-4.1$ pwd
          /disk01/jenkins/jobs/sast_product_linux64/lastSuccessful/archive/dist/bin
          -bash-4.1$ ls -l | head -4
          total 42288
          -rwxr-xr-x 1 goesrjen goesrsw    74575 Feb 10 10:01 CreateSizes
          -rwxr-xr-x 1 goesrjen goesrsw      832 Apr  2  2014 create-workspace
          -rw-r--r-- 1 goesrjen goesrsw 25816831 Jan 26 20:19 GroundServiceApp.jar
          
          Show
          davidsj2 Josh Davidson added a comment - Fair enough, but it's the same problem: -bash-4.1$ pwd /disk01/jenkins/jobs/sast_product_linux64/lastSuccessful/archive/dist/bin -bash-4.1$ ls -l | head -4 total 42288 -rwxr-xr-x 1 goesrjen goesrsw 74575 Feb 10 10:01 CreateSizes -rwxr-xr-x 1 goesrjen goesrsw 832 Apr 2 2014 create-workspace -rw-r--r-- 1 goesrjen goesrsw 25816831 Jan 26 20:19 GroundServiceApp.jar
          Hide
          danielbeck Daniel Beck added a comment -

          Interesting.

          Possible first version to behave like this could be 1.532 (for JENKINS-17236).

          Obvious workaround would be to tar things to be sure all metadata and types (Jenkins also does not archive symlinks properly in all cases) are retained.

          Show
          danielbeck Daniel Beck added a comment - Interesting. Possible first version to behave like this could be 1.532 (for JENKINS-17236 ). Obvious workaround would be to tar things to be sure all metadata and types (Jenkins also does not archive symlinks properly in all cases) are retained.
          Hide
          davidsj2 Josh Davidson added a comment -

          We considered the tar approach, but then you lose fingerprinting.

          Show
          davidsj2 Josh Davidson added a comment - We considered the tar approach, but then you lose fingerprinting.
          Hide
          danielbeck Daniel Beck added a comment -

          Fingerprinter Plugin allows fingerprinting arbitrary files. It's a bit redundant but may work for you.

          Show
          danielbeck Daniel Beck added a comment - Fingerprinter Plugin allows fingerprinting arbitrary files. It's a bit redundant but may work for you.

            People

            • Assignee:
              Unassigned
              Reporter:
              davidsj2 Josh Davidson
            • Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: