Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZipExceptions on startup #1375

Closed
zapbot opened this issue Jun 4, 2015 · 7 comments
Closed

ZipExceptions on startup #1375

zapbot opened this issue Jun 4, 2015 · 7 comments

Comments

@zapbot
Copy link
Contributor

zapbot commented Jun 4, 2015

What steps will reproduce the problem?
1.Download, Unzip and start ZAP via zap.sh on Ubuntu 14.04 LTS
2.
3.

What is the expected output? What do you see instead?
ZAP appears to start but the console is full of stack traces.

Multiple stack traces in console that all resemble the following:

7483 [main] ERROR org.zaproxy.zap.control.AddOnLoader  - error in opening zip file
java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:215)
    at java.util.zip.ZipFile.<init>(ZipFile.java:145)
    at java.util.jar.JarFile.<init>(JarFile.java:154)
    at java.util.jar.JarFile.<init>(JarFile.java:118)
    at org.zaproxy.zap.control.AddOnLoader.getJarClassNames(Unknown Source)
    at org.zaproxy.zap.control.AddOnLoader.getClassNames(Unknown Source)
    at org.zaproxy.zap.control.AddOnLoader.getImplementors(Unknown Source)
    at org.zaproxy.zap.control.AddOnLoader.getImplementors(Unknown Source)
    at org.zaproxy.zap.extension.sessions.ExtensionSessionManagement.loadSesssionManagementMethodTypes(Unknown
Source)
    at org.zaproxy.zap.extension.sessions.ExtensionSessionManagement.hook(Unknown Source)
    at org.parosproxy.paros.extension.ExtensionLoader.hookAllExtension(Unknown Source)
    at org.parosproxy.paros.extension.ExtensionLoader.startLifeCycle(Unknown Source)
    at org.parosproxy.paros.control.AbstractControl.loadExtension(Unknown Source)
    at org.parosproxy.paros.control.Control.init(Unknown Source)
    at org.parosproxy.paros.control.Control.initSingletonWithView(Unknown Source)
    at org.zaproxy.zap.ZAP.runGUI(Unknown Source)
    at org.zaproxy.zap.ZAP.run(Unknown Source)
    at org.zaproxy.zap.ZAP.main(Unknown Source)


What version of the product are you using? On what operating system?

ZAP 2.3.1 on Ubuntu 14.04 LTS

Please provide any additional information below.

Original issue reported on code.google.com by Jason.Gillam on 2014-10-22 16:07:19

@zapbot
Copy link
Contributor Author

zapbot commented Jun 4, 2015

Strange.
No other info in the stack traces?
What version of Java are you using?

Original issue reported on code.google.com by psiinon on 2014-10-22 16:35:07

@zapbot
Copy link
Contributor Author

zapbot commented Jun 4, 2015

Not really.  There is one earlier stack trace that's similar but starts on org.zaproxy.zap.control.AddOn
instead of AddOnLoader.  This one also failed on the same place with ZipFile.open.

Also, I just tried running with sudo and I don't get the stack traces so I strongly
suspect a file permission issue.  Is this stack trace probably coming from reading
zip files in the "plugin" folder or could it be somewhere else?  


java -version
java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.2) (7u65-2.5.2-3~14.04)
OpenJDK Client VM (build 24.65-b04, mixed mode, sharing)

Original issue reported on code.google.com by Jason.Gillam on 2014-10-22 21:32:31

@zapbot
Copy link
Contributor Author

zapbot commented Jun 4, 2015

I tried giving the entire ZAP folder all permissions and the problem still occurred,
so it doesn't appear to be any file permission issue within the distribution structure
itself.  

So a little more research on the stack trace (specifically I was looking for "at java.util.zip.ZipFile.<init>(ZipFile.java:215)"
to see what might cause this)....  plus looking into the source a bit.  It seems like
the issue is coming from the native code for opening and handling ZipFile and is likely
related to the handling of the temp space used by the implementation.

So it appears this is a platform specific bug.

The only cross-platform fix I saw described anywhere was to use a ZipInputStream directly
instead of a ZipFile.

Original issue reported on code.google.com by Jason.Gillam on 2014-10-23 13:06:55

@zapbot
Copy link
Contributor Author

zapbot commented Jun 4, 2015

ZAP will try to load add-ons (which are zip files) from 2 locations:
* <ZAP install>/plugin
* <user home>/.ZAP/plugin

Does the ZAP process have read access to both of those?

Are any of the files in those directories with .zap extensions zero length?

Original issue reported on code.google.com by psiinon on 2014-10-23 13:16:43

@zapbot
Copy link
Contributor Author

zapbot commented Jun 4, 2015

Hi,

I'm running into the same issue and unsure how to solve it except for running zap.sh
as root, any solutions?


Regards.

Original issue reported on code.google.com by nils.wiersma on 2015-03-19 12:17:16

@kingthorin
Copy link
Member

@Jason.Gillam @nils.wiersma did you manage to resolve your problems?

If no further info is received by 20160901 this issue will be closed.

@lock
Copy link

lock bot commented Jan 30, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Jan 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants