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

Download build artifacts as zip generates a corrupted file

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • core
    • Windows XP 32
      java version "1.7.0"
      Java(TM) SE Runtime Environment (build 1.7.0-b147)
      Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode)

      The zip generated by the link http://server/job/myJob/lastSuccessfulBuild/artifact/*zip*/archive.zip generates a zip file in which everything seems ok, but when you try to unzip the content with 7z for instance, it fails (compression method not supported).

      I can't see anything in the logs.
      BTW, the size of the file in the archive are set to 0. Could be a side effect in 7z.

      It works fine with 1.531.

      And finally, there was a modification of something about the compression in 1.532 related to issue JENKINS-19473.

          [JENKINS-19752] Download build artifacts as zip generates a corrupted file

          Mathieu POUSSE added a comment - - edited

          In fact there is a typo in hudson.model.DirectoryBrowserSupport line 348
          should be

          Util.copyStream(f.open(), >>>>>>>zos<<<<<<);

          I have tested on my local and it works. the pull request is waiting !

          https://github.com/jenkinsci/jenkins/pull/954

          Mathieu POUSSE added a comment - - edited In fact there is a typo in hudson.model.DirectoryBrowserSupport line 348 should be Util.copyStream(f.open(), >>>>>>>zos<<<<<<); I have tested on my local and it works. the pull request is waiting ! https://github.com/jenkinsci/jenkins/pull/954

          Bruce Edge added a comment -

          I'm seeing the same thing with 1.532.

          Any zip I pull down using the artifact "all files in one zip" link gives me a zip that fails to unpack:

          Archive: ../upgrade.zip
          warning [../upgrade.zip]: 275536 extra bytes at beginning or within zipfile
          (attempting to process anyway)
          file #1: bad zipfile offset (local header sig): 275536
          (attempting to re-compensate)
          inflating: 1.0.1/prod/update-1.0.0-to-1.0.1.sql
          error: invalid compressed data to inflate
          file #2: bad zipfile offset (local header sig): 84
          (attempting to re-compensate)
          file #2: bad zipfile offset (local header sig): 84
          file #3: bad zipfile offset (local header sig): 275704
          file #4: bad zipfile offset (local header sig): 275786
          file #5: bad zipfile offset (local header sig): 275871
          file #6: bad zipfile offset (local header sig): 275954

          Happens on all projects and all archive directories that I spot checked.

          Bruce Edge added a comment - I'm seeing the same thing with 1.532. Any zip I pull down using the artifact "all files in one zip" link gives me a zip that fails to unpack: Archive: ../upgrade.zip warning [../upgrade.zip] : 275536 extra bytes at beginning or within zipfile (attempting to process anyway) file #1: bad zipfile offset (local header sig): 275536 (attempting to re-compensate) inflating: 1.0.1/prod/update-1.0.0-to-1.0.1.sql error: invalid compressed data to inflate file #2: bad zipfile offset (local header sig): 84 (attempting to re-compensate) file #2: bad zipfile offset (local header sig): 84 file #3: bad zipfile offset (local header sig): 275704 file #4: bad zipfile offset (local header sig): 275786 file #5: bad zipfile offset (local header sig): 275871 file #6: bad zipfile offset (local header sig): 275954 Happens on all projects and all archive directories that I spot checked.

          Bruce Edge added a comment -

          Confirm reverting to 1.531 resolves the issue.

          Bruce Edge added a comment - Confirm reverting to 1.531 resolves the issue.

          Code changed in jenkins
          User: mathieu-pousse
          Path:
          core/src/main/java/hudson/model/DirectoryBrowserSupport.java
          http://jenkins-ci.org/commit/jenkins/11fe787c0a62e70efb85935ae68b53e59f34c064
          Log:
          [FIXED JENKINS-19752] write in the correct outputstream

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: mathieu-pousse Path: core/src/main/java/hudson/model/DirectoryBrowserSupport.java http://jenkins-ci.org/commit/jenkins/11fe787c0a62e70efb85935ae68b53e59f34c064 Log: [FIXED JENKINS-19752] write in the correct outputstream

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          test/src/test/java/hudson/model/DirectoryBrowserSupportTest.java
          http://jenkins-ci.org/commit/jenkins/82af0fb5622f9f913d3cad39c04eb21a2184bef8
          Log:
          JENKINS-19752 Test

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: test/src/test/java/hudson/model/DirectoryBrowserSupportTest.java http://jenkins-ci.org/commit/jenkins/82af0fb5622f9f913d3cad39c04eb21a2184bef8 Log: JENKINS-19752 Test

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          test/src/test/java/hudson/model/DirectoryBrowserSupportTest.java
          http://jenkins-ci.org/commit/jenkins/ca067fd2732d480f637175f072ed0ecdb5d3478c
          Log:
          JENKINS-19752 Forgotten debug statement

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: test/src/test/java/hudson/model/DirectoryBrowserSupportTest.java http://jenkins-ci.org/commit/jenkins/ca067fd2732d480f637175f072ed0ecdb5d3478c Log: JENKINS-19752 Forgotten debug statement

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2897
          [FIXED JENKINS-19752] write in the correct outputstream (Revision 11fe787c0a62e70efb85935ae68b53e59f34c064)
          JENKINS-19752 Test (Revision 82af0fb5622f9f913d3cad39c04eb21a2184bef8)

          Result = UNSTABLE
          mathieu.pousse : 11fe787c0a62e70efb85935ae68b53e59f34c064
          Files :

          • core/src/main/java/hudson/model/DirectoryBrowserSupport.java

          ogondza : 82af0fb5622f9f913d3cad39c04eb21a2184bef8
          Files :

          • test/src/test/java/hudson/model/DirectoryBrowserSupportTest.java

          dogfood added a comment - Integrated in jenkins_main_trunk #2897 [FIXED JENKINS-19752] write in the correct outputstream (Revision 11fe787c0a62e70efb85935ae68b53e59f34c064) JENKINS-19752 Test (Revision 82af0fb5622f9f913d3cad39c04eb21a2184bef8) Result = UNSTABLE mathieu.pousse : 11fe787c0a62e70efb85935ae68b53e59f34c064 Files : core/src/main/java/hudson/model/DirectoryBrowserSupport.java ogondza : 82af0fb5622f9f913d3cad39c04eb21a2184bef8 Files : test/src/test/java/hudson/model/DirectoryBrowserSupportTest.java

          Jesse Glick added a comment -

          Caused by changes for JENKINS-17236; must have tried downloading this link but not opening it, sorry.

          Jesse Glick added a comment - Caused by changes for JENKINS-17236 ; must have tried downloading this link but not opening it, sorry.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2898
          JENKINS-19752 Forgotten debug statement (Revision ca067fd2732d480f637175f072ed0ecdb5d3478c)

          Result = UNSTABLE
          ogondza : ca067fd2732d480f637175f072ed0ecdb5d3478c
          Files :

          • test/src/test/java/hudson/model/DirectoryBrowserSupportTest.java

          dogfood added a comment - Integrated in jenkins_main_trunk #2898 JENKINS-19752 Forgotten debug statement (Revision ca067fd2732d480f637175f072ed0ecdb5d3478c) Result = UNSTABLE ogondza : ca067fd2732d480f637175f072ed0ecdb5d3478c Files : test/src/test/java/hudson/model/DirectoryBrowserSupportTest.java

          Code changed in jenkins
          User: Jesse Glick
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/64f501d81901c5d625f3d0cb5df8105191b266e3
          Log:
          JENKINS-19752 Noting.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html http://jenkins-ci.org/commit/jenkins/64f501d81901c5d625f3d0cb5df8105191b266e3 Log: JENKINS-19752 Noting.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2900
          JENKINS-19752 Noting. (Revision 64f501d81901c5d625f3d0cb5df8105191b266e3)

          Result = UNSTABLE
          Jesse Glick : 64f501d81901c5d625f3d0cb5df8105191b266e3
          Files :

          • changelog.html

          dogfood added a comment - Integrated in jenkins_main_trunk #2900 JENKINS-19752 Noting. (Revision 64f501d81901c5d625f3d0cb5df8105191b266e3) Result = UNSTABLE Jesse Glick : 64f501d81901c5d625f3d0cb5df8105191b266e3 Files : changelog.html

          Mark Servidio added a comment -

          I'm seeing the same issue with 1.533.

          Mark Servidio added a comment - I'm seeing the same issue with 1.533.

          Jesse Glick added a comment -

          The fix is in 1.534.

          Jesse Glick added a comment - The fix is in 1.534.

          heinzepreller added a comment -

          Is it possible that before 1.531 artifact Zips had a Folder inside and with 1.534 they don't ?

          heinzepreller added a comment - Is it possible that before 1.531 artifact Zips had a Folder inside and with 1.534 they don't ?

          Jesse Glick added a comment -

          @heinzepreller see JENKINS-19947.

          Jesse Glick added a comment - @heinzepreller see JENKINS-19947 .

          Code changed in jenkins
          User: mathieu-pousse
          Path:
          core/src/main/java/hudson/model/DirectoryBrowserSupport.java
          http://jenkins-ci.org/commit/jenkins/9b280bbe60ce94bd2bf310055c527beca70f3c6d
          Log:
          [FIXED JENKINS-19752] write in the correct outputstream

          (cherry picked from commit 11fe787c0a62e70efb85935ae68b53e59f34c064)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: mathieu-pousse Path: core/src/main/java/hudson/model/DirectoryBrowserSupport.java http://jenkins-ci.org/commit/jenkins/9b280bbe60ce94bd2bf310055c527beca70f3c6d Log: [FIXED JENKINS-19752] write in the correct outputstream (cherry picked from commit 11fe787c0a62e70efb85935ae68b53e59f34c064)

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          test/src/test/java/hudson/model/DirectoryBrowserSupportTest.java
          http://jenkins-ci.org/commit/jenkins/2652a3a5da5e615baedbc0e6eca671c82f61afc0
          Log:
          JENKINS-19752 Test

          (cherry picked from commit 82af0fb5622f9f913d3cad39c04eb21a2184bef8)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: test/src/test/java/hudson/model/DirectoryBrowserSupportTest.java http://jenkins-ci.org/commit/jenkins/2652a3a5da5e615baedbc0e6eca671c82f61afc0 Log: JENKINS-19752 Test (cherry picked from commit 82af0fb5622f9f913d3cad39c04eb21a2184bef8)

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          test/src/test/java/hudson/model/DirectoryBrowserSupportTest.java
          http://jenkins-ci.org/commit/jenkins/9e1e164df9c1ee0053da8c638ff228feddd3351c
          Log:
          JENKINS-19752 Forgotten debug statement

          (cherry picked from commit ca067fd2732d480f637175f072ed0ecdb5d3478c)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: test/src/test/java/hudson/model/DirectoryBrowserSupportTest.java http://jenkins-ci.org/commit/jenkins/9e1e164df9c1ee0053da8c638ff228feddd3351c Log: JENKINS-19752 Forgotten debug statement (cherry picked from commit ca067fd2732d480f637175f072ed0ecdb5d3478c)

          Victor Baca added a comment -

          Issue reappeared in release 1.536. It was last working in 1.535.

          Victor Baca added a comment - Issue reappeared in release 1.536. It was last working in 1.535.

          Jesse Glick added a comment -

          @eyeamvic just rechecked in 1.536 and it is working fine for me. Make sure you are really running a new version of Jenkins, and if you can still reproduce, file a new issue with complete details and link to this one.

          Jesse Glick added a comment - @eyeamvic just rechecked in 1.536 and it is working fine for me. Make sure you are really running a new version of Jenkins, and if you can still reproduce, file a new issue with complete details and link to this one.

          Happens to me as well in releases 1.536 & 1.540

          Yoram Michaeli added a comment - Happens to me as well in releases 1.536 & 1.540

          Yoram Michaeli added a comment - - edited

          Happens to me in 1.535, 1.536, 1.539

          yorammi-macbook:temp Yoram$ unzip ../archive\ (3).zip
          Archive: ../archive (3).zip
          End-of-central-directory signature not found. Either this file is not
          a zipfile, or it constitutes one disk of a multi-part archive. In the
          latter case the central directory and zipfile comment will be found on
          the last disk(s) of this archive.
          unzip: cannot find zipfile directory in one of ../archive (3).zip or
          ../archive (3).zip.zip, and cannot find ../archive (3).zip.ZIP, period.

          Yoram Michaeli added a comment - - edited Happens to me in 1.535, 1.536, 1.539 yorammi-macbook:temp Yoram$ unzip ../archive\ (3).zip Archive: ../archive (3).zip End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive. unzip: cannot find zipfile directory in one of ../archive (3).zip or ../archive (3).zip.zip, and cannot find ../archive (3).zip.ZIP, period.

          Jesse Glick added a comment -

          @yorammi I already verified the fix in 1.536 so if you are seeing corrupt ZIP files it is probably some other bug, that may happen only under certain circumstances, etc. Please file a separate report with steps to reproduce from scratch.

          Jesse Glick added a comment - @yorammi I already verified the fix in 1.536 so if you are seeing corrupt ZIP files it is probably some other bug, that may happen only under certain circumstances, etc. Please file a separate report with steps to reproduce from scratch.

          Mishael Kim added a comment -

          Does anyone know if this corrupt zip issue would apply to general zip files that are archived and then downloaded without using the "download build artifacts as zip" built into Jenkins?

          Mishael Kim added a comment - Does anyone know if this corrupt zip issue would apply to general zip files that are archived and then downloaded without using the "download build artifacts as zip" built into Jenkins?

          Jesse Glick added a comment -

          @mishael no, that situation would not trigger this problem.

          Jesse Glick added a comment - @mishael no, that situation would not trigger this problem.

          @tszadel: Why this is labeled lts-candidate? All associated commit was backported to 1.532.1.

          Oliver Gondža added a comment - @tszadel: Why this is labeled lts-candidate ? All associated commit was backported to 1.532.1.

          Code changed in jenkins
          User: ninian
          Path:
          pom.xml
          http://jenkins-ci.org/commit/compress-artifacts-plugin/04211d3c97832bb22ebc31958f360a107519d103
          Log:
          Updated parent to v1.536 to get fix for download of zipped artifacts,
          JENKINS-19752

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: ninian Path: pom.xml http://jenkins-ci.org/commit/compress-artifacts-plugin/04211d3c97832bb22ebc31958f360a107519d103 Log: Updated parent to v1.536 to get fix for download of zipped artifacts, JENKINS-19752

          Andreas Kotes added a comment - - edited

          btw: I also noticed that extended attributes (like an executable bit) are not preserved in those archives (created JENKINS-27937)

          Andreas Kotes added a comment - - edited btw: I also noticed that extended attributes (like an executable bit) are not preserved in those archives (created JENKINS-27937 )

          Hi, we've noticed the same problem in Jenkins ver. 1.651.1

          Radka Nepejchalova added a comment - Hi, we've noticed the same problem in Jenkins ver. 1.651.1

          Luca Moscato added a comment -

          Hi all, sadly I'm facing the same issue, here is my environment
          jenkins 2.7.4
          jdk 1.8.40 (too old?)
          centos 6.8 (package updated every night).
          It happens that artifacts download (both .zip and other formats) fails often when, in office, the network appears slow. For fail I intend that from browser the download process seems ends correctly ok, but the file downloaded has smaller size and, in case of .zip, can't be opened.

          Luca Moscato added a comment - Hi all, sadly I'm facing the same issue, here is my environment jenkins 2.7.4 jdk 1.8.40 (too old?) centos 6.8 (package updated every night). It happens that artifacts download (both .zip and other formats) fails often when, in office, the network appears slow. For fail I intend that from browser the download process seems ends correctly ok, but the file downloaded has smaller size and, in case of .zip, can't be opened.

          Paula Paez added a comment - - edited

          lucamoscato I think I have a similar problem. My environment is a jenkins 1.651.3 in a centos 7.2.

          When I connect with a slow connection (for example, from the office, or outside with NSA VPN), and download an artifact for example file.exe is never completed correctly.
          note: Usually speed goes from 20 to 200kb.
          To complicate the issue - the downloader (browser, download manager) checks the full size at the beginning (~200MB) but when download is cut at the middle, the downloader thinks it's actually completed successfully (hence no possibility to retry with resume)

          Could you finally solve your issue?? Please, I would really appreciate your comments.

          Paula Paez added a comment - - edited lucamoscato I think I have a similar problem. My environment is a jenkins 1.651.3 in a centos 7.2. When I connect with a slow connection (for example, from the office, or outside with NSA VPN), and download an artifact for example file.exe is never completed correctly. note: Usually speed goes from 20 to 200kb. To complicate the issue - the downloader (browser, download manager) checks the full size at the beginning (~200MB) but when download is cut at the middle, the downloader thinks it's actually completed successfully (hence no possibility to retry with resume) Could you finally solve your issue?? Please, I would really appreciate your comments.

            poussma Mathieu POUSSE
            poussma Mathieu POUSSE
            Votes:
            9 Vote for this issue
            Watchers:
            24 Start watching this issue

              Created:
              Updated:
              Resolved: