Unable to install elasticsearch in RHEL 7 due to polkit error

Trying to install elasticsearch in RHEL 7, but it has been failed with polkit error (please refer below for the detailed error) - I tried to reinstall and also with full permissions on the file as recommended in other topic but didn't get success. Please help if you have come across and resolved this error.

Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: fatal error in thread [main], exiting
Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: java.lang.NoClassDefFoundError: Could not initialize class c
Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.systemd.Libsystemd.lambda$static$0(Libs
Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at java.security.AccessController.doPrivileged(Native Method
Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.systemd.Libsystemd.(Libsystemd.
Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.systemd.SystemdPlugin.sd_notify(Systemd
Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.systemd.SystemdPlugin.onNodeStarted(Sys
Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at java.util.ArrayList.forEach(ArrayList.java:1259)
Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.node.Node.start(Node.java:868)
Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.bootstrap.Bootstrap.start(Bootstrap.jav
Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java
Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsea
Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.bootstrap.Elasticsearch.execute(Elastic
Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.cli.EnvironmentAwareCommand.execute(Env
Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Co
Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.cli.Command.main(Command.java:90)
Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsea
Sep 24 10:30:50 lfltst001x systemd-entrypoint[16005]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsea
Sep 24 10:30:50 lfltst001x systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
Sep 24 10:30:50 lfltst001x systemd[1]: Failed to start Elasticsearch.
-- Subject: Unit elasticsearch.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

-- Unit elasticsearch.service has failed.

-- The result is failed.
Sep 24 10:30:50 lfltst001x systemd[1]: Unit elasticsearch.service entered failed state.
Sep 24 10:30:50 lfltst001x systemd[1]: elasticsearch.service failed.
Sep 24 10:30:50 lfltst001x polkitd[1010]: Unregistered Authentication Agent for unix-process:15998:366323193 (syst
lines 2021-2050/2050 (END)

Welcome to our community! :smiley:

Can you please check your Elasticsearch logs and see if there is anything further?

Thank you Mark,

Yaa.. i see that JNA native support library were unable to load... below is the elasticsearch log

[2020-09-24T12:09:34,837][WARN ][o.e.b.Natives ] [lfltst001x] unable to load JNA native support library, native methods will be disabled.
java.lang.UnsatisfiedLinkError: /tmp/elasticsearch-15068793945104209523/jna5892265188709333092.tmp: /tmp/elasticsearch-15068793945104209523/jna5892265188709333092.tmp: failed to map segment from shared object: Operation not permitted
at jdk.internal.loader.NativeLibraries.load(Native Method) ~[?:?]
at jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:383) ~[?:?]
at jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:227) ~[?:?]
at jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:169) ~[?:?]
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:2407) ~[?:?]
at java.lang.Runtime.load0(Runtime.java:747) ~[?:?]
at java.lang.System.load(System.java:1857) ~[?:?]
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1018) ~[jna-5.5.0.jar:5.5.0 (b0)]
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:988) ~[jna-5.5.0.jar:5.5.0 (b0)]
at com.sun.jna.Native.(Native.java:195) ~[jna-5.5.0.jar:5.5.0 (b0)]
at java.lang.Class.forName0(Native Method) ~[?:?]
at java.lang.Class.forName(Class.java:377) ~[?:?]
at org.elasticsearch.bootstrap.Natives.(Natives.java:45) [elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:110) [elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178) [elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393) [elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) [elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) [elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127) [elasticsearch-cli-7.9.2.jar:7.9.2]
at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) [elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) [elasticsearch-7.9.2.jar:7.9.2]
[2020-09-24T12:09:34,847][WARN ][o.e.b.Natives ] [lfltst001x] cannot check if running as root because JNA is not available
[2020-09-24T12:09:34,847][WARN ][o.e.b.Natives ] [lfltst001x] cannot install system call filter because JNA is not available
[2020-09-24T12:09:34,848][WARN ][o.e.b.Natives ] [lfltst001x] cannot register console handler because JNA is not available
[2020-09-24T12:09:34,849][WARN ][o.e.b.Natives ] [lfltst001x] cannot getrlimit RLIMIT_NPROC because JNA is not available
[2020-09-24T12:09:34,849][WARN ][o.e.b.Natives ] [lfltst001x] cannot getrlimit RLIMIT_AS because JNA is not available
[2020-09-24T12:09:34,849][WARN ][o.e.b.Natives ] [lfltst001x] cannot getrlimit RLIMIT_FSIZE because JNA is not available
[2020-09-24T12:09:35,019][INFO ][o.e.n.Node ] [lfltst001x] version[7.9.2], pid[24266], build[default/rpm/d34da0ea4a966c4e49417f2da2f244e3e97b4e6e/2020-09-23T00:45:33.626720Z], OS[Linux/3.10.0-1127.18.2.el7.x86_64/amd64], JVM[AdoptOpenJDK/OpenJDK 64-Bit Server VM/15/15+36]
[2020-09-24T12:09:35,021][INFO ][o.e.n.Node ] [lfltst001x] JVM home [/usr/share/elasticsearch/jdk]

I saw something similar when I licensed my cluster; I explicitly set xpack.security.enabled = false on my 3 master nodes, but not on my data nodes. After I installed the license through Kibana, I saw my cluster go down. When I explicitly disable xpack security on the data nodes and restarted them the issue cleared up.

Thanks @jkfields, will try this option to see if it helps.

We'd strongly recommend against disabling security protection on your cluster.

@warkolm, sure, can you please advise other alternative to resolve this issue? I am having same issue still. Thank you !

That is guaranteed to cause issues. Security needs to be enabled on all nodes in the cluster.

Try the solution here Unable to start elasticsearch from systemctl in centos 7.7.

ok, will try this solution tomorrow, and see if it works.. will keep you posted

i changed the recommended variable and tried to restart but again, i see the same error

[2020-09-24T12:09:34,837][WARN ][o.e.b.Natives ] [lfltst001x] unable to load JNA native support library, native methods will be disabled.
java.lang.UnsatisfiedLinkError: /tmp/elasticsearch-15068793945104209523/jna5892265188709333092.tmp: /tmp/elasticsearch-15068793945104209523/jna5892265188709333092.tmp: failed to map segment from shared object: Operation not permitted
at jdk.internal.loader.NativeLibraries.load(Native Method) ~[?:?]
at jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:383) ~[?:?]
at jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:227) ~[?:?]
at jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:169) ~[?:?]
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:2407) ~[?:?]
at java.lang.Runtime.load0(Runtime.java:747) ~[?:?]
at java.lang.System.load(System.java:1857) ~[?:?]
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1018) ~[jna-5.5.0.jar:5.5.0 (b0)]
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:988) ~[jna-5.5.0.jar:5.5.0 (b0)]
at com.sun.jna.Native.(Native.java:195) ~[jna-5.5.0.jar:5.5.0 (b0)]
at java.lang.Class.forName0(Native Method) ~[?:?]
at java.lang.Class.forName(Class.java:377) ~[?:?]
at org.elasticsearch.bootstrap.Natives.(Natives.java:45) [elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:110) [elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178) [elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393) [elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) [elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) [elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127) [elasticsearch-cli-7.9.2.jar:7.9.2]
at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) [elasticsearch-7.9.2.jar:7.9.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) [elasticsearch-7.9.2.jar:7.9.2]
[2020-09-24T12:09:34,847][WARN ][o.e.b.Natives ] [lfltst001x] cannot check if running as root because JNA is not available
[2020-09-24T12:09:34,847][WARN ][o.e.b.Natives ] [lfltst001x] cannot install system call filter because JNA is not available
[2020-09-24T12:09:34,848][WARN ][o.e.b.Natives ] [lfltst001x] cannot register console handler because JNA is not available
3,2-9 Top

It seems to say that it could not map /tmp/elasticsearch directory.
Is your /tmp noexec? You could remove noexec from /tmp or try to change it to some other directory like what warkolm's link shows "/var/lib/elasticsearch/tmp"

Refer to below doc:

@kavierkoo, Thank you very much, i tried after changing /tmp/with exec and it started successfully.

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