# Cannot Open Shared Object File

**URL:** <https://discuss.elastic.co/t/cannot-open-shared-object-file/134267>\
**Category:** Elasticsearch\
**Created:** [June 1, 2018, 7:40pm UTC](https://discuss.elastic.co/t/cannot-open-shared-object-file/134267 "2018-06-01T19:40:37Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![CDR](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@CDR](https://discuss.elastic.co/u/CDR)\
**Post date:** [June 1, 2018, 7:40pm UTC](https://discuss.elastic.co/t/cannot-open-shared-object-file/134267/1 "2018-06-01T19:40:37Z")

</div>

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

```

---

<div class="post-metadata">

**Author:** ![CDR](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@CDR](https://discuss.elastic.co/u/CDR)\
**Post date:** [June 5, 2018, 2:21pm UTC](https://discuss.elastic.co/t/cannot-open-shared-object-file/134267/2 "2018-06-05T14:21:34Z")

</div>

Does anyone from the Elastic team have any ideas?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 5, 2018, 2:56pm UTC](https://discuss.elastic.co/t/cannot-open-shared-object-file/134267/3 "2018-06-05T14:56:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![CDR](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@CDR](https://discuss.elastic.co/u/CDR)\
**Post date:** [June 6, 2018, 6:25pm UTC](https://discuss.elastic.co/t/cannot-open-shared-object-file/134267/4 "2018-06-06T18:25:38Z")

</div>

> [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!

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 7, 2018, 11:53am UTC](https://discuss.elastic.co/t/cannot-open-shared-object-file/134267/5 "2018-06-07T11:53:38Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![CDR](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@CDR](https://discuss.elastic.co/u/CDR)\
**Post date:** [June 7, 2018, 1:10pm UTC](https://discuss.elastic.co/t/cannot-open-shared-object-file/134267/6 "2018-06-07T13:10:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 7, 2018, 1:53pm UTC](https://discuss.elastic.co/t/cannot-open-shared-object-file/134267/7 "2018-06-07T13:53:38Z")

</div>

I see.

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

---

<div class="post-metadata">

**Author:** ![CDR](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@CDR](https://discuss.elastic.co/u/CDR)\
**Post date:** [June 7, 2018, 2:05pm UTC](https://discuss.elastic.co/t/cannot-open-shared-object-file/134267/8 "2018-06-07T14:05:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 7, 2018, 2:25pm UTC](https://discuss.elastic.co/t/cannot-open-shared-object-file/134267/9 "2018-06-07T14:25:24Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![CDR](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@CDR](https://discuss.elastic.co/u/CDR)\
**Post date:** [June 7, 2018, 2:49pm UTC](https://discuss.elastic.co/t/cannot-open-shared-object-file/134267/10 "2018-06-07T14:49:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 7, 2018, 4:29pm UTC](https://discuss.elastic.co/t/cannot-open-shared-object-file/134267/11 "2018-06-07T16:29:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![CDR](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@CDR](https://discuss.elastic.co/u/CDR)\
**Post date:** [June 7, 2018, 6:39pm UTC](https://discuss.elastic.co/t/cannot-open-shared-object-file/134267/12 "2018-06-07T18:39:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 7, 2018, 7:51pm UTC](https://discuss.elastic.co/t/cannot-open-shared-object-file/134267/13 "2018-06-07T19:51:12Z")

</div>

Can you then just do a simple test?

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

```
bin/elasticsearch
```

---

<div class="post-metadata">

**Author:** ![CDR](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@CDR](https://discuss.elastic.co/u/CDR)\
**Post date:** [June 7, 2018, 8:34pm UTC](https://discuss.elastic.co/t/cannot-open-shared-object-file/134267/14 "2018-06-07T20:34:15Z")

</div>

Just ran it and still have the same issue

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 8, 2018, 4:31am UTC](https://discuss.elastic.co/t/cannot-open-shared-object-file/134267/15 "2018-06-08T04:31:37Z")

</div>

Can you run:

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

---

<div class="post-metadata">

**Author:** ![CDR](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@CDR](https://discuss.elastic.co/u/CDR)\
**Post date:** [June 8, 2018, 5:43pm UTC](https://discuss.elastic.co/t/cannot-open-shared-object-file/134267/16 "2018-06-08T17:43:29Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2018, 5:43pm UTC](https://discuss.elastic.co/t/cannot-open-shared-object-file/134267/17 "2018-07-06T17:43:34Z")

</div>

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