# ERROR: Failed to set password for user \[apm\_system\]

**URL:** <https://discuss.elastic.co/t/error-failed-to-set-password-for-user-apm-system/227172>\
**Category:** Elasticsearch\
**Created:** [April 8, 2020, 4:01pm UTC](https://discuss.elastic.co/t/error-failed-to-set-password-for-user-apm-system/227172 "2020-04-08T16:01:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ludovic9](https://avatars.discourse-cdn.com/v4/letter/l/977dab/32.png) [@Ludovic9](https://discuss.elastic.co/u/Ludovic9)\
**Post date:** [April 8, 2020, 4:01pm UTC](https://discuss.elastic.co/t/error-failed-to-set-password-for-user-apm-system/227172/1 "2020-04-08T16:01:46Z")

</div>

hi,  
I'm trying to setup authentication on my elk stack. I have done a test with my test environnment, it was OK but in production, I can't do the first step.  
I am in 6.8.3 and I have 4 nodes. And basic licence.

I have generate the certificate and copy it on each node.

> ```
> ./elasticsearch-certutil cert -out /etc/elasticsearch/config/cert.p12 -pass ""
> 
> ```

in my yml file, on the master, I have added this :

> ```
> xpack.security.enabled: true
> xpack.security.transport.ssl.enabled: true
> xpack.security.audit.enabled: true
> xpack.security.authc.realms.native.type: native
>   
> xpack.security.transport.ssl.verification_mode: certificate
> xpack.security.transport.ssl.keystore.path: /etc/elasticsearch/config/cert.p12
> 
> ```
> 
> xpack.security.transport.ssl.truststore.path: /etc/elasticsearch/config/cert.p12

then I have restart this node.

I done this following command to generate the passwords :

> ./elasticsearch-setup-passwords interactive

But at the end, I have an error :

> Unexpected response code [503] from calling PUT [http://172.21.2.69:9200/\_xpack/security/user/apm\_system/\_password?pretty](http://172.21.2.69:9200/_xpack/security/user/apm_system/_password?pretty)  
> Cause: Cluster state has not been recovered yet, cannot write to the security 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].

Where is my mistake ? Do I have ro restart each node ?

Thank you for your replies.

---

<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 6, 2020, 4:01pm UTC](https://discuss.elastic.co/t/error-failed-to-set-password-for-user-apm-system/227172/2 "2020-05-06T16:01:54Z")

</div>

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