Unable to run Elasticsearch 7.2 on Windows

Hello, i'm seeing this in the logs, anyone have any idea?

[o.e.b.Bootstrap ]Exception
java.lang.SecurityException: Security misconfiguration: cannot access java.io.tmpdir
at org.elasticsearch.bootstrap.Security.selfTest(Security.java:423) ~[elasticsearch-7.2.0.jar:7.2.0]
at org.elasticsearch.bootstrap.Security.configure(Security.java:133) ~[elasticsearch-7.2.0.jar:7.2.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:216) ~[elasticsearch-7.2.0.jar:7.2.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:349) [elasticsearch-7.2.0.jar:7.2.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) [elasticsearch-7.2.0.jar:7.2.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) [elasticsearch-7.2.0.jar:7.2.0]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-7.2.0.jar:7.2.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) [elasticsearch-cli-7.2.0.jar:7.2.0]
at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-7.2.0.jar:7.2.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115) [elasticsearch-7.2.0.jar:7.2.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) [elasticsearch-7.2.0.jar:7.2.0]
Caused by: java.lang.SecurityException: Unable to create temporary file or directory
at java.nio.file.TempFileHelper.create(TempFileHelper.java:142) ~[?:?]
at java.nio.file.TempFileHelper.createTempFile(TempFileHelper.java:160) ~[?:?]
at java.nio.file.Files.createTempFile(Files.java:912) ~[?:?]
at org.elasticsearch.bootstrap.Security.selfTest(Security.java:416) ~[elasticsearch-7.2.0.jar:7.2.0]
... 10 more

Java version is 11

issue fixed After adding 'xpack.ml.enabled: false' in elasticsearch.yml and adding a custom path for java.io.tmpdir in jvm options.

referred to Linux OS : Failed to create native process factories for Machine Learning

The ES_TMPDIR variable is not set anymore in the script elasticsearch-service.bat.

Dirty fix :
Edit the file elasticsearch-service.bat by adding the code below under :foundJVM

if not defined ES_TMPDIR (
for /f "tokens=* usebackq" %%a in (CALL %JAVA% -cp "!ES_CLASSPATH!" "org.elasticsearch.tools.launchers.TempDirectory") do set ES_TMPDIR=%%a
)

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