# Error - Failed to set password for user \[apm\_system\]

**URL:** https://discuss.elastic.co/t/error-failed-to-set-password-for-user-apm-system/270252
**Category:** Elasticsearch
**Tags:** elastic-stack-security
**Created:** [April 15, 2021, 2:36pm UTC](https://discuss.elastic.co/t/error-failed-to-set-password-for-user-apm-system/270252 "2021-04-15T14:36:59Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Abhishek\_Pratap\_Sin1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abhishek_pratap_sin1/32/78064_2.png) [@Abhishek\_Pratap\_Sin1](https://discuss.elastic.co/u/Abhishek_Pratap_Sin1)
#### Post date: [April 15, 2021, 2:36pm UTC](https://discuss.elastic.co/t/error-failed-to-set-password-for-user-apm-system/270252/1 "2021-04-15T14:36:59Z")

</div>

I am running Elastic-Search 7.11.1 Basic license

3 master & data nodes.

While I was trying set password for build-in user, not able to set password for apm\_system.

I following steps to set password.  
**Step 1-**  
update some config in elasticsearch.yml

xpack.security.enabled: true  
xpack.security.transport.ssl.enabled: true

**Step2** -run below command  
/usr/share/elasticsearch/bin# ./elasticsearch-setup-passwords interactive

**Step3** -Set the password.

Enter password for [elastic]:  
Reenter password for [elastic]:  
Enter password for [apm\_system]:  
Reenter password for [apm\_system]:  
Enter password for [kibana\_system]:  
Reenter password for [kibana\_system]:  
Enter password for [logstash\_system]:  
Reenter password for [logstash\_system]:  
Enter password for [beats\_system]:  
Reenter password for [beats\_system]:  
Enter password for [remote\_monitoring\_user]:  
Reenter password for [remote\_monitoring\_user]:

**Error**  
Unexpected response code [503] from calling PUT [http://localhost:9200/\_security/user/apm\_system/\_password?pretty](http://localhost:9200/_security/user/apm_system/_password?pretty)  
Cause: Cluster state has not been recovered yet, cannot write to the [null] index  
Possible next steps:

- Try running this tool again.
- Try running with the --verbose parameter for additional messages.
- Check the elasticsearch logs for additional error details.
- Use the change password API manually.  
ERROR: Failed to set password for user [apm\_system].

---

<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: [April 15, 2021, 2:56pm UTC](https://discuss.elastic.co/t/error-failed-to-set-password-for-user-apm-system/270252/2 "2021-04-15T14:56:19Z")

</div>

Welcome!

Please format your code, logs or configuration files using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and not the citation button. It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

This is the icon to use if you are not using markdown format:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/e/7e6e239431ec2d71cbf1beef741f2e93e7cc762c.jpg)

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.  
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.  
Please update your post.

In your post, you did not tell what you did so far and what went wrong.  
Did you follow [the guide](https://www.elastic.co/guide/en/elasticsearch/reference/current/secure-cluster.html)?

---

<div class="post-metadata">

### Author: ![Abhishek\_Pratap\_Sin1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abhishek_pratap_sin1/32/78064_2.png) [@Abhishek\_Pratap\_Sin1](https://discuss.elastic.co/u/Abhishek_Pratap_Sin1)
#### Post date: [April 15, 2021, 3:36pm UTC](https://discuss.elastic.co/t/error-failed-to-set-password-for-user-apm-system/270252/3 "2021-04-15T15:36:58Z")

</div>

Thanks for your guide.

---

<div class="post-metadata">

### Author: ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)
#### Post date: [April 20, 2021, 7:00am UTC](https://discuss.elastic.co/t/error-failed-to-set-password-for-user-apm-system/270252/4 "2021-04-20T07:00:47Z")

</div>

> [@Abhishek\_Pratap\_Sin1](#):
>
> xpack.security.transport.ssl.enabled: true

If you enable TLS for the transport layer you also need to configure it. See [Set up basic security for the Elastic Stack | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-basic-setup.html)

> Unexpected response code [503] from calling PUT [http://localhost:9200/\_security/user/apm\_system/\_password?pretty](http://localhost:9200/_security/user/apm_system/_password?pretty)  
> Cause: Cluster state has not been recovered yet, cannot write to the [null] index

Your cluster has not started successfully ( probably because of the missing configuration above ) so you can't set the password for any users. You first need to fix your configuration and then try to set the passwords, the link I shared will hopefully help you.

---

<div class="post-metadata">

### Author: ![Abhishek\_Pratap\_Sin1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abhishek_pratap_sin1/32/78064_2.png) [@Abhishek\_Pratap\_Sin1](https://discuss.elastic.co/u/Abhishek_Pratap_Sin1)
#### Post date: [April 20, 2021, 10:17am UTC](https://discuss.elastic.co/t/error-failed-to-set-password-for-user-apm-system/270252/5 "2021-04-20T10:17:34Z")

</div>

Hi @ikakavas

Thanks for your update.

The issue got resolve, issue was related to certificate. I have downloaded the  
CA certificate and configure it over the cluster

updated below changes in .YML file.

xpack.security.transport.ssl.enabled: true  
xpack.security.transport.ssl.verification\_mode: certificate  
xpack.security.transport.ssl.keystore.path: path/elastic-certificates.p12  
xpack.security.transport.ssl.truststore.path: path/elastic-certificates.p12

---

<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: [May 18, 2021, 10:18am UTC](https://discuss.elastic.co/t/error-failed-to-set-password-for-user-apm-system/270252/6 "2021-05-18T10:18:09Z")

</div>

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