# Logstash is failing with file not found - 'cat JDK\_VERSION' when "LS\_JAVA\_HOME" is set

**URL:** <https://discuss.elastic.co/t/logstash-is-failing-with-file-not-found-cat-jdk-version-when-ls-java-home-is-set/326407>\
**Category:** Logstash\
**Tags:** docker\
**Created:** [February 24, 2023, 7:05am UTC](https://discuss.elastic.co/t/logstash-is-failing-with-file-not-found-cat-jdk-version-when-ls-java-home-is-set/326407 "2023-02-24T07:05:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![skumarp7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/skumarp7/32/108230_2.png) [@skumarp7](https://discuss.elastic.co/u/skumarp7)\
**Post date:** [February 24, 2023, 7:05am UTC](https://discuss.elastic.co/t/logstash-is-failing-with-file-not-found-cat-jdk-version-when-ls-java-home-is-set/326407/1 "2023-02-24T07:05:25Z")

</div>

Hi,

Logstash RPM used: 8.6.1

We have built a docker image with the logstash rpm and running the container in our kubernetes cluster

We are exporting LS\_JAVA\_HOME env in the container to the jdk already installed as a part of our java image and we are not using the bundled JDK. As a result the logstash is failing with file not found for 'cat JDK\_VERSION'.

 ![Capture](https://us1.discourse-cdn.com/elastic/original/3X/4/d/4d42416d07b5f48b15a315317f703cb8e2d30024.png)

Source code for which it is failing:

 ![Capture](https://us1.discourse-cdn.com/elastic/original/3X/9/5/9517ad3c4b01fa81562c421d67b6ddd84bbb6a2d.png)

We found that this JDK\_VERSION file is present in /usr/share/logstash but the working directory was still pointing to '/'. Hence we have set the working directory to /usr/share/logstash and also the LOGSTASH\_HOME as 'usr/share/logstash'.

Is it advised to do set these values for LOGSTASH\_HOME and workingdir ?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [February 24, 2023, 5:23pm UTC](https://discuss.elastic.co/t/logstash-is-failing-with-file-not-found-cat-jdk-version-when-ls-java-home-is-set/326407/2 "2023-02-24T17:23:47Z")

</div>

Not sure what the advised workaround is, but I note that a [PR](https://github.com/elastic/logstash/pull/14797) to fix this was merged last month.

---

<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:** [March 24, 2023, 5:24pm UTC](https://discuss.elastic.co/t/logstash-is-failing-with-file-not-found-cat-jdk-version-when-ls-java-home-is-set/326407/3 "2023-03-24T17:24:35Z")

</div>

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