[JIRA] (JENKINS-47566) Unexpected end of ZLIB input stream on permission errors

58 views
Skip to first unread message

ifernandezcalvo@cloudbees.com (JIRA)

unread,
May 1, 2018, 8:38:02 AM5/1/18
to jenkinsc...@googlegroups.com
Ivan Fernandez Calvo updated an issue
 
Jenkins / Bug JENKINS-47566
Unexpected end of ZLIB input stream on permission errors
Change By: Ivan Fernandez Calvo
Component/s: ssh-slaves-plugin
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

ifernandezcalvo@cloudbees.com (JIRA)

unread,
May 1, 2018, 8:55:02 AM5/1/18
to jenkinsc...@googlegroups.com
Ivan Fernandez Calvo closed an issue as Not A Defect
Status: Open Closed
Resolution: Not A Defect

ifernandezcalvo@cloudbees.com (JIRA)

unread,
May 1, 2018, 8:55:03 AM5/1/18
to jenkinsc...@googlegroups.com
Ivan Fernandez Calvo commented on Bug JENKINS-47566
 
Re: Unexpected end of ZLIB input stream on permission errors

This is your script

echo foo > bar.txt
sudo chown root bar.txt
sudo chmod 600 bar.txt

If the user that runs the agent is nor root does not have access to the bar.txt file, only root can read this file, so if you use a no root user to try to archive the artifacts you see this error.

ERROR: Failed to archive artifacts: bar.txt
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.commons.compress.utils.IOUtils.readFully(IOUtils.java:160)
	at org.apache.commons.compress.utils.IOUtils.readFully(IOUtils.java:134)
	at org.apache.commons.compress.archivers.tar.TarArchiveInputStream.readRecord(TarArchiveInputStream.java:419)
	at org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getRecord(TarArchiveInputStream.java:388)
	at org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:269)
	at hudson.FilePath.readFromTar(FilePath.java:2351)
Also:   	Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to local
			at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1737)
			at hudson.remoting.UserResponse.retrieve(UserRequest.java:313)
			at hudson.remoting.Channel$2.adapt(Channel.java:986)
			at hudson.remoting.Channel$2.adapt(Channel.java:983)
			at hudson.remoting.FutureAdapter.get(FutureAdapter.java:59)
			at hudson.FilePath.copyRecursiveTo(FilePath.java:2280)
			at jenkins.model.StandardArtifactManager.archive(StandardArtifactManager.java:61)
			at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:245)
			at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
			at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
			at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
			at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
			at hudson.model.Build$BuildExecution.post2(Build.java:186)
			at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
			at hudson.model.Run.execute(Run.java:1752)
			at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
			at hudson.model.ResourceController.execute(ResourceController.java:97)
			at hudson.model.Executor.run(Executor.java:429)
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.writeToTar(FilePath.java:2337)
		at hudson.FilePath.access$2300(FilePath.java:208)
		at hudson.FilePath$45.invoke(FilePath.java:2272)
		at hudson.FilePath$45.invoke(FilePath.java:2268)
		at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2816)
		at hudson.remoting.UserRequest.perform(UserRequest.java:210)
		at hudson.remoting.UserRequest.perform(UserRequest.java:53)
		at hudson.remoting.Request$2.run(Request.java:364)
		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)
	Caused: java.util.concurrent.ExecutionException
		at hudson.remoting.Channel$2.adapt(Channel.java:988)
		at hudson.remoting.Channel$2.adapt(Channel.java:983)
		at hudson.remoting.FutureAdapter.get(FutureAdapter.java:59)
		at hudson.FilePath.copyRecursiveTo(FilePath.java:2280)
Caused: java.io.IOException: Failed to extract /tmp/workspace/test/transfer of 1 files
	at hudson.FilePath.readFromTar(FilePath.java:2373)
	at hudson.FilePath.copyRecursiveTo(FilePath.java:2277)
	at jenkins.model.StandardArtifactManager.archive(StandardArtifactManager.java:61)
	at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:245)
	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
	at hudson.model.Build$BuildExecution.post2(Build.java:186)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
	at hudson.model.Run.execute(Run.java:1752)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)
Build step 'Archive the artifacts' changed build result to FAILURE

The solution it is to give the right permission to the files in order to allow the agent process to archive the file, if you need a set of specific permissions on files, you should package the files before archiving, theb you can archive the result zip file.

mattiasa@cantemo.com (JIRA)

unread,
May 1, 2018, 10:28:02 AM5/1/18
to jenkinsc...@googlegroups.com

Yes, fixing the permissions was the workaround I mentioned in the the initial ticket description. This ticket was about the error message which imho should be something better than


Unexpected end of ZLIB input stream

If the error message had mentioned permission denied anywhere, I would not have wasted several hours trying to find out what was wrong with the build slave.

I do not think this is Not A Defect as the error message is highly misleading.

smart_nature@hotmail.com (JIRA)

unread,
Oct 29, 2018, 8:17:02 AM10/29/18
to jenkinsc...@googlegroups.com
Simon Martineau reopened an issue
 

The problem that should be resolved, as described by the person who initially opened this ticket is the highly misleading error message.

This has to be fixed. I wasted a lot of time, exactly as the person who initially open this ticket.

Change By: Simon Martineau
Resolution: Not A Defect
Status: Closed Reopened
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)
Reply all
Reply to author
Forward
0 new messages