# Connection error to a secured Elasticsearch: unable to authenticate user

**URL:** <https://discuss.elastic.co/t/connection-error-to-a-secured-elasticsearch-unable-to-authenticate-user/264919>\
**Category:** Elasticsearch\
**Tags:** rally\
**Created:** [February 19, 2021, 10:46pm UTC](https://discuss.elastic.co/t/connection-error-to-a-secured-elasticsearch-unable-to-authenticate-user/264919 "2021-02-19T22:46:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![oferbar00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/oferbar00/32/95837_2.png) [@oferbar00](https://discuss.elastic.co/u/oferbar00)\
**Post date:** [February 19, 2021, 10:46pm UTC](https://discuss.elastic.co/t/connection-error-to-a-secured-elasticsearch-unable-to-authenticate-user/264919/1 "2021-02-19T22:46:18Z")

</div>

Hello,

I am trying to create a track from an Elasticsearch node (v7.5.2) that is running on a Windows server 2019 VM and using TLS with basic authentication.

From the rally (v2.0.4) machine I am able to curl to it just fine:

```
curl -k -H "Authorization:Basic ###############" https://elastic_vm:9200

```

However, when trying to create a track:

```
esrally create-track --track=my_track--target-host=elastic_vm:9200 --client-options="use_ssl:true,verify_certs:false,basic_auth_user:'user',basic_auth_password:'password',http_compress:true"

```

I get the error:

```
[ERROR] Cannot create-track. AuthenticationException(401, 'security_exception', 'unable to authenticate user [user] for REST request [/]').

```

What am I still missing?

Thanks!

---

<div class="post-metadata">

**Author:** ![Wolfram\_Haussig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfram_haussig/32/70528_2.png) [@Wolfram\_Haussig](https://discuss.elastic.co/u/Wolfram_Haussig)\
**Post date:** [February 20, 2021, 7:16am UTC](https://discuss.elastic.co/t/connection-error-to-a-secured-elasticsearch-unable-to-authenticate-user/264919/2 "2021-02-20T07:16:44Z")

</div>

Hi,

I think esrally is trying to ping your elasticsearch host by calling https://elastic\_vm:9200 . If you have enabled security accessing / requires monitor privileges ( I had the same problem with the .NET NEST client).

Options:

1. Grant your user monitor privileges (at least `cluster:monitor/main`)
2. check if you can disable the ping for esrally

Best regards  
Wolfram

---

<div class="post-metadata">

**Author:** ![oferbar00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/oferbar00/32/95837_2.png) [@oferbar00](https://discuss.elastic.co/u/oferbar00)\
**Post date:** [February 20, 2021, 9:42pm UTC](https://discuss.elastic.co/t/connection-error-to-a-secured-elasticsearch-unable-to-authenticate-user/264919/3 "2021-02-20T21:42:07Z")

</div>

Hi,

Thanks for responding!

I did check the security of the user and it has the 'superuser' role, which includes all access to the cluster.  
Regarding esrally ping, I wasn't able to find any reference to that, maybe they use a different term?

Unfortunately, the logs display the same error that I included in this post, so not much help there, unless there is some debug output that can enabled?

Thank you!

---

<div class="post-metadata">

**Author:** ![Wolfram\_Haussig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfram_haussig/32/70528_2.png) [@Wolfram\_Haussig](https://discuss.elastic.co/u/Wolfram_Haussig)\
**Post date:** [February 21, 2021, 5:26am UTC](https://discuss.elastic.co/t/connection-error-to-a-secured-elasticsearch-unable-to-authenticate-user/264919/4 "2021-02-21T05:26:31Z")

</div>

Hi,

This sounds like there is a problem with the esrally configuration and I have no experience with that. I checked the documentation of esrally and found the following hint:

> Avoid the characters `'` , `,` and `:` in user name and password as Rally’s parsing of these options is currently really simple and there is no possibility to escape characters.

Can you check your user and password for this characters?

If this doesn't help maybe you should create an issue with esrally as it does not seem to be an Elasticsearch problem as you can login using curl.

Best regards  
Wolfram

---

<div class="post-metadata">

**Author:** ![oferbar00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/oferbar00/32/95837_2.png) [@oferbar00](https://discuss.elastic.co/u/oferbar00)\
**Post date:** [February 21, 2021, 4:07pm UTC](https://discuss.elastic.co/t/connection-error-to-a-secured-elasticsearch-unable-to-authenticate-user/264919/5 "2021-02-21T16:07:24Z")

</div>

Hi,  
Yes, I already verified those characters and they are not part of the user name or password.  
There is also an issue opened with ES support and I'm waiting for a reply.

Thanks

---

<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:** [March 21, 2021, 4:08pm UTC](https://discuss.elastic.co/t/connection-error-to-a-secured-elasticsearch-unable-to-authenticate-user/264919/6 "2021-03-21T16:08:22Z")

</div>

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