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

Archiving artifiacts fails with java.io.IOException: Truncated TAR archive

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Component/s: core
    • Labels:
    • Environment:
      Jenkins 1.610 (currently most recent), Ubuntu LTS 14.04 64-bit master, SLES11 64-bit slave
    • Similar Issues:

      Description

      The 'archive artifacts' step of some build jobs have recently started failing with the following trace:

      Archiving artifacts
      ERROR: Failed to archive artifacts: **/*.deb, **/*.changes, **/*.rpm, **/*.egg
      java.io.IOException: Failed to extract /srv/user_name/.jenkins/workspace/SomeProject/distro/sles11_64/servertype/build/transfer of 4 files
      	at hudson.FilePath.readFromTar(FilePath.java:2299)
      	at hudson.FilePath.copyRecursiveTo(FilePath.java:2208)
      	at jenkins.model.StandardArtifactManager.archive(StandardArtifactManager.java:61)
      	at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:219)
      	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:74)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
      	at hudson.model.Build$BuildExecution.post2(Build.java:183)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
      	at hudson.model.Run.execute(Run.java:1766)
      	at hudson.matrix.MatrixRun.run(MatrixRun.java:146)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:374)
      Caused by: java.io.IOException: Truncated TAR archive
      	at org.apache.commons.compress.archivers.tar.TarArchiveInputStream.read(TarArchiveInputStream.java:614)
      	at java.io.InputStream.read(InputStream.java:101)
      	at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1792)
      	at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1769)
      	at org.apache.commons.io.IOUtils.copy(IOUtils.java:1744)
      	at hudson.util.IOUtils.copy(IOUtils.java:40)
      	at hudson.FilePath.readFromTar(FilePath.java:2289)
      	... 13 more
      Build step 'Archive the artifacts' changed build result to FAILURE
      

      It seems that the jobs on the slaves succeeded, but the master fails:

      Apr 20, 2015 11:15:14 AM hudson.model.Run execute
      INFO: SomeProject/distro=sles11_64,servertype=build #12159 main build action completed: SUCCESS
      [... more slave SUCCESS reports ...]
      Apr 20, 2015 11:16:16 AM hudson.model.Run execute
      INFO: SomeProject #12159 main build action completed: FAILURE
      

      The master and slave logs do not show me any other errors.

      This failure occurs just for some of the slave jobs in this matrix build job. Within a specific job, this fails consistently for the same slaves, but across jobs the slaves that fail vary.

      There are no obvious resource issues; both disk space and memory usage seem to be fine.

        Attachments

          Issue Links

            Activity

            Hide
            radle Andrey Regentov added a comment -

            Oleg, positive. SLES 11, java 1.7.0_45-b18 - the problem appears. Not on every job though. But if the job is "cursed" then "Truncated TAR archive" on every its build.

            Show
            radle Andrey Regentov added a comment - Oleg, positive. SLES 11, java 1.7.0_45-b18 - the problem appears. Not on every job though. But if the job is "cursed" then "Truncated TAR archive" on every its build.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            The issue has been caused by a binary stream corruption in Tar archiving procedures.
            https://github.com/jenkinsci/jenkins/pull/1667 has been created to revert the change

            Show
            oleg_nenashev Oleg Nenashev added a comment - The issue has been caused by a binary stream corruption in Tar archiving procedures. https://github.com/jenkinsci/jenkins/pull/1667 has been created to revert the change
            Hide
            mwebber Matthew Webber added a comment -

            I am running Java 8 on both master and slave (both Linux), and get the problem.

            From the comments on https://github.com/jenkinsci/jenkins/pull/1667, it looks the maintainers can now reproduce the problem.

            Show
            mwebber Matthew Webber added a comment - I am running Java 8 on both master and slave (both Linux), and get the problem. From the comments on https://github.com/jenkinsci/jenkins/pull/1667 , it looks the maintainers can now reproduce the problem.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            core/pom.xml
            core/src/main/java/hudson/FilePath.java
            core/src/main/java/hudson/org/apache/tools/tar/TarInputStream.java
            core/src/main/java/hudson/org/apache/tools/tar/TarOutputStream.java
            core/src/main/java/hudson/util/io/TarArchiver.java
            http://jenkins-ci.org/commit/jenkins/ca21c65bf2538982126bd465eb70840071a61e4e
            Log:
            Merge pull request #1667 from oleg-nenashev/JENKINS-10629-FIX

            [JENKINS-28013,JENKINS-28012] - Revert changes for JENKINS-10629

            Compare: https://github.com/jenkinsci/jenkins/compare/8c94920973c4...ca21c65bf253

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/pom.xml core/src/main/java/hudson/FilePath.java core/src/main/java/hudson/org/apache/tools/tar/TarInputStream.java core/src/main/java/hudson/org/apache/tools/tar/TarOutputStream.java core/src/main/java/hudson/util/io/TarArchiver.java http://jenkins-ci.org/commit/jenkins/ca21c65bf2538982126bd465eb70840071a61e4e Log: Merge pull request #1667 from oleg-nenashev/ JENKINS-10629 -FIX [JENKINS-28013,JENKINS-28012] - Revert changes for JENKINS-10629 Compare: https://github.com/jenkinsci/jenkins/compare/8c94920973c4...ca21c65bf253
            Hide
            danielbeck Daniel Beck added a comment -

            Resolved by reverting the fix for JENKINS-10629.

            Show
            danielbeck Daniel Beck added a comment - Resolved by reverting the fix for JENKINS-10629 .

              People

              Assignee:
              oleg_nenashev Oleg Nenashev
              Reporter:
              syzzer Steffan Karger
              Votes:
              34 Vote for this issue
              Watchers:
              51 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: