# Logstash.service unable to access Keystore

**URL:** <https://discuss.elastic.co/t/logstash-service-unable-to-access-keystore/353628>\
**Category:** Logstash\
**Created:** [February 19, 2024, 5:20pm UTC](https://discuss.elastic.co/t/logstash-service-unable-to-access-keystore/353628 "2024-02-19T17:20:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![marmai16](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@marmai16](https://discuss.elastic.co/u/marmai16)\
**Post date:** [February 19, 2024, 5:20pm UTC](https://discuss.elastic.co/t/logstash-service-unable-to-access-keystore/353628/1 "2024-02-19T17:20:45Z")

</div>

Hello everyone,

while trying to setup a test Logstash instance, i struggle to get it running.  
The following error appears, viewable via journalctl:

`ERROR: Failed to load settings file from "path.settings". Aborting... path.setting=/etc/logstash, exception=Java::OrgLogstashSecretStore::SecretStoreException::AccessException, message=>Can not access Logstash keystore at /etc/logstash/logstash.keystore. Please verify correct file permissions and keystore password.`

I already went through the available topics here and other resources dealing with the same issue, which unfortunately did not help to resolve the issue.

The interesting aspect is that even when the keystore is **password-less** and with most open permissions, the error remains.

SSL communication to elasticsearch is intended, certs are in the correct place, relevant passwords are in the keystore and the logstash.yml is adjusted accordingly.

Maybe someone can help out. Thank you all!

---

<div class="post-metadata">

**Author:** ![intrepid1](https://avatars.discourse-cdn.com/v4/letter/i/dbc845/32.png) [@intrepid1](https://discuss.elastic.co/u/intrepid1)\
**Post date:** [February 19, 2024, 6:08pm UTC](https://discuss.elastic.co/t/logstash-service-unable-to-access-keystore/353628/2 "2024-02-19T18:08:17Z")

</div>

Hi there,

In the past I have had issues with keystores and the reason for this was that I wasn't specifying the path.settings when it was created.

Did you specify this when you created the keystore?

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [February 20, 2024, 5:49am UTC](https://discuss.elastic.co/t/logstash-service-unable-to-access-keystore/353628/3 "2024-02-20T05:49:46Z")

</div>

The user doesn't have permissions to path.setting= **/etc/logstash**  
How do you run LS, as a process or as a systemctl service?

---

<div class="post-metadata">

**Author:** ![marmai16](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@marmai16](https://discuss.elastic.co/u/marmai16)\
**Post date:** [February 20, 2024, 8:30am UTC](https://discuss.elastic.co/t/logstash-service-unable-to-access-keystore/353628/4 "2024-02-20T08:30:39Z")

</div>

I provided the path.settings while creating the keystore.  
The keystore was generated with the following command:

`sudo -E /usr/share/logstash/bin/logstash-keystore --path.settings /etc/logstash create`

Still, thank you!

---

<div class="post-metadata">

**Author:** ![marmai16](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@marmai16](https://discuss.elastic.co/u/marmai16)\
**Post date:** [February 20, 2024, 8:36am UTC](https://discuss.elastic.co/t/logstash-service-unable-to-access-keystore/353628/5 "2024-02-20T08:36:14Z")

</div>

I'm running LS as a systemctl service which is launched via sudo.

---

<div class="post-metadata">

**Author:** ![intrepid1](https://avatars.discourse-cdn.com/v4/letter/i/dbc845/32.png) [@intrepid1](https://discuss.elastic.co/u/intrepid1)\
**Post date:** [February 20, 2024, 9:00am UTC](https://discuss.elastic.co/t/logstash-service-unable-to-access-keystore/353628/6 "2024-02-20T09:00:53Z")

</div>

Hi there,

One other point. When adding passwords, remember to add the path to settings to the command.

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [February 20, 2024, 11:46am UTC](https://discuss.elastic.co/t/logstash-service-unable-to-access-keystore/353628/7 "2024-02-20T11:46:43Z")

</div>

The most likely your OS and user accounts have restrictions.  
The /etc/logstash/ is normally owned by root:root. Additionally, systemctl run LS as the "logstash" user which reads config path -\> /etc/logstash/.

1. Check permissions on the config directory and logstash.keystore
2. If 1. doesn't work, test purpose set different user in: /usr/lib/systemd/system/logstash.service and run the service again.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [February 20, 2024, 11:48am UTC](https://discuss.elastic.co/t/logstash-service-unable-to-access-keystore/353628/8 "2024-02-20T11:48:06Z")

</div>

> [@marmai16](#):
>
> sudo -E /usr/share/logstash/bin/logstash-keystore --path.settings /etc/logstash create

Are you running logstash as a service?

The logstash service runs with the `logstash` user, you need to make share that this user can read the permissions of the `logstash.keystore` file.

What are the permissions for this file?

---

<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 19, 2024, 11:48am UTC](https://discuss.elastic.co/t/logstash-service-unable-to-access-keystore/353628/9 "2024-03-19T11:48:33Z")

</div>

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