ElasticSearch fail to start with error java.lang.NullPointerException

Hi,

I have downloaded ElasticSearch 7.0 tar file and installed (by untar-ing) on RHEL v7.5. When I start by ./bin/elasticsearch I get NullPointerException. I pointed my Java home to the JDK that is shipped with Elasticsearch. I did some search and find out that there might be some cgroup issue. I have got the out for the cgroup too. Please find below the log and cgroup details.

Elasticsearch startup error:
019-06-03T16:26:02,950][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [test.xx.com] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.NullPointerException
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-7.0.0.jar:7.0.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-7.0.0.jar:7.0.0]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-7.0.0.jar:7.0.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-7.0.0.jar:7.0.0]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-7.0.0.jar:7.0.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115) ~[elasticsearch-7.0.0.jar:7.0.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-7.0.0.jar:7.0.0]
Caused by: java.lang.NullPointerException
at sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:271) ~[?:?]
at org.elasticsearch.common.io.PathUtils.get(PathUtils.java:60) ~[elasticsearch-core-7.0.0.jar:7.0.0]
at org.elasticsearch.monitor.os.OsProbe.readSysFsCgroupCpuAcctCpuAcctUsage(OsProbe.java:277) ~[elasticsearch-7.0.0.jar:7.0.0]
at org.elasticsearch.monitor.os.OsProbe.getCgroupCpuAcctUsageNanos(OsProbe.java:264) ~[elasticsearch-7.0.0.jar:7.0.0]
at org.elasticsearch.monitor.os.OsProbe.getCgroup(OsProbe.java:483) ~[elasticsearch-7.0.0.jar:7.0.0]
at org.elasticsearch.monitor.os.OsProbe.osStats(OsProbe.java:603) ~[elasticsearch-7.0.0.jar:7.0.0]
at org.elasticsearch.xpack.ml.MachineLearning.additionalSettings(MachineLearning.java:339) ~[?:?]
at org.elasticsearch.plugins.PluginsService.updatedSettings(PluginsService.java:210) ~[elasticsearch-7.0.0.jar:7.0.0]
at org.elasticsearch.node.Node.(Node.java:307) ~[elasticsearch-7.0.0.jar:7.0.0]
at org.elasticsearch.node.Node.(Node.java:251) ~[elasticsearch-7.0.0.jar:7.0.0]
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:211) ~[elasticsearch-7.0.0.jar:7.0.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:211) ~[elasticsearch-7.0.0.jar:7.0.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:325) ~[elasticsearch-7.0.0.jar:7.0.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-7.0.0.jar:7.0.0]

cgroup info:

ps aux | grep Elasticsearch
elk 1343 1.4 1.7 3684108 1129092 pts/0 Sl+ 16:29 0:01 /opt/app/elk/elasticsearch/jdk//bin/java -Xms1g -Xmx1g -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-15982340472966849896 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=data -XX:ErrorFile=logs/hs_err_pid%p.log -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m -Djava.locale.providers=COMPAT -Dio.netty.allocator.type=unpooled -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 -Des.path.home=/opt/app/elk/elasticsearch -Des.path.conf=/opt/app/elk/elasticsearch/config -Des.distribution.flavor=default -Des.distribution.type=tar -Des.bundled_jdk=true -cp /opt/app/elk/elasticsearch/lib/* org.elasticsearch.bootstrap.Elasticsearch
elk 2009 0.0 0.0 112704 988 pts/1 S+ 16:31 0:00 grep --color=auto Elasticsearch

$ cat /proc/1343/cgroup
8:devices:/system.slice/sshd.service
1:name=systemd:/user.slice/user-396000099.slice/session-296392.scope

$ mount | grep cgroup
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,seclabel,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)

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