Cluster_block_exception does not allow me to delete an index

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

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

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

{
  "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.

1 Like

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

Why did you apply this anyway?

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?

Does this work?

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

No. It gives same error

{
  "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
}

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

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

It worked.
Thank you so much.

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