Cannot Open Shared Object File

I am trying to start Elasticsearch on a Linux machine and keep getting the response:

/opt/cust/suite/javabin/jre/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory

When I locate libjli.so it shows it:

[serv_act@test1 bin]$ locate libjli.so
/opt/cust/suite/javabin/jre/lib/amd64/libjli.so
/opt/cust/suite/javabin/jre/lib/amd64/jli/libjli.so
/opt/cust/suite/javabin/jre32/lib/i386/jli/libjli.so

Java home is set as well:

[serv_act@test1 bin]$ printenv JAVA_HOME
/opt/cust/suite/javabin/jre

Does anyone from the Elastic team have any ideas?

Sounds like a bad installation of Java, may be...
Try to install a JDK instead of JRE in case it helps.

If you don't succeed, please share which exact OS and version you are using.

[osiserv_act@test1 ~]$ uname -a
Linux test1 2.6.32-696.10.2.el6.x86_64 #1 SMP Sun Sep 10 11:10:44 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux

I previously had Elasticsearch running on the server with the Java version we have installed. The server was recently restarted and elasticsearch and elasticsearch-env no longer run. Both of them return with the same issue "error while loading shared libraries".

I am thinking that maybe there is environment variables that have been changed without my knowledge. Could this be possible? If so, what should they look like?

Thanks!

May be. I don't remember.

But now the question seems a bit quite different. You are not just starting Elasticsearch on a Linux machine but more you upgraded from version X to version Y and that does not work anymore. Am I right saying that?

No the version was not updated. The server was accidentally hard shut down while running the Elastic Stack (Elasticsearch, Logstash, Kibana). Upon powering it back up Elasticsearch produces the error message

I see.

I have no idea. How did you install elasticsearch the first time? Which package did you choose?
Which version it is?

I believe I downloaded the .tar package. I extracted the files to a folder and run the elasticsearch file from the bin folder. I never actually install it as a service for our use case.

We are using version Elastic Stack 6.2.3

That does not sound like a good way to install elasticsearch for something else than development.

May be do it again and try the 6.2.4 (which I don't believe will change anything).

We are still in the development stage of this project. If I may ask, why is this a bad idea?

Also, I upgraded to 6.2.4 and I am still running into the same issue.

Because you probably would like to run it as a service.
So install it with all the builtin startup/stop scripts.
Deb or rpm depending on your system.

I am trying to implement it into my software tree and keep all of the Elastic stack files in one location instead of having them install to predetermined locations.

Can you then just do a simple test?

Download the zip version from https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.4.zip
Unzip it anywhere in a tmp dir
Then just run

bin/elasticsearch

Just ran it and still have the same issue

Can you run:

/opt/cust/suite/javabin/jre/java -version

After talking with someone internal we were able to solve the problem. This is how we did it:

  1. Added /opt/cust/suite/javabin/jre/lib/amd64, where libjli.so is located, to /etc/ld.so.conf.d/java.conf
  2. Ran the command /sbin/ldconfig

@dadoonet You were correct that it was a broken Java. It must have broken in the restart/hard shutdown. Thank you for your help I appreciate it!

1 Like

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