"UnsatisfiedLinkError: libzstd.so" upon es v8.14.1 startup

Sometimes and not always, upon startup, I see the following error message, complaining that libzstd.so is not present. Indeed it is not on the image. However, what confuses me is that a) I don't see any installation requirement saying it needs to be there; and b) I am only sometimes getting this error message despite the library never being there.

  • Is this just a info/warning? The log does say "suppressed". Maybe this logging ought to not show up then.

  • What is this library used for? I see that it's used for compression. What things might break if this is not found? (update: From elasticsearch/server/src/main/java/org/elasticsearch/bootstrap/Elasticsearch.java at v8.14.3 · elastic/elasticsearch · GitHub I see that this particular check is used for the root user check. This particular failure can be ignored since we're not running as root. However, I'm not sure if libzstd is used elsewhere in the product that would cause a problem)

  • Why is this only sometimes happening? (update: actually I think this is always happening when running as a container)

Note, I am using the v8.14.1 windows-x86_64 distribution for both windows and linux amd64 machines, since this distribution has both sets of binaries/scripts. But the linux distribution also doesn't have this file.

[2024-07-15T23:36:52,163][WARN ][org.elasticsearch.nativeaccess.NativeAccess] [<redacted>.2083175] Unable to load native provider. Native methods will be disabled.
java.lang.UnsatisfiedLinkError: Unable to load library 'zstd':
libzstd.so: cannot open shared object file: No such file or directory
libzstd.so: cannot open shared object file: No such file or directory
Native library (linux-x86-64/libzstd.so) not found in resource path ()
        at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:307) ~[jna-5.12.1.jar:?]
        at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:467) ~[jna-5.12.1.jar:?]
        at com.sun.jna.Native.register(Native.java:1774) ~[jna-5.12.1.jar:?]
        at org.elasticsearch.nativeaccess.jna.JnaZstdLibrary.<init>(JnaZstdLibrary.java:32) ~[?:?]
        at org.elasticsearch.nativeaccess.lib.NativeLibraryProvider.getLibrary(NativeLibraryProvider.java:58) ~[elasticsearch-native-8.14.1.jar:?
]
        at org.elasticsearch.nativeaccess.AbstractNativeAccess.<init>(AbstractNativeAccess.java:28) ~[elasticsearch-native-8.14.1.jar:?]
        at org.elasticsearch.nativeaccess.PosixNativeAccess.<init>(PosixNativeAccess.java:23) ~[elasticsearch-native-8.14.1.jar:?]
        at org.elasticsearch.nativeaccess.LinuxNativeAccess.<init>(LinuxNativeAccess.java:19) ~[elasticsearch-native-8.14.1.jar:?]
        at org.elasticsearch.nativeaccess.NativeAccessHolder.<clinit>(NativeAccessHolder.java:28) ~[elasticsearch-native-8.14.1.jar:?]
        at org.elasticsearch.nativeaccess.NativeAccess.instance(NativeAccess.java:22) ~[elasticsearch-native-8.14.1.jar:?]
        at org.elasticsearch.bootstrap.Elasticsearch.initializeNatives(Elasticsearch.java:285) ~[elasticsearch-8.14.1.jar:?]
        at org.elasticsearch.bootstrap.Elasticsearch.initPhase2(Elasticsearch.java:169) ~[elasticsearch-8.14.1.jar:?]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:74) ~[elasticsearch-8.14.1.jar:?]
        Suppressed: java.lang.UnsatisfiedLinkError: libzstd.so: cannot open shared object file: No such file or directory
                at com.sun.jna.Native.open(Native Method) ~[jna-5.12.1.jar:?]
                at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:197) ~[jna-5.12.1.jar:?]
                at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:467) ~[jna-5.12.1.jar:?]
                at com.sun.jna.Native.register(Native.java:1774) ~[jna-5.12.1.jar:?]
                at org.elasticsearch.nativeaccess.jna.JnaZstdLibrary.<init>(JnaZstdLibrary.java:32) ~[?:?]
                at org.elasticsearch.nativeaccess.lib.NativeLibraryProvider.getLibrary(NativeLibraryProvider.java:58) ~[elasticsearch-native-8.14
.1.jar:?]
                at org.elasticsearch.nativeaccess.AbstractNativeAccess.<init>(AbstractNativeAccess.java:28) ~[elasticsearch-native-8.14.1.jar:?]
                at org.elasticsearch.nativeaccess.PosixNativeAccess.<init>(PosixNativeAccess.java:23) ~[elasticsearch-native-8.14.1.jar:?]
                at org.elasticsearch.nativeaccess.LinuxNativeAccess.<init>(LinuxNativeAccess.java:19) ~[elasticsearch-native-8.14.1.jar:?]
                at org.elasticsearch.nativeaccess.NativeAccessHolder.<clinit>(NativeAccessHolder.java:28) ~[elasticsearch-native-8.14.1.jar:?]
                at org.elasticsearch.nativeaccess.NativeAccess.instance(NativeAccess.java:22) ~[elasticsearch-native-8.14.1.jar:?]
                at org.elasticsearch.bootstrap.Elasticsearch.initializeNatives(Elasticsearch.java:285) ~[elasticsearch-8.14.1.jar:?]
                at org.elasticsearch.bootstrap.Elasticsearch.initPhase2(Elasticsearch.java:169) ~[elasticsearch-8.14.1.jar:?]
                at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:74) ~[elasticsearch-8.14.1.jar:?]
        Suppressed: java.lang.UnsatisfiedLinkError: libzstd.so: cannot open shared object file: No such file or directory
                at com.sun.jna.Native.open(Native Method) ~[jna-5.12.1.jar:?]
                at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:210) ~[jna-5.12.1.jar:?]
                at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:467) ~[jna-5.12.1.jar:?]
                at com.sun.jna.Native.register(Native.java:1774) ~[jna-5.12.1.jar:?]
                at org.elasticsearch.nativeaccess.jna.JnaZstdLibrary.<init>(JnaZstdLibrary.java:32) ~[?:?]
                at org.elasticsearch.nativeaccess.lib.NativeLibraryProvider.getLibrary(NativeLibraryProvider.java:58) ~[elasticsearch-native-8.14.1.jar:?]
                at org.elasticsearch.nativeaccess.AbstractNativeAccess.<init>(AbstractNativeAccess.java:28) ~[elasticsearch-native-8.14.1.jar:?]
                at org.elasticsearch.nativeaccess.PosixNativeAccess.<init>(PosixNativeAccess.java:23) ~[elasticsearch-native-8.14.1.jar:?]
                at org.elasticsearch.nativeaccess.LinuxNativeAccess.<init>(LinuxNativeAccess.java:19) ~[elasticsearch-native-8.14.1.jar:?]
                at org.elasticsearch.nativeaccess.NativeAccessHolder.<clinit>(NativeAccessHolder.java:28) ~[elasticsearch-native-8.14.1.jar:?]
                at org.elasticsearch.nativeaccess.NativeAccess.instance(NativeAccess.java:22) ~[elasticsearch-native-8.14.1.jar:?]
                at org.elasticsearch.bootstrap.Elasticsearch.initializeNatives(Elasticsearch.java:285) ~[elasticsearch-8.14.1.jar:?]
                at org.elasticsearch.bootstrap.Elasticsearch.initPhase2(Elasticsearch.java:169) ~[elasticsearch-8.14.1.jar:?]
                at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:74) ~[elasticsearch-8.14.1.jar:?]
        Suppressed: java.io.IOException: Native library (linux-x86-64/libzstd.so) not found in resource path ()
                at com.sun.jna.Native.extractFromResourcePath(Native.java:1145) ~[jna-5.12.1.jar:?]
                at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:281) ~[jna-5.12.1.jar:?]
                at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:467) ~[jna-5.12.1.jar:?]
                at com.sun.jna.Native.register(Native.java:1774) ~[jna-5.12.1.jar:?]
                at org.elasticsearch.nativeaccess.jna.JnaZstdLibrary.<init>(JnaZstdLibrary.java:32) ~[?:?]
                at org.elasticsearch.nativeaccess.lib.NativeLibraryProvider.getLibrary(NativeLibraryProvider.java:58) ~[elasticsearch-native-8.14.1.jar:?]
                at org.elasticsearch.nativeaccess.AbstractNativeAccess.<init>(AbstractNativeAccess.java:28) ~[elasticsearch-native-8.14.1.jar:?]
                at org.elasticsearch.nativeaccess.PosixNativeAccess.<init>(PosixNativeAccess.java:23) ~[elasticsearch-native-8.14.1.jar:?]
                at org.elasticsearch.nativeaccess.LinuxNativeAccess.<init>(LinuxNativeAccess.java:19) ~[elasticsearch-native-8.14.1.jar:?]
                at org.elasticsearch.nativeaccess.NativeAccessHolder.<clinit>(NativeAccessHolder.java:28) ~[elasticsearch-native-8.14.1.jar:?]
                at org.elasticsearch.nativeaccess.NativeAccess.instance(NativeAccess.java:22) ~[elasticsearch-native-8.14.1.jar:?]
                at org.elasticsearch.bootstrap.Elasticsearch.initializeNatives(Elasticsearch.java:285) ~[elasticsearch-8.14.1.jar:?]
                at org.elasticsearch.bootstrap.Elasticsearch.initPhase2(Elasticsearch.java:169) ~[elasticsearch-8.14.1.jar:?]
                at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:74) ~[elasticsearch-8.14.1.jar:?]
[2024-07-15T23:36:52,174][WARN ][org.elasticsearch.nativeaccess.NativeAccess] [<redacted>.2083175] Cann
ot check if running as root because native access is not available

I think this WARNING is mostly fine bc they are produced when doing the root user check.

I'm not sure if libzstd is used in other places necessary to elasticsearch critical functionality though.

From Elastic Search to Elasticsearch

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