Elasticsearch 5 crash java security policy

Hello,

I'm trying to run Elasticsearch 5.1 on Ubuntu 16.04 virtual machine

Elastisearch is starting but crashes with the following errors :

Jan 4 08:02:20 kibana systemd[1]: Starting Elasticsearch...
Jan 4 08:02:20 kibana systemd[1]: Started Elasticsearch.
Jan 4 08:02:29 kibana elasticsearch[27073]: java.security.policy: error adding Entry:
Jan 4 08:02:29 kibana elasticsearch[27073]: #011java.net.MalformedURLException: no protocol: ${codebase.netty-common-4.1.6.Final.jar}
Jan 4 08:02:29 kibana elasticsearch[27073]: java.security.policy: error adding Entry:
Jan 4 08:02:29 kibana elasticsearch[27073]: #011java.net.MalformedURLException: no protocol: ${codebase.netty-transport-4.1.6.Final.jar}
Jan 4 08:02:29 kibana elasticsearch[27073]: java.security.policy: error adding Entry:
Jan 4 08:02:29 kibana elasticsearch[27073]: #011java.net.MalformedURLException: no protocol: ${codebase.securesm-1.1.jar}
Jan 4 08:02:29 kibana elasticsearch[27073]: java.security.policy: error adding Entry:
Jan 4 08:02:29 kibana elasticsearch[27073]: #011java.net.MalformedURLException: no protocol: ${codebase.lucene-core-6.3.0.jar}
Jan 4 08:02:29 kibana elasticsearch[27073]: java.security.policy: error adding Entry:
Jan 4 08:02:29 kibana elasticsearch[27073]: #011java.net.MalformedURLException: no protocol: ${codebase.lucene-misc-6.3.0.jar}
Jan 4 08:02:35 kibana systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Jan 4 08:02:35 kibana systemd[1]: elasticsearch.service: Unit entered failed state.
Jan 4 08:02:35 kibana systemd[1]: elasticsearch.service: Failed with result 'exit-code'.

I don't understand these issues, can you help me ?

Thanks !

Hi,
Is this a new installation of 5.1.1?
Do you have any plugins installed?

This could be coming from the plugin-security.policy however we need to gauge what has occurred previous to this run of ES 5.1.x.

Hi JKhondhu,

Thank you for your message.

Yes, ElasticSearch instance is new (setup from official repositories).

No plugins are installed (plugins folder is empty).

This looks suspicious. What Java version (java -version), are you using an old EA JDK 9 build?

Here is the java -version output :

openjdk version "9-internal"
OpenJDK Runtime Environment (build 9-internal+0-2016-04-14-195246.buildd.src)
OpenJDK 64-Bit Server VM (build 9-internal+0-2016-04-14-195246.buildd.src, mixed mode)

I have also tried to run with Open JDK 8 but nothing changes about the issue

As suspected. That EA build of JDK 9 is very old, and you shouldn't be running with any EA build of JDK 9 anyway.

Sorry, but I'm skeptical of this. Are you sure you correctly set JAVA_HOME to point to the JDK 8 install? Would you please completely remove the JDK 9 install from your system?

I am running ubuntu gnome 16.10 (fresh install yesterday evening)

I am having the exact same issue. Here is what i did prior...

  1. Installed elastic search from default ubuntu repos. During the process i noticed the version number was not that newest (1.7.X something).
  2. apt-get purged elasticsearch
  3. Installed from the default repos
  4. followed systctl instructions.
  5. started service
  6. reviewed status with the above errors.
  7. Noticed i also had the openjdk-9-jdk installed.
  8. Installed openjdk-8-jdk. (now i have both installed).
  9. Not sure how to proceed i set JAVA_HOME to the java 8 jdk
  10. restarted service
  11. Same issue.

Pretty sure its an issue between the jdk's and the prior install from default ubuntu repos. I am just not sure how to unwind this and get it working.

Thanks!

Figured it out just needed to set-alternatives in apt.

Thanks Jason !

ElasticSearch is running now. The JAVA_HOME environment variable was indeed not correctly set.

You're welcome. I'm glad that you got it sorted out.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.