# Cluster\_block\_exception does not allow me to delete an index

**URL:** <https://discuss.elastic.co/t/cluster-block-exception-does-not-allow-me-to-delete-an-index/324218>\
**Category:** Elasticsearch\
**Created:** [January 30, 2023, 11:03am UTC](https://discuss.elastic.co/t/cluster-block-exception-does-not-allow-me-to-delete-an-index/324218 "2023-01-30T11:03:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![DarwinGoyal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/darwingoyal/32/113485_2.png) [@DarwinGoyal](https://discuss.elastic.co/u/DarwinGoyal)\
**Post date:** [January 30, 2023, 11:03am UTC](https://discuss.elastic.co/t/cluster-block-exception-does-not-allow-me-to-delete-an-index/324218/1 "2023-01-30T11:03:29Z")

</div>

I created one index with `"blocks.metadata": true`.

```auto
PUT darwin-test-shard/_settings
{
  "blocks.metadata": true
}

```

Now whenever I try to access \_cat/indices, I get

```auto
{
  "error" : {
    "root_cause" : [
      {
        "type" : "cluster_block_exception",
        "reason" : "index [darwin-test-shard] blocked by: [FORBIDDEN/9/index metadata (api)];"
      }
    ],
    "type" : "cluster_block_exception",
    "reason" : "index [darwin-test-shard] blocked by: [FORBIDDEN/9/index metadata (api)];"
  },
  "status" : 403
}

```

If I try to delete the index I again get same error.  
Seems like once created with blocks.metadata: true, I am unable to make any changes. I am stuck on this. Any help will be appreciated.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 31, 2023, 5:39am UTC](https://discuss.elastic.co/t/cluster-block-exception-does-not-allow-me-to-delete-an-index/324218/2 "2023-01-31T05:39:29Z")

</div>

You need to remove the block to be able to do anything with the index.

Why did you apply this anyway?

---

<div class="post-metadata">

**Author:** ![DarwinGoyal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/darwingoyal/32/113485_2.png) [@DarwinGoyal](https://discuss.elastic.co/u/DarwinGoyal)\
**Post date:** [January 31, 2023, 5:48am UTC](https://discuss.elastic.co/t/cluster-block-exception-does-not-allow-me-to-delete-an-index/324218/3 "2023-01-31T05:48:23Z")

</div>

I was just playing around and did not know that `"blocks.metadata": true` will prevent me from accessing the index and other index related APIs.

Can you guide me how to remove the block?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 31, 2023, 5:50am UTC](https://discuss.elastic.co/t/cluster-block-exception-does-not-allow-me-to-delete-an-index/324218/4 "2023-01-31T05:50:01Z")

</div>

Does this work?

```auto
PUT darwin-test-shard/_settings
{
  "blocks.metadata": false
}

```

---

<div class="post-metadata">

**Author:** ![DarwinGoyal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/darwingoyal/32/113485_2.png) [@DarwinGoyal](https://discuss.elastic.co/u/DarwinGoyal)\
**Post date:** [January 31, 2023, 7:25am UTC](https://discuss.elastic.co/t/cluster-block-exception-does-not-allow-me-to-delete-an-index/324218/5 "2023-01-31T07:25:30Z")

</div>

No. It gives same error

```auto
{
  "error" : {
    "root_cause" : [
      {
        "type" : "cluster_block_exception",
        "reason" : "index [darwin-test-shard] blocked by: [FORBIDDEN/9/index metadata (api)];"
      }
    ],
    "type" : "cluster_block_exception",
    "reason" : "index [darwin-test-shard] blocked by: [FORBIDDEN/9/index metadata (api)];"
  },
  "status" : 403
}

```

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [January 31, 2023, 7:28am UTC](https://discuss.elastic.co/t/cluster-block-exception-does-not-allow-me-to-delete-an-index/324218/6 "2023-01-31T07:28:42Z")

</div>

IIRC there's a bug in this area in older versions, try this:

```auto
PUT darwin-test-shard/_settings
{
  "index.blocks.metadata": false
}

```

---

<div class="post-metadata">

**Author:** ![DarwinGoyal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/darwingoyal/32/113485_2.png) [@DarwinGoyal](https://discuss.elastic.co/u/DarwinGoyal)\
**Post date:** [January 31, 2023, 7:50am UTC](https://discuss.elastic.co/t/cluster-block-exception-does-not-allow-me-to-delete-an-index/324218/7 "2023-01-31T07:50:46Z")

</div>

It worked.  
Thank you so much.

---

<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 28, 2023, 7:51am UTC](https://discuss.elastic.co/t/cluster-block-exception-does-not-allow-me-to-delete-an-index/324218/8 "2023-02-28T07:51:13Z")

</div>

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