Java.util.zip.ZipException

Hi All,

I am getting below exception while trying to bring up ES 2.1

Exception in thread "main" 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:220)
	at java.util.zip.ZipFile.<init>(ZipFile.java:150)
	at java.util.jar.JarFile.<init>(JarFile.java:166)
	at java.util.jar.JarFile.<init>(JarFile.java:103)
	at org.elasticsearch.bootstrap.JarHell.checkJarHell(JarHell.java:174)
	at org.elasticsearch.bootstrap.JarHell.checkJarHell(JarHell.java:87)
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:164)
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.

Did anyone face this problem?

Something else in logs?

May be you unzipped as root but run the process as a user? I mean you don't have enough rights.

May be you installed plugins?

Well you have to describe all the steps you did.

Check all jars on the classpath if they have the correct ownership and can be opened by ES process.

Hi David/Jorg,

Below are the steps which I followed.

  1. Downloaded the tar on my mac.
  2. SCP it into my unix box.
  3. Untar (folder is elasticsearch)
  4. chmod -R 755 elasticsearch
  5. chown -R elasticuser:elasticuser elasticsearch
  6. Start elasticsearch as a "elasticuser"

And there are no more logs in the log file other than this.

Thanks,

I can not reproduce.

Do the following steps:

  1. Download elasticsearch-2.1.0.tar.gz
  2. scp it to the Linux box e.g. to a private non-root account
  3. log into Linux box
  4. become root (to move elasticsearch-2.1.0.tar.gz to user elasticuser)
  5. move elasticsearch-2.1.0.tar.gz to home of user elasticuser
  6. untar to folder ~elasticuser/elasticsearch-2.1.0
  7. chown -R elasticuser:elasticuser ~elasticuser/elasticsearch-2.1.0
  8. become elasticuser
  9. cd ~elasticuser/elasticsearch-2.1.0
  10. ./bin/elasticsearch

did you have any ._* type of files in your directory structure?

I faced the same problem today. I got a zipped version of elasticsearch for windows that someone had downloaded, unzipped, and zipped again via a mac (don't ask why). It seems that for each file in the zipped version, there was a corresponding ._ kind of file. After deleting all these, elasticsearch startet to work again.

1 Like

If you run tar or zip on Mac, you must not forget to set COPYFILE_DISABLE variable by export COPYFILE_DISABLE=true

Thank you so much. I didn't zip anything from Mac OS but I did start using elasticSearch in mac, and those files were everywhere! I would have never be able to find this out on my own, thank you again

This worked for me too! Thanks!