6.2.1: Unrecognized option: -server

Hi! Trying to upgrade from 6.1.2 to 6.2.3 on Windows. We have JAVA_HOME and am using jre 1.8.0.111

ES_PATH_CONF is set to a directory outside of the Elastic installation directory.

Getting this error when trying to start it:

2018-04-13 11:54:59 Commons Daemon procrun stderr initialized
Unrecognized option: -server

I came across this: Remove leftover doc comment on client JVM check by jasontedor · Pull Request #28738 · elastic/elasticsearch · GitHub

Sure enough we had -server set. So I commented out, yet am still getting that same error.

Here's our jvm.options: jvm.options · GitHub

I tried using the same jvm.options (editing the Xms/Xmx only) as what comes with the package but still a no go.

any pointers on where I went wrong?

Thanks!

-Matt

Most likely you need a jdk instead of a jre.

Or you need to change one of the bat file IIRC.

Interesting! We are using JRE. I'll try JDK next. Is this a change from 6.1 to 6.2?

Thanks!

Not sure

The Apache library that we use to enable Elasticsearch to run as a Windows service can not handle the -server flag. In the past, we filtered this option out of the default jvm.options before installing the Windows service. Now, we no longer ship with this included in the default jvm.options. If you are using a jvm.options from the past that included this option, since the filter is no longer in place it will be included in the options used to start the Windows service. Removing this from the jvm.options file is not enough because that file is not read after the service is installed. Instead you have to either remove the service and reinstall it (after you've removed -server from the jvm.options file), or use elasticsearch-service manager to manually remove the option from the service (look at the tab that includes the JVM flags).

The filter was indeed removed in 6.2.0: https://github.com/elastic/elasticsearch/pull/27675. This change was made to support running Elasticsearch on JDK 9.

1 Like

Thank you @jasontedor. Really helpful.

Thanks! The order was the issue. I had no idea the jvm.options file was loaded only at service install time. I must've been putting the new jvm.options file in place after re-installing the service (my luck huh).

Upgrade went successful. Thanks again!

-Matt

You're welcome, I am happy to have helped.

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