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

Stashing fails with "java.io.IOException: This archive contains unclosed entries"

XMLWordPrintable

      After updating to LTS 2.401.1, I'm seeing inconsistent but frequent failures to stash files. It looks as though files are being deleted while the tar archive is being created. We use https://plugins.jenkins.io/artifact-manager-s3/ but it's failing during the tar creation, so I'm not sure if the issue has anything to do with the plugin. Nothing has changed recently in our pipeline, and the stash is the last step in the stage (there is nothing that cleans up or deletes files intentionally). It's also a different file every time. If I try excluding tmp/cache from the stash, it fails on archiving regular (non-generated) files from our codebase

      [2023-06-07T17:58:59.928Z] Also:   java.io.IOException: This archive contains unclosed entries.
      [2023-06-07T17:58:59.928Z] 		at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.finish(TarArchiveOutputStream.java:448)
      [2023-06-07T17:58:59.928Z] 		at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.close(TarArchiveOutputStream.java:318)
      [2023-06-07T17:58:59.928Z] 		at hudson.util.io.TarArchiver.close(TarArchiver.java:127)
      [2023-06-07T17:58:59.928Z] 		at hudson.FilePath$Archive.invoke(FilePath.java:541)
      [2023-06-07T17:58:59.928Z] Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to EC2 (Tools) - ec2-speckel-demand (i-09d1c547b6a4a47aa)
      [2023-06-07T17:58:59.928Z] 		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1784)
      [2023-06-07T17:58:59.928Z] 		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
      [2023-06-07T17:58:59.928Z] 		at hudson.remoting.Channel.call(Channel.java:1000)
      [2023-06-07T17:58:59.928Z] 		at hudson.FilePath.act(FilePath.java:1192)
      [2023-06-07T17:58:59.928Z] 		at hudson.FilePath.act(FilePath.java:1181)
      [2023-06-07T17:58:59.928Z] 		at io.jenkins.plugins.artifact_manager_jclouds.JCloudsArtifactManager.stash(JCloudsArtifactManager.java:236)
      [2023-06-07T17:58:59.928Z] 		at org.jenkinsci.plugins.workflow.flow.StashManager.stash(StashManager.java:118)
      [2023-06-07T17:58:59.928Z] 		at org.jenkinsci.plugins.workflow.support.steps.stash.StashStep$Execution.run(StashStep.java:119)
      [2023-06-07T17:58:59.928Z] 		at org.jenkinsci.plugins.workflow.support.steps.stash.StashStep$Execution.run(StashStep.java:107)
      [2023-06-07T17:58:59.928Z] 		at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
      [2023-06-07T17:58:59.928Z] 		at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      [2023-06-07T17:58:59.928Z] 		at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      [2023-06-07T17:58:59.928Z] 		at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      [2023-06-07T17:58:59.928Z] 		at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      [2023-06-07T17:58:59.928Z] 		at java.base/java.lang.Thread.run(Thread.java:829)
      [2023-06-07T17:58:59.928Z] Also:   org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: aa670949-e7b3-4c90-9bdf-a6d4cbc3c2cd
      [2023-06-07T17:58:59.928Z] java.io.IOException: Entry 'tmp/cache/bootsnap/compile-cache-iseq/85/31854d67792532' closed at '8192' before the '17020' bytes specified in the header were written
      [2023-06-07T17:58:59.928Z] 	at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.closeArchiveEntry(TarArchiveOutputStream.java:346)
      [2023-06-07T17:58:59.928Z] 	at hudson.util.io.TarArchiver.visit(TarArchiver.java:120)
      [2023-06-07T17:58:59.928Z] 	at hudson.util.DirScanner.scanSingle(DirScanner.java:52)
      [2023-06-07T17:58:59.928Z] 	at hudson.util.DirScanner$Glob.scan(DirScanner.java:147)
      [2023-06-07T17:58:59.928Z] 	at hudson.FilePath$Archive.invoke(FilePath.java:542)
      [2023-06-07T17:58:59.928Z] 	at hudson.FilePath$Archive.invoke(FilePath.java:524)
      [2023-06-07T17:58:59.928Z] 	at hudson.FilePath.act(FilePath.java:1198)
      [2023-06-07T17:58:59.928Z] 	at hudson.FilePath.act(FilePath.java:1181)
      [2023-06-07T17:58:59.928Z] 	at hudson.FilePath.archive(FilePath.java:521)
      [2023-06-07T17:58:59.928Z] 	at hudson.FilePath.archive(FilePath.java:500)
      [2023-06-07T17:58:59.928Z] 	at io.jenkins.plugins.artifact_manager_jclouds.JCloudsArtifactManager$Stash.invoke(JCloudsArtifactManager.java:273)
      [2023-06-07T17:58:59.928Z] 	at io.jenkins.plugins.artifact_manager_jclouds.JCloudsArtifactManager$Stash.invoke(JCloudsArtifactManager.java:239)
      [2023-06-07T17:58:59.928Z] 	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3578)
      [2023-06-07T17:58:59.928Z] 	at hudson.remoting.UserRequest.perform(UserRequest.java:211)
      [2023-06-07T17:58:59.928Z] 	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
      [2023-06-07T17:58:59.928Z] 	at hudson.remoting.Request$2.run(Request.java:376)
      [2023-06-07T17:58:59.928Z] 	at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
      [2023-06-07T17:58:59.928Z] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      [2023-06-07T17:58:59.928Z] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      [2023-06-07T17:58:59.928Z] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      [2023-06-07T17:58:59.928Z] 	at java.base/java.lang.Thread.run(Thread.java:829) 

      Possibly related to this old issue: https://issues.jenkins.io/browse/JENKINS-28013

            Unassigned Unassigned
            codyrank Cody Rank
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: