# Got response code '401' contacting Elasticsearch at URL

**URL:** https://discuss.elastic.co/t/got-response-code-401-contacting-elasticsearch-at-url/100548
**Category:** Elasticsearch
**Created:** [September 14, 2017, 1:50pm UTC](https://discuss.elastic.co/t/got-response-code-401-contacting-elasticsearch-at-url/100548 "2017-09-14T13:50:53Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Maekee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maekee/32/21708_2.png) [@Maekee](https://discuss.elastic.co/u/Maekee)
#### Post date: [September 14, 2017, 1:50pm UTC](https://discuss.elastic.co/t/got-response-code-401-contacting-elasticsearch-at-url/100548/1 "2017-09-14T13:50:53Z")

</div>

Hi,  
Probably something easy, but i'll try anyway.  
I had a working ELK-machine running 5.5.2, then i decided to upgrade to 5.6.0 and install X-pack at the same time.

I did the following:

- upgraded ES, installed X-pack
- upgraded kibana, installed X-pack
- Added the free license key
- upgraded Logstash, installed x-pack

Now when the services are running i get these errors on the machine running E+L+K

[2017-09-14T15:44:20,773][WARN][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=\>"[http://logstash\_system:xxxxxx@localhost:9200/](http://logstash_system:xxxxxx@localhost:9200/)", :error\_type=\>LogStash::Outputs::ElasticSearch::  
HttpClient::Pool::BadResponseCodeError, :error=\>"Got response code '401' contacting Elasticsearch at URL '[http://localhost:9200/](http://localhost:9200/)'"}

Have tried the reserved logstash\_system user, a superuser and also created a new logstash\_user with permissions from point 1 here: [https://www.elastic.co/guide/en/x-pack/current/logstash.html](https://www.elastic.co/guide/en/x-pack/current/logstash.html)

This is my logstash.json output:  
output {  
elasticsearch {  
hosts =\> "localhost:9200"  
manage\_template =\> false  
user =\> logstash\_user  
password =\> logstashpassword  
index =\> "%{[@metadata][beat]}-%{+YYYY.MM.dd}"  
document\_type =\> "%{[@metadata][type]}"  
}  
}

But the errors are still there.. dont really know where i should go next.

Thanks

/Micke

---

<div class="post-metadata">

### Author: ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)
#### Post date: [September 14, 2017, 8:20pm UTC](https://discuss.elastic.co/t/got-response-code-401-contacting-elasticsearch-at-url/100548/2 "2017-09-14T20:20:02Z")

</div>

Have you looked at [https://www.elastic.co/guide/en/x-pack/current/security-getting-started.html](https://www.elastic.co/guide/en/x-pack/current/security-getting-started.html) and [https://www.elastic.co/guide/en/x-pack/current/setting-up-authentication.html](https://www.elastic.co/guide/en/x-pack/current/setting-up-authentication.html)?

---

<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: [September 15, 2017, 4:35am UTC](https://discuss.elastic.co/t/got-response-code-401-contacting-elasticsearch-at-url/100548/3 "2017-09-15T04:35:43Z")

</div>

> Added the free license key

Can you clarify this?

If you are using the free _Basic_ license type, then it doesn't include support for X-Pack security.  
That shouldn't be causing the errors you're seeing - in fact quite the opposite - but it does suggest that there might be something more complex going on under the covers.

---

<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: [October 13, 2017, 4:38am UTC](https://discuss.elastic.co/t/got-response-code-401-contacting-elasticsearch-at-url/100548/4 "2017-10-13T04:38:06Z")

</div>

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