# Security\_exception: unable to authenticate user \[me\] for REST request \[/\_nodes?filter\_path=nodes.\*.version%2Cnodes.\*.http.publish\_address%2Cnodes.\*.ip\]

**URL:** <https://discuss.elastic.co/t/security-exception-unable-to-authenticate-user-me-for-rest-request-nodes-filter-path-nodes-version-2cnodes-http-publish-address-2cnodes-ip/358442>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [April 29, 2024, 3:51pm UTC](https://discuss.elastic.co/t/security-exception-unable-to-authenticate-user-me-for-rest-request-nodes-filter-path-nodes-version-2cnodes-http-publish-address-2cnodes-ip/358442 "2024-04-29T15:51:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![clarac1996](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/clarac1996/32/133968_2.png) [@clarac1996](https://discuss.elastic.co/u/clarac1996)\
**Post date:** [April 29, 2024, 3:51pm UTC](https://discuss.elastic.co/t/security-exception-unable-to-authenticate-user-me-for-rest-request-nodes-filter-path-nodes-version-2cnodes-http-publish-address-2cnodes-ip/358442/1 "2024-04-29T15:51:19Z")

</div>

Hello! I really need some help, been struggling with this.  
I am trying to set up Kibana and Elasticsearch using docker-compose, and I have already generated a service account user (left it as my name clara), but the kibana service fails to set up. I read that the service account user is not the same as the user using the kibana UI and I tried setting up another user with the `kibana_user` roles but it has failed.

Could someone please help!

Here is my whole docker-compose file. I am using 8.13 as the stack version.  
Is it correct to say that Elasticsearch password and Elasticsearch username comes from the service account?

Thank you so much!

```auto
version: "3.8"
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION}
    container_name: elasticsearch
    volumes:
      - elasticsearch_data:/usr/share/elasticsearch/data
    expose:
      - 9200
    ports:
      - "9200:9200"
    environment:
      - "ES_JAVA_OPTS=-Xms2g -Xmx2g"
      - discovery.type=single-node
      - node.store.allow_mmap=false
      - xpack.security.enabled=true
      - ELASTIC_PASSWORD=${ELASTIC_PASSWORD}

  kibana:
    image: docker.elastic.co/kibana/kibana:${STACK_VERSION}
    container_name: kibana
    volumes:
      - kibana_data:/usr/share/kibana/data
    ports:
      - "5601:5601"
    environment:
      - discovery.type=single-node
      - ELASTICSEARCH_USERNAME=${ELASTICSEARCH_USERNAME}
      - ELASTICSEARCH_PASSWORD=${ELASTICSEARCH_PASSWORD}

volumes:
  elasticsearch_data:
  kibana_data:

```

---

<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 29, 2024, 4:54pm UTC](https://discuss.elastic.co/t/security-exception-unable-to-authenticate-user-me-for-rest-request-nodes-filter-path-nodes-version-2cnodes-http-publish-address-2cnodes-ip/358442/2 "2024-04-29T16:54:34Z")

</div>

Welcome!

You might be missing the certificates for example. But we could know more if you share the logs.

There is a 8.13 `docker-compose.yml` example here: [elasticsearch/docs/reference/setup/install/docker/docker-compose.yml at 8.13 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/blob/8.13/docs/reference/setup/install/docker/docker-compose.yml)

And the `.env` file: [elasticsearch/docs/reference/setup/install/docker/.env at 8.13 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/blob/8.13/docs/reference/setup/install/docker/.env)

---

<div class="post-metadata">

**Author:** ![clarac1996](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/clarac1996/32/133968_2.png) [@clarac1996](https://discuss.elastic.co/u/clarac1996)\
**Post date:** [April 29, 2024, 5:11pm UTC](https://discuss.elastic.co/t/security-exception-unable-to-authenticate-user-me-for-rest-request-nodes-filter-path-nodes-version-2cnodes-http-publish-address-2cnodes-ip/358442/3 "2024-04-29T17:11:19Z")

</div>

Hello! Thank you for your help!  
I am trying to set this up without TLS certs as I do not need that additional security.

This is the error that I keep getting:

```auto
2024-04-30 01:09:22 kibana | [2024-04-29T17:09:22.007+00:00][INFO][plugins.assetManager] Server is NOT enabled
2024-04-30 01:09:22 kibana | [2024-04-29T17:09:22.827+00:00][ERROR][elasticsearch-service] Unable to retrieve version information from Elasticsearch nodes. security_exception
2024-04-30 01:09:22 kibana | Root causes:
2024-04-30 01:09:22 kibana | security_exception: unable to authenticate user [clara] for REST request [/_nodes?filter_path=nodes.*.version%2Cnodes.*.http.publish_address%2Cnodes.*.ip]
2024-04-30 01:09:25 kibana | [2024-04-29T17:09:25.246+00:00][INFO][plugins.screenshotting.chromium] Browser executable: /usr/share/kibana/node_modules/@kbn/screenshotting-

```

`clara` is the name of the service account i created for Elasticsearch to connect with kibana. But I cannot access the UI on localhost:5601

---

<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 29, 2024, 7:13pm UTC](https://discuss.elastic.co/t/security-exception-unable-to-authenticate-user-me-for-rest-request-nodes-filter-path-nodes-version-2cnodes-http-publish-address-2cnodes-ip/358442/4 "2024-04-29T19:13:02Z")

</div>

How did you create this account? What are the privileges/roles you gave to it?

---

<div class="post-metadata">

**Author:** ![clarac1996](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/clarac1996/32/133968_2.png) [@clarac1996](https://discuss.elastic.co/u/clarac1996)\
**Post date:** [April 29, 2024, 9:20pm UTC](https://discuss.elastic.co/t/security-exception-unable-to-authenticate-user-me-for-rest-request-nodes-filter-path-nodes-version-2cnodes-http-publish-address-2cnodes-ip/358442/5 "2024-04-29T21:20:59Z")

</div>

Do you mean my service account? I spun up the elastic container, and then went into the elastic container and executed this command:

`curl -X POST -u elastic:my_password "http://localhost:9200/_security/service/elastic/kibana/credential/token/clara?pretty"`

And this was the output printed in the console for me:

```auto
{
  "created" : true,
  "token" : {
    "name" : "clara",
    "value" : "XXXX"
  }
}

```

I then used replace this password in my docker-compose env file `ELASTICSEARCH_PASSWORD`. Then i restarted the kibana container.

What did I do wrong?

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [April 30, 2024, 2:43am UTC](https://discuss.elastic.co/t/security-exception-unable-to-authenticate-user-me-for-rest-request-nodes-filter-path-nodes-version-2cnodes-http-publish-address-2cnodes-ip/358442/6 "2024-04-30T02:43:21Z")

</div>

There's been some mixup in terminology here.

What you created was a _service token_ for the builtin `elastic/kibana` service account.

That means:

- you didn't actually create a new user or service account (nor should you have, what you did was correct)
- you didn't create a "password" - a service token fills the same role as a password, but it is not the same as a password.

Consequently this:

```auto
      - ELASTICSEARCH_USERNAME=${ELASTICSEARCH_USERNAME}
      - ELASTICSEARCH_PASSWORD=${ELASTICSEARCH_PASSWORD}

```

is not going to be correct because `clara` is not a username and the token is not a password.

What you want instead is (I think - _you might need to ask in the Kibana forum if this doesn't work_)

```auto
      - ELASTICSEARCH_SERVICEACCOUNTTOKEN=${ENV_WITH_THE_TOKEN_VALUE}

```

---

<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 28, 2024, 2:44am UTC](https://discuss.elastic.co/t/security-exception-unable-to-authenticate-user-me-for-rest-request-nodes-filter-path-nodes-version-2cnodes-http-publish-address-2cnodes-ip/358442/7 "2024-05-28T02:44:17Z")

</div>

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