Failing to start elasticsearch versions 6.x on Mac due to java.security.* access denied

Hi,

I installed elasticsearch 6.2.1 (also tried 6.1.2) on my mac, and I am getting various exceptions due to Java security issues.
Searching google I found very few suggestions, all of them pointing to the Java policy file, which to me seems correctly defined. A colleague of mine installed the same version on a similar setup (his mac), and it is running without issues.

When running 6.2.1 I got the following exceptions:

java.security.policy : erreur d'ajout d'entrée :
	java.net.MalformedURLException: no protocol: ${codebase.netty-common}
java.security.policy : erreur d'ajout d'entrée :
	java.net.MalformedURLException: no protocol: ${codebase.netty-transport}
java.security.policy : erreur d'ajout d'entrée :
	java.net.MalformedURLException: no protocol: ${codebase.elasticsearch-rest-client}
java.security.policy : erreur d'ajout d'entrée :
	java.net.MalformedURLException: no protocol: ${codebase.httpasyncclient}
java.security.policy : erreur d'ajout d'entrée :
	java.net.MalformedURLException: no protocol: ${codebase.securesm}
java.security.policy : erreur d'ajout d'entrée :
	java.net.MalformedURLException: no protocol: ${codebase.lucene-core}
java.security.policy : erreur d'ajout d'entrée :
	java.net.MalformedURLException: no protocol: ${codebase.lucene-misc}
java.security.policy : erreur d'ajout d'entrée :
	java.net.MalformedURLException: no protocol: ${codebase.plugin-classloader}
[2018-02-15T10:17:45,557][INFO ][o.e.n.Node               ] [] initializing ...
[2018-02-15T10:17:45,680][INFO ][o.e.e.NodeEnvironment    ] [hPUMCEO] using [1] data paths, mounts [[/ (/dev/disk1s1)]], net usable_space [3.9gb], net total_space [112.8gb], types [apfs]
[2018-02-15T10:17:45,680][INFO ][o.e.e.NodeEnvironment    ] [hPUMCEO] heap size [990.7mb], compressed ordinary object pointers [true]
[2018-02-15T10:17:45,682][INFO ][o.e.n.Node               ] node name [hPUMCEO] derived from node ID [hPUMCEOAT0anDep0o-eDnw]; set [node.name] to override
[2018-02-15T10:17:45,683][INFO ][o.e.n.Node               ] version[6.2.1], pid[9673], build[7299dc3/2018-02-07T19:34:26.990113Z], OS[Mac OS X/10.13.3/x86_64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_73/25.73-b02]
[2018-02-15T10:17:45,684][INFO ][o.e.n.Node               ] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/var/folders/n5/3vjp29xd461fmqhs2hmty9100000gn/T/elasticsearch.qOpnRuGG, -XX:+HeapDumpOnOutOfMemoryError, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:logs/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Des.path.home=/usr/local/Cellar/elasticsearch/6.2.1/libexec, -Des.path.conf=/usr/local/etc/elasticsearch]
[2018-02-15T10:17:45,787][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "createClassLoader")
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:125) ~[elasticsearch-6.2.1.jar:6.2.1]
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-6.2.1.jar:6.2.1]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.2.1.jar:6.2.1]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.2.1.jar:6.2.1]
	at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.2.1.jar:6.2.1]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-6.2.1.jar:6.2.1]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85) ~[elasticsearch-6.2.1.jar:6.2.1]
Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "createClassLoader")
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) ~[?:1.8.0_73]
	at java.security.AccessController.checkPermission(AccessController.java:884) ~[?:1.8.0_73]
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) ~[?:1.8.0_73]
	at java.lang.SecurityManager.checkCreateClassLoader(SecurityManager.java:611) ~[?:1.8.0_73]
	at java.lang.ClassLoader.checkCreateClassLoader(ClassLoader.java:274) ~[?:1.8.0_73]
	at java.lang.ClassLoader.<init>(ClassLoader.java:316) ~[?:1.8.0_73]
	at org.elasticsearch.plugins.ExtendedPluginsClassLoader.<init>(ExtendedPluginsClassLoader.java:36) ~[plugin-classloader-6.2.1.jar:6.2.1]
	at org.elasticsearch.plugins.ExtendedPluginsClassLoader.lambda$create$0(ExtendedPluginsClassLoader.java:57) ~[plugin-classloader-6.2.1.jar:6.2.1]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_73]
	at org.elasticsearch.plugins.ExtendedPluginsClassLoader.create(ExtendedPluginsClassLoader.java:56) ~[plugin-classloader-6.2.1.jar:6.2.1]
	at org.elasticsearch.plugins.PluginLoaderIndirection.createLoader(PluginLoaderIndirection.java:31) ~[elasticsearch-6.2.1.jar:6.2.1]
	at org.elasticsearch.plugins.PluginsService.loadBundle(PluginsService.java:494) ~[elasticsearch-6.2.1.jar:6.2.1]
	at org.elasticsearch.plugins.PluginsService.loadBundles(PluginsService.java:422) ~[elasticsearch-6.2.1.jar:6.2.1]
	at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:146) ~[elasticsearch-6.2.1.jar:6.2.1]
	at org.elasticsearch.node.Node.<init>(Node.java:303) ~[elasticsearch-6.2.1.jar:6.2.1]
	at org.elasticsearch.node.Node.<init>(Node.java:246) ~[elasticsearch-6.2.1.jar:6.2.1]
	at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:213) ~[elasticsearch-6.2.1.jar:6.2.1]
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:213) ~[elasticsearch-6.2.1.jar:6.2.1]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:323) ~[elasticsearch-6.2.1.jar:6.2.1]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-6.2.1.jar:6.2.1]
	... 6 more

Would be grateful for any help.

Solved by updating to the latest Java 8 version (from 8.0.73 to 8.0.163).

the java version and the use about es install directory.

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