Elasticsearch version (bin/elasticsearch --version): ES 7.9.2
Plugins installed: []
JVM version (java -version): Bundled JDK
OS version (uname -a if on a Unix-like system): Windows 10
Description of the problem including expected versus actual behavior:
Unable to install elasticsearch as windows service when we set Xms and Xmx via windows env var ES_JAVA_OPTS
installation is okay if heap is set via jvm_options file.
Steps to reproduce:
-Xms4g -Xmx4gelasticsearch-service.bat installProvide logs (if relevant):
D:\ES7_test\elasticsearch-7.9.2\bin>echo %ES_JAVA_OPTS%
-Xms4g -Xmx4g
D:\ES7_test\elasticsearch-7.9.2\bin>elasticsearch-service.bat install
Installing service : "elasticsearch-service-x64"
Using JAVA_HOME (64-bit): ""D:\ES7_test\elasticsearch-7.9.2\jdk""
Exception in thread "main" java.lang.RuntimeException: starting java failed with [1]
output:
error:
Invalid initial heap size: -Xms4g;-Xmx4g
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
at org.elasticsearch.tools.launchers.JvmErgonomics.flagsFinal(JvmErgonomics.java:126)
at org.elasticsearch.tools.launchers.JvmErgonomics.finalJvmOptions(JvmErgonomics.java:88)
at org.elasticsearch.tools.launchers.JvmErgonomics.choose(JvmErgonomics.java:59)
at org.elasticsearch.tools.launchers.JvmOptionsParser.jvmOptions(JvmOptionsParser.java:137)
at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsParser.java:95)
Pinging @elastic/es-core-infra (:Core/Infra/Packaging)
@williamrandolph Can you take a look at this? Seems it might be related to the change you made in https://github.com/elastic/elasticsearch/pull/57769.
is there any workaround we can use as temporary measure?
maybe some patch on the elasticsearch-service.bat file?
@dbakti7 I've reproduced the bug and will create a PR with a code change shortly. Thank you for reporting this.
@dbakti7 If you want to try out the changes I'm making, there is a diff for elasticsearch-service.bat on this pull request: https://github.com/elastic/elasticsearch/pull/64254
@williamrandolph patch works perfectly! thank you!
and we are also looking forward to the official fix in 7.9.4! :)