# Unable to delete index

**URL:** <https://discuss.elastic.co/t/unable-to-delete-index/128596>\
**Category:** Elasticsearch\
**Created:** [April 18, 2018, 7:23pm UTC](https://discuss.elastic.co/t/unable-to-delete-index/128596 "2018-04-18T19:23:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tronyx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tronyx/32/30146_2.png) [@tronyx](https://discuss.elastic.co/u/tronyx)\
**Post date:** [April 18, 2018, 7:23pm UTC](https://discuss.elastic.co/t/unable-to-delete-index/128596/1 "2018-04-18T19:23:17Z")

</div>

Experiencing an issue with two indices that were somehow marked as read-only and now I'm unable to remove that restriction. Here is what I have tried and the result:

```
~]# curl -XPOST 'http://10.48.184.94:9200/lvs-logstash-risk-service-request-2017.08.01/_settings' -d '{ "index.blocks.read_only_allow_delete": "false" }'
{"error":{"root_cause":[{"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/5/index read-only (api)];"}],"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/5/index read-only (api)];"},"status":403}

```

This issue is preventing my automatic Curator job from performing a cleanup on all indices alphabetically after this one and might be the cause of a mapping conflict that I'm seeing with this index pattern in Kibana.

Any/all help is greatly appreciated.

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [April 18, 2018, 9:09pm UTC](https://discuss.elastic.co/t/unable-to-delete-index/128596/2 "2018-04-18T21:09:54Z")

</div>

What version of Elasticsearch?

---

<div class="post-metadata">

**Author:** ![tronyx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tronyx/32/30146_2.png) [@tronyx](https://discuss.elastic.co/u/tronyx)\
**Post date:** [April 18, 2018, 9:17pm UTC](https://discuss.elastic.co/t/unable-to-delete-index/128596/3 "2018-04-18T21:17:14Z")

</div>

Currently it is 5.2.2.

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [April 18, 2018, 9:23pm UTC](https://discuss.elastic.co/t/unable-to-delete-index/128596/4 "2018-04-18T21:23:09Z")

</div>

I can't remember which version they fixed this in, but I recall there being a change that allowed you to _unset_ the read-only flag. Older versions (and again, I'm not sure where the cutoff is) did not allow you to unset read-only once set, resulting in an error message like the one you're showing.

Have you tried an outright:

```auto
PUT /indexname/_settings
{
  "index.blocks.read_only": false
}

```

...to set the index back to full read/write capacity?

---

<div class="post-metadata">

**Author:** ![tronyx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tronyx/32/30146_2.png) [@tronyx](https://discuss.elastic.co/u/tronyx)\
**Post date:** [April 18, 2018, 9:37pm UTC](https://discuss.elastic.co/t/unable-to-delete-index/128596/5 "2018-04-18T21:37:32Z")

</div>

I have and the result is the same:

```
~]# curl -XPOST 'http://10.48.184.94:9200/lvs-logstash-risk-service-request-2017.08.01/_settings' -d '{ "index.blocks.read_only": "false" }'
{"error":{"root_cause":[{"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/5/index read-only (api)];"}],"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/5/index read-only (api)];"},"status":403}

```

EDIT: Using XPUT instead of XPOST worked!

```
~]# curl -XPUT 'http://10.48.184.94:9200/lvs-logstash-risk-service-request-2017.08.01/_settings' -d '{ "index.blocks.read_only": "false" }'
{"acknowledged":true}
```

---

<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 16, 2018, 9:37pm UTC](https://discuss.elastic.co/t/unable-to-delete-index/128596/6 "2018-05-16T21:37:43Z")

</div>

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