Warning: Falling back to java on path. This behavior is deprecated. Specify JAVA_HOME

Hi all

ES version: 6.7.1
Host: 18.04 LTS
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-2ubuntu0.18.04.1-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

I have this error on two node that I've installed ES on

warning: Falling back to java on path. This behavior is deprecated. Specify JAVA_HOME

I'm not sure what is causing the error and how do I specify JAVA_HOME ?

Thanks

Hi @sph18,

I think this is just a warning and that the server should start OK. Relying on PATH to find the java version to use is deprecated in 6.7 and not supported on 7.0. Instead, you should set the JAVA_HOME environment variable before starting elasticsearch.

If you are starting elasticsearch from a bash commandline, you can specify JAVA_HOME using:

export JAVA_HOME=/path/to/java

before starting elasticsearch.

You can also ignore this, but then be aware that on elasticsearch 7.0 you will be switched over to using the bundled java version. I would recommend to set JAVA_HOME as long as you are on 6.7 and then switch over to not setting it explicitly once upgraded to 7.0.

Thanks @HenningAndersen ,

That's makes more seance now. OK brill, thanks :slight_smile:

1 Like

Hi, I have the same problem, but, as you can see in my attached image, I stop the elasticsearch service, I activate it and I look at the status twice (4 seconds apart) and the service goes from active to failed. I do not understand the problem, can you help me please?

This is my java path:

image

1 Like

Hi @manue,

My best guess is that this is unrelated to the warning. I would advice to check the elasticsearch log files for any error messages.

ok, tell me what file do you need to check?

Hi @manue,

the primary log file for a debian installation is:

/var/log/elasticsearch/elasticsearch.log

I suspect that could contain relevant information on why the service stops.

[2019-04-10T11:57:50,021][INFO ][o.e.e.NodeEnvironment ] [X302cXZ] using [1] data paths, mounts [[/ (/dev/vda1)]], net usable_space [73.1gb], net total_space [77.3gb], types [ext4]
[2019-04-10T11:57:50,025][INFO ][o.e.e.NodeEnvironment ] [X302cXZ] heap size [1.9gb], compressed ordinary object pointers [true]
[2019-04-10T11:57:50,064][INFO ][o.e.n.Node ] [X302cXZ] node name derived from node ID [X302cXZcRcSosyfZHPXHug]; set [node.name] to override
[2019-04-10T11:57:50,064][INFO ][o.e.n.Node ] [X302cXZ] version[6.7.1], pid[5147], build[default/deb/2f32220/2019-04-02T15:59:27.961366Z], OS[Linux/4.15.0-47-generic/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_201/25.201-b09]
[2019-04-10T11:57:50,064][INFO ][o.e.n.Node ] [X302cXZ] JVM arguments [-Xms2g, -Xmx2g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -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=/tmp/elasticsearch-1003868106751122367, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=/var/lib/elasticsearch, -XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:/var/log/elasticsearch/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Des.path.home=/usr/share/elasticsearch, -Des.path.conf=/etc/elasticsearch, -Des.distribution.flavor=default, -Des.distribution.type=deb]
[2019-04-10T11:57:51,792][ERROR][o.e.b.Bootstrap ] [X302cXZ] Exception
java.lang.IllegalArgumentException: Plugin [analysis-phonetic] was built for Elasticsearch version 6.7.0 but version 6.7.1 is running
at org.elasticsearch.plugins.PluginsService.verifyCompatibility(PluginsService.java:346) ~[elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.plugins.PluginsService.loadBundle(PluginsService.java:531) ~[elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.plugins.PluginsService.loadBundles(PluginsService.java:471) ~[elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.plugins.PluginsService.(PluginsService.java:163) ~[elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.node.Node.(Node.java:339) ~[elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.node.Node.(Node.java:266) ~[elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:212) ~[elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) [elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) [elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) [elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) [elasticsearch-cli-6.7.1.jar:6.7.1]
at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-6.7.1.jar:6.7.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116) [elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) [elasticsearch-6.7.1.jar:6.7.1]
[2019-04-10T11:57:51,798][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [X302cXZ] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: Plugin [analysis-phonetic] was built for Elasticsearch version 6.7.0 but version 6.7.1 is running
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.7.1.jar:6.7.1]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.7.1.jar:6.7.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116) ~[elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[elasticsearch-6.7.1.jar:6.7.1]
Caused by: java.lang.IllegalArgumentException: Plugin [analysis-phonetic] was built for Elasticsearch version 6.7.0 but version 6.7.1 is running
at org.elasticsearch.plugins.PluginsService.verifyCompatibility(PluginsService.java:346) ~[elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.plugins.PluginsService.loadBundle(PluginsService.java:531) ~[elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.plugins.PluginsService.loadBundles(PluginsService.java:471) ~[elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.plugins.PluginsService.(PluginsService.java:163) ~[elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.node.Node.(Node.java:339) ~[elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.node.Node.(Node.java:266) ~[elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:212) ~[elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.7.1.jar:6.7.1]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.7.1.jar:6.7.1]
... 6 more

1 Like

This is the information I have in this log file, is it enough for you? Can you see any error?

Hi @manue,

yes, the log does show that:

org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: Plugin [analysis-phonetic] was built for Elasticsearch version 6.7.0 but version 6.7.1 is running

After the upgrade to 6.7.1, you will also have to upgrade that plugin. See:

https://www.elastic.co/guide/en/elasticsearch/plugins/6.7/analysis-phonetic.html

for instructions. Notice that to upgrade it you have to uninstall it first. If you no longer need the plugin, simply leave it uninstalled.

1 Like

Thank you very much for your help! So, I just have to uninstall it? I do not know if that plugin works with Magento or is not necessary? what do you recommend? uninstall it and reinstall it or just uninstall it?

Hi @manue,

I do not know Magento and would advice to direct your question to the maintainers of Magento.

Given that uncertainty, it seems safest to reinstall it unless they can clarify that it is not needed.

Ok Thank you! And for this warning? What do you think? How can I solve that?

Hi @manue,

you can setup JAVA_HOME in /etc/default/elasticsearch (debian based). Something like this worked on my setup:

JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/

but the actual path may vary depending on installation location and version of java.

See following for more info:

https://www.elastic.co/guide/en/elasticsearch/reference/6.7/setting-system-settings.html

4 Likes

Now everything works fine, but checking the log I find the last row of the attached image, what do you think about this? It is normal? (Finally I uninstalled the plugin and reinstalled it)

Thank you so much! this problem was fixed! :slight_smile:

Can you tell me something about the problem of the previous picture? It is a problem? important? Can I solve it in any way? Thank you so much!

Hi @manue,

the last line shows that the cluster recovered all indices fine after the restart and the status is now GREEN meaning everything is good.

See following for more information on the definition of RED, YELLOW and GREEN cluster health and how to get more detailed information:

https://www.elastic.co/guide/en/elasticsearch/reference/6.7/cluster-health.html

1 Like

Thank you so much for all! :slight_smile:

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