# Kibana v7.4.0 issues with xpack security roles

**URL:** https://discuss.elastic.co/t/kibana-v7-4-0-issues-with-xpack-security-roles/216352
**Category:** Kibana
**Created:** [January 24, 2020, 3:43am UTC](https://discuss.elastic.co/t/kibana-v7-4-0-issues-with-xpack-security-roles/216352 "2020-01-24T03:43:49Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Mehak\_Bhargava](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mehak_bhargava/32/54750_2.png) [@Mehak\_Bhargava](https://discuss.elastic.co/u/Mehak_Bhargava)
#### Post date: [January 24, 2020, 3:43am UTC](https://discuss.elastic.co/t/kibana-v7-4-0-issues-with-xpack-security-roles/216352/1 "2020-01-24T03:43:49Z")

</div>

I have basic license and I added this in elasticsearch.yml as

```auto
xpack.security.enabled: true
discovery.type: single-node

```

But when I restart the three services- Elastic, logstash, kibana I have these as last looping logs. So what am I doing wrong?

```auto
[2020-01-23T19:38:47,264][INFO][o.e.c.r.a.AllocationService] [mehak-VirtualBox] Cluster health status changed from [RED] to [YELLOW] (reason: [shards started [[mehak][0]]]).

```

```auto
[2020-01-23T19:41:14,547][WARN][logstash.outputs.elasticsearch][main] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>"http://localhost:9200/", :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError, :error=>"Got response code '401' contacting Elasticsearch at URL 'http://localhost:9200/'"}

```

```auto
log [03:41:18.861] [warning][license][xpack] License information from the X-Pack plugin could not be obtained from Elasticsearch for the [data] cluster. [security_exception] missing authentication credentials for REST request [/_xpack], with { header={ WWW-Authenticate="Basic realm=\"security\" charset=\"UTF-8\"" } } :: {"path":"/_xpack","statusCode":401,"response":"{\"error\":{\"root_cause\":[{\"type\":\"security_exception\",\"reason\":\"missing authentication credentials for REST request [/_xpack]\",\"header\":{\"WWW-Authenticate\":\"Basic realm=\\\"security\\\" charset=\\\"UTF-8\\\"\"}}],\"type\":\"security_exception\",\"reason\":\"missing authentication credentials for REST request [/_xpack]\",\"header\":{\"WWW-Authenticate\":\"Basic realm=\\\"security\\\" charset=\\\"UTF-8\\\"\"}},\"status\":401}","wwwAuthenticateDirective":"Basic realm=\"security\" charset=\"UTF-8\""}

```

---

<div class="post-metadata">

### Author: ![angelo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/angelo/32/61325_2.png) [@angelo](https://discuss.elastic.co/u/angelo)
#### Post date: [January 24, 2020, 4:00am UTC](https://discuss.elastic.co/t/kibana-v7-4-0-issues-with-xpack-security-roles/216352/2 "2020-01-24T04:00:55Z")

</div>

The first message is simply because you have a single ES node and your index `mehak` is most likely setup with a replica and there are no other nodes to host them.

The 401 status indicates that the connections from Logstash and Kibana are unauthorized. Since you have enabled security, you will need to passwords for the different usernames with the `elasticsearch-setup-passwords` [command](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/setup-passwords.html). You can specify your own passwords using interactive option or let it choose for you via the auto option (please take note of them if you use the auto option). Once this is done, you can configure Logstash and Kibana with the appropriate auth information and they should be able to connect.

---

<div class="post-metadata">

### Author: ![Mehak\_Bhargava](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mehak_bhargava/32/54750_2.png) [@Mehak\_Bhargava](https://discuss.elastic.co/u/Mehak_Bhargava)
#### Post date: [January 24, 2020, 4:12am UTC](https://discuss.elastic.co/t/kibana-v7-4-0-issues-with-xpack-security-roles/216352/3 "2020-01-24T04:12:44Z")

</div>

@angelo, Thanks for responding.

Do I have to fix this replica index node to go through with setting roles in Kibana?

So while elastic, logstash, kibana are closed, I change the elasticsearch.yml file, and then I should just do the password setups and then start Elasticsearch, logstash, kibana? Or should I keep it running in background?  
Basically to I keep the three running during setting password users or stop them until I set them?

---

<div class="post-metadata">

### Author: ![angelo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/angelo/32/61325_2.png) [@angelo](https://discuss.elastic.co/u/angelo)
#### Post date: [January 24, 2020, 4:20am UTC](https://discuss.elastic.co/t/kibana-v7-4-0-issues-with-xpack-security-roles/216352/4 "2020-01-24T04:20:37Z")

</div>

> Do I have to fix this replica index node to go through with setting roles in Kibana?

If you only plan on using a single node, you could simply set the number of replicas to 0 to avoid ES continuing to log message like that and allow the cluster to report a 'GREEN' status.

> So while elastic, logstash, kibana are closed, I change the elasticsearch.yml file, and then I should just do the password setups and then start Elasticsearch, logstash, kibana? Or should I keep it running in background?  
> Basically to I keep the three running during setting password users or stop them until I set them?

You will need to have ES running when you run the `elasticsearch-setup-passwords` command so that it can store the passwords. You will then need to set the username/password in Logstash for the elasticsearch output configuration in your pipeline and for Kibana in the kibana.yml file. These 2 will have to be (re)started to pick up the new auth information.

---

<div class="post-metadata">

### Author: ![Mehak\_Bhargava](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mehak_bhargava/32/54750_2.png) [@Mehak\_Bhargava](https://discuss.elastic.co/u/Mehak_Bhargava)
#### Post date: [January 24, 2020, 4:26am UTC](https://discuss.elastic.co/t/kibana-v7-4-0-issues-with-xpack-security-roles/216352/5 "2020-01-24T04:26:17Z")

</div>

> [@angelo](#):
>
> set the number of replicas to 0

Where would I do that? in elasticsearch.yml? or in kibana dev tools. And is below the correct comand

```auto
PUT /_settings
{
"index" : {
"number_of_replicas":0
}
}

```

> [@angelo](#):
>
> elasticsearch-setup-passwords

This command doesnt have to be ran inside elasticsearch, right?

> [@angelo](#):
>
> Kibana in the kibana.yml

Where should the username/pwd be set in this file? This is the file content right now of kibana.yml

```auto
server.port: 5601
server.host: "0.0.0.0" 
elasticsearch.hosts: [http://localhost:9200"]

```

---

<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: [February 21, 2020, 4:26am UTC](https://discuss.elastic.co/t/kibana-v7-4-0-issues-with-xpack-security-roles/216352/6 "2020-02-21T04:26:18Z")

</div>

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