jenkinsci / jenkinsci/workflow-basic-steps-plugin

[JENKINS-52053] Jenkins stash failed after npm install

Offen
#459 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

component:workflow-basic-steps-plugin imported-jira-issue priority:critical resolution:unresolved
Vorherrschende Sprache
Java
Sterne
73
Forks
129
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

During my build process, I run NPM install among other tools, before stashing the contents of the working directory for later stages. However, we've noticed that when NPM install is used, the stash at the end of this stage throws a Java I/O exception, saying that the archive contains unclosed entries. Disabling the NPM install stops this issue from occurring. The I/O exception is shown below: 

Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to  (sir-r9rg4htg)
		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
		at hudson.remoting.Channel.call(Channel.java:955)
		at hudson.FilePath.act(FilePath.java:1089)
		at hudson.FilePath.act(FilePath.java:1078)
		at hudson.FilePath.archive(FilePath.java:481)
		at org.jenkinsci.plugins.workflow.flow.StashManager.stash(StashManager.java:107)
		at org.jenkinsci.plugins.workflow.support.steps.stash.StashStep$Execution.run(StashStep.java:113)
		at org.jenkinsci.plugins.workflow.support.steps.stash.StashStep$Execution.run(StashStep.java:101)
		at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:49)
		at hudson.security.ACL.impersonate(ACL.java:290)
		at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:46)
		at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
java.io.IOException: This archives contains unclosed entries.
	at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.finish(TarArchiveOutputStream.java:225)
	at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.close(TarArchiveOutputStream.java:241)
	at hudson.util.io.TarArchiver.close(TarArchiver.java:127)
	at hudson.FilePath$Archive.invoke(FilePath.java:498)
	at hudson.FilePath$Archive.invoke(FilePath.java:483)
	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3082)
	at hudson.remoting.UserRequest.perform(UserRequest.java:212)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:369)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Finished: FAILURE

Originally reported by mdevarakonda, imported from: Jenkins stash failed after npm install
  • status: Open
  • priority: Critical
  • component(s): workflow-basic-steps-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 20251215-220547
Raw content of original issue

During my build process, I run NPM install among other tools, before stashing the contents of the working directory for later stages. However, we've noticed that when NPM install is used, the stash at the end of this stage throws a Java I/O exception, saying that the archive contains unclosed entries. Disabling the NPM install stops this issue from occurring. The I/O exception is shown below: 

Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to  (sir-r9rg4htg)
		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
		at hudson.remoting.Channel.call(Channel.java:955)
		at hudson.FilePath.act(FilePath.java:1089)
		at hudson.FilePath.act(FilePath.java:1078)
		at hudson.FilePath.archive(FilePath.java:481)
		at org.jenkinsci.plugins.workflow.flow.StashManager.stash(StashManager.java:107)
		at org.jenkinsci.plugins.workflow.support.steps.stash.StashStep$Execution.run(StashStep.java:113)
		at org.jenkinsci.plugins.workflow.support.steps.stash.StashStep$Execution.run(StashStep.java:101)
		at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:49)
		at hudson.security.ACL.impersonate(ACL.java:290)
		at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:46)
		at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
java.io.IOException: This archives contains unclosed entries.
	at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.finish(TarArchiveOutputStream.java:225)
	at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.close(TarArchiveOutputStream.java:241)
	at hudson.util.io.TarArchiver.close(TarArchiver.java:127)
	at hudson.FilePath$Archive.invoke(FilePath.java:498)
	at hudson.FilePath$Archive.invoke(FilePath.java:483)
	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3082)
	at hudson.remoting.UserRequest.perform(UserRequest.java:212)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:369)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Finished: FAILURE

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, den Stash-Fehler anhand des Stacktraces durch StashManager.stash, StashStep$Execution.run, hudson.FilePath.archive und TarArchiver.close zu verfolgen. Reproduziere eine Pipeline, die vor dem Stashing npm install ausführt, und vergleiche sie mit einem Lauf, bei dem npm install ausgelassen wird. Als erledigt gilt die Aufgabe, wenn der Fall mit npm install ohne die unclosed-entries IOException abgeschlossen wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java, javascript
Bereich
build-system, ci-cd
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.