ClusterBlockException: index [my_index] blocked by: [FORBIDDEN/12/index read-only / allow delete (api)]
ID: database/elasticsearch-index-read-only
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 8 | active | — | — | — |
Root Cause
Elasticsearch automatically set the index to read-only mode. This is most commonly triggered by the disk-based shard allocator when disk usage exceeds the flood_stage watermark (default 95%). Elasticsearch protects itself from filling the disk completely by blocking writes to indices on the affected node. It can also occur when an administrator manually set the index to read-only, or during a cluster recovery after a node failure.
genericWorkarounds
-
95% success Free disk space and then remove the read-only block
First, free disk space: delete old indices (DELETE /old-index-2024*), use ILM to roll over indices, clean up snapshots, or add disk capacity. Get disk below 90% usage. Then remove the block: PUT /my_index/_settings {"index.blocks.read_only_allow_delete": null}. Or for all indices: PUT /_settings {"index.blocks.read_only_allow_delete": null}. Verify with: GET /_cat/allocation?v to check disk usage per node. -
85% success Adjust the disk watermark thresholds if the defaults are too aggressive for your setup
Update cluster settings: PUT /_cluster/settings {"persistent": {"cluster.routing.allocation.disk.watermark.flood_stage": "97%", "cluster.routing.allocation.disk.watermark.high": "95%", "cluster.routing.allocation.disk.watermark.low": "90%"}}. Only increase these if you have monitoring in place and understand the risk of running at high disk utilization. This is a temporary measure while scaling storage.
Dead Ends
Common approaches that don't work:
-
Repeatedly removing the read-only block without addressing disk space
90% fail
If disk usage is still above the flood_stage watermark, Elasticsearch will immediately re-apply the read-only block after it is removed. The block is a protective mechanism; removing it without freeing disk space results in an infinite loop of blocking and unblocking.
-
Deleting the index and recreating it to remove the block
85% fail
Deleting the index removes all data permanently. The new index may also become read-only immediately if disk space is still insufficient. This destroys data without solving the root cause.