0

I am installing Elasticsearch 6.6 with Xpack and it is failing on "nativeUser" issue:

  failed: [elasticsearch1] (item=nativeUser) => {
    "changed": false,
    "content": "",
    "invocation": {
        "module_args": {
            "attributes": null,
            "backup": null,
            "body": "{\"password\": \"<****>\", \"roles\": [\"power_user\", \"user\"]}",
            "body_format": "json",
            "client_cert": "",
            "client_key": "",
            "content": null,
            "creates": null,
            "delimiter": null,
            "dest": null,
            "directory_mode": null,
            "follow": false,
            "follow_redirects": "safe",
            "force": false,
            "force_basic_auth": true,
            "group": null,
            "headers": {
                "Content-Type": "application/json"
            },
            "http_agent": "ansible-httpget",
            "method": "POST",
            "mode": null,
            "owner": null,
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "regexp": null,
            "remote_src": null,
            "removes": null,
            "return_content": false,
            "selevel": null,
            "serole": null,
            "setype": null,
            "seuser": null,
            "src": null,
            "status_code": [
                "200"
            ],
            "timeout": 30,
            "unsafe_writes": null,
            "url": "https://<hostname1>:9201/_xpack/security/user/nativeUser",
            "url_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "url_username": "es_admin",
            "use_proxy": true,
            "user": "es_admin",
            "validate_certs": false
        }
    },
    "item": "nativeUser",
    "msg": "Status code was -1 and not [200]: Connection failure: ('The read operation timed out',)",
    "redirected": false,
    "status": -1,
    "url": "https://<hostname1>:9201/_xpack/security/user/nativeUser"
}

I do not understand what is "nativeUser" and how this error can be fixed?

I ran the url with curl and got the following error:

curl -u es_admin:changeMe -X POST "https://illin7040:9201/_xpack/security/user/nativeUser?pretty" -H 'Content-Type: application/json' -d' { "password" : "changeMe", "roles" : [ "admin", "power_user", "user" ], "full_name" : "nativeUser", "email" : null, "metadata" : {"reserved":true},"enabled":true}}' -k


{
  "error" : {
    "root_cause" : [
      {
        "type" : "master_not_discovered_exception",
        "reason" : null
      }
    ],
    "type" : "master_not_discovered_exception",
    "reason" : null
  },
  "status" : 503 
}

All the three nodes in my env are configured as master..

I am new to Ansible and Elasticsearch, any advice would be appreciated. Thanks.

jrz
  • 1,213
  • 4
  • 20
  • 54
  • The error is not about `nativeUser`, the error is that the playbook was unable to read from `` on port 9201; can you reach that URL with `curl`, and/or was this the first time ansible attempted to contact hostname1 on port 9201 or did other tasks succeed and just this one failed? – mdaniel May 27 '20 at 16:02
  • @mdaniel It is not the first time that ansible attemp to contact on port 9201, it was done in the past. I am new to curl as well, which command should I run to reach that URL? – jrz May 31 '20 at 05:37
  • @mdaniel Hi I edited my question with the output when I run the url with Curl – jrz May 31 '20 at 14:50
  • Is that from _your machine_ or from `elasticsearch1`? Because it can work fine from your machine but fail when run from within the playbook since those actions take place on the remote machine. Regardless, the fact that you got back a 503 means even if the playbook could reach port 9201, it wouldn't succeed until you fix the ES problem – mdaniel Jun 01 '20 at 00:49
  • @mdaniel I think it is coming from ES. How can I be sure about that? And I still do not understand what is the "ES problem". Thanks. – jrz Jun 01 '20 at 06:21

0 Answers0