Building Processing fails on Windows due to "Unexpected end of ZLIB input stream" #2960

Closed
joelmoniz opened this Issue Nov 16, 2014 · 11 comments

Comments

Projects
None yet
2 participants
@joelmoniz
Member

joelmoniz commented Nov 16, 2014

The following is the error message obtained when trying to run ant run (or ant build) on a Windows 8.1 system:

BUILD FAILED
C:\Users\Joel\Documents\Code\p5\processing\build\build.xml:215: The following error occurred while executing this line:
C:\Users\Joel\Documents\Code\p5\processing\build\build.xml:850: Error while expanding C:\Users\Joel\Documents\Code\p5\processing\build\windows\jre.tgz
java.io.EOFException: Unexpected end of ZLIB input stream
        at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:240)
        at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
        at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:116)
        at org.apache.tools.tar.TarBuffer.readBlock(TarBuffer.java:253)
        at org.apache.tools.tar.TarBuffer.readRecord(TarBuffer.java:220)
        at org.apache.tools.tar.TarInputStream.read(TarInputStream.java:593)
        at org.apache.tools.tar.TarInputStream.skip(TarInputStream.java:206)
        at org.apache.tools.tar.TarInputStream.getNextEntry(TarInputStream.java:271)
        at org.apache.tools.ant.taskdefs.Untar.expandStream(Untar.java:165)
        at org.apache.tools.ant.taskdefs.Untar.expandFile(Untar.java:114)
        at org.apache.tools.ant.taskdefs.Expand.execute(Expand.java:132)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
        at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:435)
        at org.apache.tools.ant.Target.performTasks(Target.java:456)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
        at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441)
        at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)

        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
        at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:435)
        at org.apache.tools.ant.Target.performTasks(Target.java:456)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
        at org.apache.tools.ant.Main.runBuild(Main.java:851)
        at org.apache.tools.ant.Main.startAnt(Main.java:235)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Nov 16, 2014

Member

Your download of jre.tgz was probably interrupted. Delete the file and re-try.

Or it's reaching an error page or something like that, and not grabbing the correct file. If jre.tgz is small, try opening it in a text editor and see what you can find.

Member

benfry commented Nov 16, 2014

Your download of jre.tgz was probably interrupted. Delete the file and re-try.

Or it's reaching an error page or something like that, and not grabbing the correct file. If jre.tgz is small, try opening it in a text editor and see what you can find.

@joelmoniz

This comment has been minimized.

Show comment
Hide comment
@joelmoniz

joelmoniz Nov 17, 2014

Member

Oh my, yes. The download got interrupted, since my internet must have been a little unstable at that time.

I was wondering, although I don't know how many people this issue would affect, if it would be a good idea to add some sort of checksum test to ensure that the whole file has been downloaded without any corruption? Especially since the jre.tgz file is quite large? I'd love to make the appropriate changes to the build file, if this is ok?

Member

joelmoniz commented Nov 17, 2014

Oh my, yes. The download got interrupted, since my internet must have been a little unstable at that time.

I was wondering, although I don't know how many people this issue would affect, if it would be a good idea to add some sort of checksum test to ensure that the whole file has been downloaded without any corruption? Especially since the jre.tgz file is quite large? I'd love to make the appropriate changes to the build file, if this is ok?

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Nov 17, 2014

Member

The ant task does some sort of check, since it knows to re-download when it's different. I'm not sure why it didn't work in your case. Did you try ant run again, or did it just fail on the first go?

Member

benfry commented Nov 17, 2014

The ant task does some sort of check, since it knows to re-download when it's different. I'm not sure why it didn't work in your case. Did you try ant run again, or did it just fail on the first go?

@joelmoniz

This comment has been minimized.

Show comment
Hide comment
@joelmoniz

joelmoniz Nov 17, 2014

Member

What happens is that it skips re-downloading the file inspite of repeated ant runs, giving me the message [get] Not modified - so not downloaded. From what I understand about the documentation on get, the file is assigned the timestamp of the file present on the server, and is re-downlaoded only if the timestamps don't match (which, I guess, would be indicative of a more recent version of the file being available). However, in this case, the timestamps matched, since the corrupt file on my system was a corrupt (or rather, partially downloaded) version of the correct file (i.e., the file on the server).

Member

joelmoniz commented Nov 17, 2014

What happens is that it skips re-downloading the file inspite of repeated ant runs, giving me the message [get] Not modified - so not downloaded. From what I understand about the documentation on get, the file is assigned the timestamp of the file present on the server, and is re-downlaoded only if the timestamps don't match (which, I guess, would be indicative of a more recent version of the file being available). However, in this case, the timestamps matched, since the corrupt file on my system was a corrupt (or rather, partially downloaded) version of the correct file (i.e., the file on the server).

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Nov 17, 2014

Member

Huh, that's bad design by the ant folks... If the timestamp is to be used for the check, it should only assign the stamp after a successful download. Or maybe the connection cut out and so it appeared to be successful.

Open to ideas on a simple way to deal with this... We use ant's so that we don't have to require curl or wget to be installed.

Actually, the solution to this is probably for me to finish the code in build/jre, which is my own ant task that's a downloader that pulls JREs and JDKs directly from Oracle.

Member

benfry commented Nov 17, 2014

Huh, that's bad design by the ant folks... If the timestamp is to be used for the check, it should only assign the stamp after a successful download. Or maybe the connection cut out and so it appeared to be successful.

Open to ideas on a simple way to deal with this... We use ant's so that we don't have to require curl or wget to be installed.

Actually, the solution to this is probably for me to finish the code in build/jre, which is my own ant task that's a downloader that pulls JREs and JDKs directly from Oracle.

@joelmoniz

This comment has been minimized.

Show comment
Hide comment
@joelmoniz

joelmoniz Nov 17, 2014

Member

How about using an SHA1 checksum? There's a macro provided at the bottom of the page to do this.

Member

joelmoniz commented Nov 17, 2014

How about using an SHA1 checksum? There's a macro provided at the bottom of the page to do this.

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Nov 17, 2014

Member

My point was that we shouldn't even be pulling from our site anyway, so better to just finish the direct downloader, and handle size/checksum mismatches there.

Member

benfry commented Nov 17, 2014

My point was that we shouldn't even be pulling from our site anyway, so better to just finish the direct downloader, and handle size/checksum mismatches there.

@joelmoniz

This comment has been minimized.

Show comment
Hide comment
@joelmoniz

joelmoniz Nov 17, 2014

Member

Ah... Yes.

Member

joelmoniz commented Nov 17, 2014

Ah... Yes.

@joelmoniz joelmoniz closed this Dec 18, 2014

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Jan 21, 2015

Member

Finished the Ant task for 3.0a6.

Member

benfry commented Jan 21, 2015

Finished the Ant task for 3.0a6.

@joelmoniz

This comment has been minimized.

Show comment
Hide comment
@joelmoniz

joelmoniz Jan 25, 2015

Member

Thanks!

Member

joelmoniz commented Jan 25, 2015

Thanks!

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Jan 30, 2015

Member

And just added code to have it write a temporary file in case errors happen along the way. eab82bb

Member

benfry commented Jan 30, 2015

And just added code to have it write a temporary file in case errors happen along the way. eab82bb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment