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

failed to archive slave artifacts. Unexpected end of ZLIB input stream

      Since updating to 1.529 the slave archive artifacts is failing with this stack trace.

      ERROR: Failed to archive artifacts: .xml,.log,product//.log,product//.xml,product///.log,product///.xml
      hudson.util.IOException2: hudson.util.IOException2: Failed to extract /var/lib/jenkins/workspace/MainlineDevtest/.xml,.log,product//.log,product//.xml,product///.log,product///.xml
      at hudson.FilePath.readFromTar(FilePath.java:2044)
      at hudson.FilePath.copyRecursiveTo(FilePath.java:1956)
      at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:137)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
      at hudson.model.Build$BuildExecution.post2(Build.java:183)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
      at hudson.model.Run.execute(Run.java:1628)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:247)
      Caused by: java.io.EOFException: Unexpected end of ZLIB input stream
      at com.jcraft.jzlib.InflaterInputStream.fill(InflaterInputStream.java:186)
      at com.jcraft.jzlib.InflaterInputStream.read(InflaterInputStream.java:106)
      at org.apache.tools.tar.TarBuffer.readBlock(TarBuffer.java:257)
      at org.apache.tools.tar.TarBuffer.readRecord(TarBuffer.java:223)
      at hudson.org.apache.tools.tar.TarInputStream.read(TarInputStream.java:345)
      at java.io.FilterInputStream.read(FilterInputStream.java:107)
      at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1025)
      at org.apache.commons.io.IOUtils.copy(IOUtils.java:999)
      at hudson.util.IOUtils.copy(IOUtils.java:37)
      at hudson.FilePath.readFromTar(FilePath.java:2034)
      ... 11 more

      at hudson.FilePath.copyRecursiveTo(FilePath.java:1963)
      at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:137)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
      at hudson.model.Build$BuildExecution.post2(Build.java:183)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
      at hudson.model.Run.execute(Run.java:1628)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:247)
      Caused by: java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException
      at hudson.remoting.Channel$3.adapt(Channel.java:747)
      at hudson.remoting.Channel$3.adapt(Channel.java:742)
      at hudson.remoting.FutureAdapter.get(FutureAdapter.java:59)
      at hudson.FilePath.copyRecursiveTo(FilePath.java:1959)
      ... 10 more
      Caused by: java.lang.ArrayIndexOutOfBoundsException

          [JENKINS-19473] failed to archive slave artifacts. Unexpected end of ZLIB input stream

          Duane Bronson added a comment -

          This appears to be introduced in 1.520. 1.519 archives the exact same files successfully.

          I believe this is related to the CPU performance fix in #JENKINS-14362 (https://issues.jenkins-ci.org/browse/JENKINS-14362)

          Duane Bronson added a comment - This appears to be introduced in 1.520. 1.519 archives the exact same files successfully. I believe this is related to the CPU performance fix in # JENKINS-14362 ( https://issues.jenkins-ci.org/browse/JENKINS-14362 )

          Jesse Glick added a comment -

          Could be a bug in jzlib. If you figure out how to reproduce it from scratch, it should be amenable to diagnosis.

          Jesse Glick added a comment - Could be a bug in jzlib. If you figure out how to reproduce it from scratch, it should be amenable to diagnosis.

          Jesse Glick added a comment -

          I received a reproducible test case. Root exception:

          java.lang.ArrayIndexOutOfBoundsException: 65536
          	at com.jcraft.jzlib.Deflate._tr_tally(Deflate.java:635)
          	at com.jcraft.jzlib.Deflate.deflate_slow(Deflate.java:1177)
          	at com.jcraft.jzlib.Deflate.deflate(Deflate.java:1586)
          	at com.jcraft.jzlib.Deflater.deflate(Deflater.java:140)
          	at com.jcraft.jzlib.DeflaterOutputStream.deflate(DeflaterOutputStream.java:129)
          	at com.jcraft.jzlib.DeflaterOutputStream.write(DeflaterOutputStream.java:102)
          	at java.io.BufferedOutputStream.write(BufferedOutputStream.java:122)
          	at org.apache.tools.tar.TarBuffer.writeBlock(TarBuffer.java:410)
          	at org.apache.tools.tar.TarBuffer.writeRecord(TarBuffer.java:351)
          	at hudson.org.apache.tools.tar.TarOutputStream.writeEOFRecord(TarOutputStream.java:356)
          	at hudson.org.apache.tools.tar.TarOutputStream.finish(TarOutputStream.java:137)
          	at hudson.org.apache.tools.tar.TarOutputStream.close(TarOutputStream.java:149)
          	at hudson.util.io.TarArchiver.close(TarArchiver.java:126)
          	at hudson.FilePath.writeToTar(FilePath.java:2016)
          	at …
          

          Jesse Glick added a comment - I received a reproducible test case. Root exception: java.lang.ArrayIndexOutOfBoundsException: 65536 at com.jcraft.jzlib.Deflate._tr_tally(Deflate.java:635) at com.jcraft.jzlib.Deflate.deflate_slow(Deflate.java:1177) at com.jcraft.jzlib.Deflate.deflate(Deflate.java:1586) at com.jcraft.jzlib.Deflater.deflate(Deflater.java:140) at com.jcraft.jzlib.DeflaterOutputStream.deflate(DeflaterOutputStream.java:129) at com.jcraft.jzlib.DeflaterOutputStream.write(DeflaterOutputStream.java:102) at java.io.BufferedOutputStream.write(BufferedOutputStream.java:122) at org.apache.tools.tar.TarBuffer.writeBlock(TarBuffer.java:410) at org.apache.tools.tar.TarBuffer.writeRecord(TarBuffer.java:351) at hudson.org.apache.tools.tar.TarOutputStream.writeEOFRecord(TarOutputStream.java:356) at hudson.org.apache.tools.tar.TarOutputStream.finish(TarOutputStream.java:137) at hudson.org.apache.tools.tar.TarOutputStream.close(TarOutputStream.java:149) at hudson.util.io.TarArchiver.close(TarArchiver.java:126) at hudson.FilePath.writeToTar(FilePath.java:2016) at …

          Jesse Glick added a comment -

          Filed upstream issue.

          Jesse Glick added a comment - Filed upstream issue.

          Jesse Glick added a comment -

          Demo program. To run:

          java -jar jzlib-9-demo-1.0-SNAPSHOT-jar-with-dependencies.jar /path/to/file
          

          Jesse Glick added a comment - Demo program. To run: java -jar jzlib-9-demo-1.0-SNAPSHOT-jar-with-dependencies.jar /path/to/file

          Jesse Glick added a comment -

          Attaching a compressed copy of Duane’s file. To demonstrate problem, this must first be decompressed (gunzip).

          Jesse Glick added a comment - Attaching a compressed copy of Duane’s file. To demonstrate problem, this must first be decompressed ( gunzip ).

          Code changed in jenkins
          User: Jesse Glick
          Path:
          changelog.html
          core/src/main/java/hudson/FilePath.java
          http://jenkins-ci.org/commit/jenkins/b02d45737e4eb7a0455ebe192271cf76bbf271e0
          Log:
          [FIXED JENKINS-19473] Trying to work around jzlib bug.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/hudson/FilePath.java http://jenkins-ci.org/commit/jenkins/b02d45737e4eb7a0455ebe192271cf76bbf271e0 Log: [FIXED JENKINS-19473] Trying to work around jzlib bug.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2869
          [FIXED JENKINS-19473] Trying to work around jzlib bug. (Revision b02d45737e4eb7a0455ebe192271cf76bbf271e0)

          Result = SUCCESS
          Jesse Glick : b02d45737e4eb7a0455ebe192271cf76bbf271e0
          Files :

          • changelog.html
          • core/src/main/java/hudson/FilePath.java

          dogfood added a comment - Integrated in jenkins_main_trunk #2869 [FIXED JENKINS-19473] Trying to work around jzlib bug. (Revision b02d45737e4eb7a0455ebe192271cf76bbf271e0) Result = SUCCESS Jesse Glick : b02d45737e4eb7a0455ebe192271cf76bbf271e0 Files : changelog.html core/src/main/java/hudson/FilePath.java

          Because of this bug we lost a lot of time during investigating, installing, rollbacking, fixing, etc...

          In which release is this going to be rolled out?

          Uldis Karlovs-Karlovskis added a comment - Because of this bug we lost a lot of time during investigating, installing, rollbacking, fixing, etc... In which release is this going to be rolled out?

          Jesse Glick added a comment -

          @nrc the attempted workaround is in 1.532, now in RC. The jzlib author has proposed a real fix which still needs to be tested.

          Jesse Glick added a comment - @nrc the attempted workaround is in 1.532, now in RC. The jzlib author has proposed a real fix which still needs to be tested.

          Mathieu POUSSE added a comment - - edited

          I don't know if it is related to this workaround, but since I have upgraded to 1.532, the zip containing all the artifacts http://xxx/job/dictionary/lastSuccessfulBuild/artifact/*zip*/archive.zip can not be unzipped because of invalid content... on all my projects... could you check if it works on your versions ? you can comment here JENKINS-19752

          Mathieu POUSSE added a comment - - edited I don't know if it is related to this workaround, but since I have upgraded to 1.532, the zip containing all the artifacts http://xxx/job/dictionary/lastSuccessfulBuild/artifact/*zip*/archive.zip can not be unzipped because of invalid content... on all my projects... could you check if it works on your versions ? you can comment here JENKINS-19752

          trinition added a comment -

          Recently went from 1.502 to 1.532 and artifact ZIPs can no longer be opened by Windows ZIP (but 7-Zip works); also, many files are 0-bytes in the zip (though the originally archived artifact is fine).

          trinition added a comment - Recently went from 1.502 to 1.532 and artifact ZIPs can no longer be opened by Windows ZIP (but 7-Zip works); also, many files are 0-bytes in the zip (though the originally archived artifact is fine).

          Mathieu POUSSE added a comment - - edited

          my mistake. The JENKINS-19473 issue is not related to this bug.
          I fixed it and waiting for the pull request to be accepted. See JENKINS-19752

          Mathieu POUSSE added a comment - - edited my mistake. The JENKINS-19473 issue is not related to this bug. I fixed it and waiting for the pull request to be accepted. See JENKINS-19752

          Paul Croome added a comment -

          Since updating to v1.532, ZIP files generated by "[download] all files in zip" are invalid. Unzipping the file creates a directory tree, but all files have size=0.

          Here is output from Info-ZIP v5.52:

          Archive: archive.zip
          warning [archive.zip]: 2713792 extra bytes at beginning or within zipfile
          (attempting to process anyway)
          file #1: bad zipfile offset (local header sig): 2713792
          (attempting to re-compensate)
          inflating: *******
          error: zipfile probably corrupt (segmentation violation)

          Paul Croome added a comment - Since updating to v1.532, ZIP files generated by " [download] all files in zip" are invalid. Unzipping the file creates a directory tree, but all files have size=0. Here is output from Info-ZIP v5.52: Archive: archive.zip warning [archive.zip] : 2713792 extra bytes at beginning or within zipfile (attempting to process anyway) file #1: bad zipfile offset (local header sig): 2713792 (attempting to re-compensate) inflating: ******* error: zipfile probably corrupt (segmentation violation)

          Mathieu POUSSE added a comment - - edited

          This has nothing to do with this issue but is related to JENKINS-19752 that has been fixed and will be delivered soon. I think you can recolse this issue

          Mathieu POUSSE added a comment - - edited This has nothing to do with this issue but is related to JENKINS-19752 that has been fixed and will be delivered soon. I think you can recolse this issue

          Paul Croome added a comment -

          Thanks for your fast response, Mathieu! I'll wait for the fix to JENKINS-19752 (and revert to v1.531 in the meantime).

          Paul Croome added a comment - Thanks for your fast response, Mathieu! I'll wait for the fix to JENKINS-19752 (and revert to v1.531 in the meantime).

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/java/hudson/FilePath.java
          http://jenkins-ci.org/commit/jenkins/2f77f959c639474d80e4e3c979c8eacc4855e38d
          Log:
          [FIXED JENKINS-19473] Trying to work around jzlib bug.
          (cherry picked from commit b02d45737e4eb7a0455ebe192271cf76bbf271e0)

          Conflicts:
          changelog.html

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/hudson/FilePath.java http://jenkins-ci.org/commit/jenkins/2f77f959c639474d80e4e3c979c8eacc4855e38d Log: [FIXED JENKINS-19473] Trying to work around jzlib bug. (cherry picked from commit b02d45737e4eb7a0455ebe192271cf76bbf271e0) Conflicts: changelog.html

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/pom.xml
          core/src/main/java/hudson/FilePath.java
          http://jenkins-ci.org/commit/jenkins/8deb42bf89b0ced99a1ef5a9721986b35deda244
          Log:
          JENKINS-19473 Removing workaround since root bug should be fixed in jzlib 1.1.3.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/pom.xml core/src/main/java/hudson/FilePath.java http://jenkins-ci.org/commit/jenkins/8deb42bf89b0ced99a1ef5a9721986b35deda244 Log: JENKINS-19473 Removing workaround since root bug should be fixed in jzlib 1.1.3.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2921
          JENKINS-19473 Removing workaround since root bug should be fixed in jzlib 1.1.3. (Revision 8deb42bf89b0ced99a1ef5a9721986b35deda244)

          Result = SUCCESS
          Jesse Glick : 8deb42bf89b0ced99a1ef5a9721986b35deda244
          Files :

          • core/pom.xml
          • core/src/main/java/hudson/FilePath.java

          dogfood added a comment - Integrated in jenkins_main_trunk #2921 JENKINS-19473 Removing workaround since root bug should be fixed in jzlib 1.1.3. (Revision 8deb42bf89b0ced99a1ef5a9721986b35deda244) Result = SUCCESS Jesse Glick : 8deb42bf89b0ced99a1ef5a9721986b35deda244 Files : core/pom.xml core/src/main/java/hudson/FilePath.java

          Jesse Glick added a comment -

          8deb42bf89b0ced99a1ef5a9721986b35deda244 should be backported to the 1.532.x line.

          Jesse Glick added a comment - 8deb42bf89b0ced99a1ef5a9721986b35deda244 should be backported to the 1.532.x line.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/pom.xml
          core/src/main/java/hudson/FilePath.java
          http://jenkins-ci.org/commit/jenkins/774c54a652a063e06274b13c511997758ca6f762
          Log:
          JENKINS-19473 Removing workaround since root bug should be fixed in jzlib 1.1.3.
          (cherry picked from commit 8deb42bf89b0ced99a1ef5a9721986b35deda244)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/pom.xml core/src/main/java/hudson/FilePath.java http://jenkins-ci.org/commit/jenkins/774c54a652a063e06274b13c511997758ca6f762 Log: JENKINS-19473 Removing workaround since root bug should be fixed in jzlib 1.1.3. (cherry picked from commit 8deb42bf89b0ced99a1ef5a9721986b35deda244)

          Sam Halliday added a comment -

          We're still seeing this on Jenkins 1.544

          Archiving artifacts
          ERROR: Failed to archive artifacts: <<<REMOVED>>>
          java.io.IOException: Failed to extract <<<REMOVED>>> /transfer of 353 files
          	at hudson.FilePath.readFromTar(FilePath.java:2088)
          	at hudson.FilePath.copyRecursiveTo(FilePath.java:2000)
          	at jenkins.model.StandardArtifactManager.archive(StandardArtifactManager.java:57)
          	at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:140)
          	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
          	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785)
          	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:757)
          	at hudson.model.Build$BuildExecution.post2(Build.java:183)
          	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:706)
          	at hudson.model.Run.execute(Run.java:1703)
          	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
          	at hudson.model.ResourceController.execute(ResourceController.java:88)
          	at hudson.model.Executor.run(Executor.java:231)
          Caused by: java.io.EOFException: Unexpected end of ZLIB input stream
          	at com.jcraft.jzlib.InflaterInputStream.fill(InflaterInputStream.java:186)
          	at com.jcraft.jzlib.InflaterInputStream.read(InflaterInputStream.java:106)
          	at org.apache.tools.tar.TarBuffer.readBlock(TarBuffer.java:257)
          	at org.apache.tools.tar.TarBuffer.readRecord(TarBuffer.java:223)
          	at hudson.org.apache.tools.tar.TarInputStream.read(TarInputStream.java:345)
          	at java.io.FilterInputStream.read(FilterInputStream.java:107)
          	at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1025)
          	at org.apache.commons.io.IOUtils.copy(IOUtils.java:999)
          	at hudson.util.IOUtils.copy(IOUtils.java:37)
          	at hudson.FilePath.readFromTar(FilePath.java:2078)
          	... 12 more
          Build step 'Archive the artifacts' changed build result to FAILURE
          Finished: FAILURE
          
          

          Sam Halliday added a comment - We're still seeing this on Jenkins 1.544 Archiving artifacts ERROR: Failed to archive artifacts: <<<REMOVED>>> java.io.IOException: Failed to extract <<<REMOVED>>> /transfer of 353 files at hudson.FilePath.readFromTar(FilePath.java:2088) at hudson.FilePath.copyRecursiveTo(FilePath.java:2000) at jenkins.model.StandardArtifactManager.archive(StandardArtifactManager.java:57) at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:140) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:757) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:706) at hudson.model.Run.execute(Run.java:1703) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:231) Caused by: java.io.EOFException: Unexpected end of ZLIB input stream at com.jcraft.jzlib.InflaterInputStream.fill(InflaterInputStream.java:186) at com.jcraft.jzlib.InflaterInputStream.read(InflaterInputStream.java:106) at org.apache.tools.tar.TarBuffer.readBlock(TarBuffer.java:257) at org.apache.tools.tar.TarBuffer.readRecord(TarBuffer.java:223) at hudson.org.apache.tools.tar.TarInputStream.read(TarInputStream.java:345) at java.io.FilterInputStream.read(FilterInputStream.java:107) at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1025) at org.apache.commons.io.IOUtils.copy(IOUtils.java:999) at hudson.util.IOUtils.copy(IOUtils.java:37) at hudson.FilePath.readFromTar(FilePath.java:2078) ... 12 more Build step 'Archive the artifacts' changed build result to FAILURE Finished: FAILURE

          Jesse Glick added a comment -

          @fommil might be some other bug in jzlib; best to have a self-contained test case for this kind of thing.

          Jesse Glick added a comment - @fommil might be some other bug in jzlib; best to have a self-contained test case for this kind of thing.

          Steve Roth added a comment -

          @fommil – I am seeing the same thing, and have created bug JENKINS-21905 for that issue.

          Steve Roth added a comment - @fommil – I am seeing the same thing, and have created bug JENKINS-21905 for that issue.

            jglick Jesse Glick
            flyingchipmunk Matthew Veno
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: