# Can't delete index by "curl -XDELETE" with Xpack security enabled "failed to authenticate user \[elastic\]"

**URL:** <https://discuss.elastic.co/t/cant-delete-index-by-curl-xdelete-with-xpack-security-enabled-failed-to-authenticate-user-elastic/234902>\
**Category:** Elasticsearch\
**Created:** [May 29, 2020, 10:32am UTC](https://discuss.elastic.co/t/cant-delete-index-by-curl-xdelete-with-xpack-security-enabled-failed-to-authenticate-user-elastic/234902 "2020-05-29T10:32:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zav](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zav/32/46385_2.png) [@zav](https://discuss.elastic.co/u/zav)\
**Post date:** [May 29, 2020, 10:32am UTC](https://discuss.elastic.co/t/cant-delete-index-by-curl-xdelete-with-xpack-security-enabled-failed-to-authenticate-user-elastic/234902/1 "2020-05-29T10:32:25Z")

</div>

Hi! I'm new in Elastic, and can miss something. Can anyone help me?  
I have single node cluster with Xpack security enabled.

I can get cluster health

```auto
# curl --user elastic:passwd http://127.0.0.1:9200/_cluster/health?pretty
{
  "cluster_name" : "docker-cluster",
  "status" : "yellow",
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 9,
  "active_shards" : 9,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 1,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 90.0
}

```

I can view indexes

```auto
# curl --user elastic:passwd http://127.0.0.1:9200/_cat/indices?v
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open .security-7 NtHhN8k4QnWF0P8QDUZLqQ 1 0 42 1 87.9kb 87.9kb
green open .monitoring-es-7-2020.05.29 2svVwBPyQKWSJ2CreFvZAQ 1 0 7346 5457 4.5mb 4.5mb
green open .apm-custom-link bd1Dm5laT7mSC1NjtDwkkg 1 0 0 0 208b 208b
green open .kibana_task_manager_1 4ftH2wOiRquWq8w_NIoWVA 1 0 5 0 69.8kb 69.8kb
green open .apm-agent-configuration yyR7dCr2RtykuOhswUIw3Q 1 0 0 0 208b 208b
yellow open filebeat-7.7.0-2020.05.28-000001 aIZgukKqTnivjLdWt6KtYA 1 1 200 0 231.4kb 231.4kb
green open .kibana_1 dNdySKVpQCWswPkBYWU52w 1 0 30 1 61.8kb 61.8kb
green open .monitoring-kibana-7-2020.05.29 gnrMXl8MS6aFysPchh1DAg 1 0 141 0 133.3kb 133.3kb

```

But i can't delete index

```auto
# curl --user elastic:passwd -XDELETE http://127.0.0.1:9200/filebeat-7.7.0-2020.05.28-000001
{"error":{"root_cause":[{"type":"security_exception","reason":"failed to authenticate user [elastic]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}}],"type":"security_exception","reason":"failed to authenticate user [elastic]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}},"status":401}

```

What's wrong ?

---

<div class="post-metadata">

**Author:** ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)\
**Post date:** [June 2, 2020, 8:48am UTC](https://discuss.elastic.co/t/cant-delete-index-by-curl-xdelete-with-xpack-security-enabled-failed-to-authenticate-user-elastic/234902/2 "2020-06-02T08:48:37Z")

</div>

> [@zav](#):
>
> `elastic:passwd`

You get a 401 which means we couldn't authenticate the user `elastic`. Is that password correct ( and the same you use above? ) ? Is there anything printed in the logs at that time ?

---

<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:** [June 30, 2020, 8:48am UTC](https://discuss.elastic.co/t/cant-delete-index-by-curl-xdelete-with-xpack-security-enabled-failed-to-authenticate-user-elastic/234902/3 "2020-06-30T08:48:48Z")

</div>

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