How to solve ElasticSearch Error cluster_block_exception [FORBIDDEN/12/index read-only]

Today I encountered this issue while reindexing my store.

{"error":{"root_cause":[{"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"}],"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"},"status":403}

In order ro solve that issue, I’ve had to run that command line :


curl -XPUT -H "Content-Type: application/json" http://localhost:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'

That command is used to remove the read-only state from all indices in your Elasticsearch cluster. This is often used when indices have been automatically set to read-only due to low disk space, allowing write operations to resume once you’ve addressed the disk space issue.

This error seems to be linked to a low disk space issue and you can confim that by checking the elastisearch logs located in /var/log/elasticsearch in my environment (could be different for yours).

Leave a Reply

Your email address will not be published. Required fields are marked *