ERROR: Failed to verify bootstrap password when setting built in user's password

I have imported and started Elasticsearch Source Code into an IntelliJ IDEA project. I want to create the password for the built-in users
To enable security, I passed -Dtests.es.xpack.security.enabled=true as a parameter in Gradle command by referring to this answer

  1. I created the elasticsearch.keystore, for that I used this command:

./bin/elasticsearch-keystore create -p

  1. Now to set the built-in users password, I ran the following command

    ./bin/elasticsearch-setup-passwords interactive

But it gives the following error :

        ./elasticsearch-setup-passwords interactive
    Enter password for the elasticsearch keystore :
    Failed to authenticate user 'elastic' against http://127.0.0.1:9200/_security/_authenticate?pretty
    Possible causes include:
     * The password for the 'elastic' user has already been changed on this cluster
     * Your elasticsearch node is running against a different keystore
       This tool used the keystore at /Users/amit.khandelwal/code/elasticsearch/build/testclusters/runTask-0/distro/8.0.0-DEFAULT/config/elasticsearch.keystore
    ERROR: Failed to verify bootstrap password

I referred the following links

Unable to change elastic user password

Elastic-xpack-security

But still, I am not able to resolve this issue. I even asked this question on Stackoverflow, but got no answer.

Can anyone help me resolve this issue?

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