Error - Failed to set password for user [apm_system]

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
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].

Welcome!

Please format your code, logs or configuration files using </> icon as explained in this guide 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:

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?

Thanks for your guide.

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

Unexpected response code [503] from calling PUT 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.

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

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