# Cannot start Metricbeat after adding keystore secret

**URL:** https://discuss.elastic.co/t/cannot-start-metricbeat-after-adding-keystore-secret/286703
**Category:** Beats
**Tags:** metricbeat
**Created:** [October 14, 2021, 9:46am UTC](https://discuss.elastic.co/t/cannot-start-metricbeat-after-adding-keystore-secret/286703 "2021-10-14T09:46:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rubic](https://avatars.discourse-cdn.com/v4/letter/r/ec9cab/32.png) [@rubic](https://discuss.elastic.co/u/rubic)
#### Post date: [October 14, 2021, 9:46am UTC](https://discuss.elastic.co/t/cannot-start-metricbeat-after-adding-keystore-secret/286703/1 "2021-10-14T09:46:39Z")

</div>

Hi,  
I have added a secret from newly created keystore and after this operation mb service is failing to start. I wanted to use only one secret on field, specified in output.kafka:

```auto
    key_passphrase: "${my_secret_pass_phrase}"

```

service starts without any problems with pass phrase defined in plain text.

After trying to start service from cmd, I got following error:

```auto
Exiting: error initializing publisher: 1 error: no PEM blocks C:/metricbeat-7.13.3-windows-x86_64/module/windows/cer/output-kafka-dev-key.key

```

as mentioned above all certs are in place, service is running fine with pass phrase specified in plain text, keystore and secrets are created as well.

Any suggestions would be appreciated.

---

<div class="post-metadata">

### Author: ![rubic](https://avatars.discourse-cdn.com/v4/letter/r/ec9cab/32.png) [@rubic](https://discuss.elastic.co/u/rubic)
#### Post date: [October 19, 2021, 1:18pm UTC](https://discuss.elastic.co/t/cannot-start-metricbeat-after-adding-keystore-secret/286703/2 "2021-10-19T13:18:44Z")

</div>

Ok, looks like problem has been solved.  
By following instructions from this site:

> **[Secrets keystore for secure settings | Metricbeat Reference \[7.15\] | Elastic](https://www.elastic.co/guide/en/beats/metricbeat/current/keystore.html)**

Keystore is being installed in data folder, of metricbeat home dir. However, if you have installed your service using included PS script (Windows), than by default data path is set to other location. That is why service cannot find keystore.  
It would be great if this info could be included into official documentation.

---

<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: [November 16, 2021, 3:18pm UTC](https://discuss.elastic.co/t/cannot-start-metricbeat-after-adding-keystore-secret/286703/3 "2021-11-16T15:18:52Z")

</div>

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