Solving cluster_block_exception Error in Magento 2: Index blocked by [TOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block]

In the world of Magento 2, encountering errors during routine operations like reindexing is not uncommon. One such error, the “cluster_block_exception,” can be particularly frustrating, especially when it disrupts critical tasks. Today, we delve into this issue, exploring solutions recommended by experts in the Magento community.

Understanding the Problem

The “cluster_block_exception” error arises in Magento 2 when Elasticsearch encounters a disk usage problem that exceeds the flood-stage watermark. This error puts Elasticsearch in a read-only mode, hindering essential operations like reindexing.

When this error appears, it usually has the following message:

{"error":{"root_cause":[{"type":"cluster_block_exception","reason":"index [magento2_product_1_v236] blocked by: [TOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];"}],"type":"cluster_block_exception","reason":"index [magento2_product_1_v236] blocked by: [TOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];"},"status":429}

Solution to fix cluster_block_exception error

As mentioned, Elasticsearch triggered an error due to low disk space, causing the system to go into read-only mode. To resolve this issue, follow these steps:

Step 1: Disable Cluster Routing Allocation Disk Threshold:

Run the following command in the Magento 2 root directory:

curl -XPUT -H "Content-Type: application/json" http://localhost:9200/_cluster/settings -d '{ "transient": { "cluster.routing.allocation.disk.threshold_enabled": false } }'

Step 2: Remove read-only status:

Use the following command:

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

After completing the above 2 steps, you can now reindex without encountering this annoying error.

Conclusion

By following these recommended steps, you can effectively resolve the “cluster_block_exception” issue in Magento 2 and ensure smooth reindexing operations. Understanding the root cause of errors like these and implementing targeted solutions is crucial for maintaining a stable Magento 2 environment.

5 2 votes
Article Rating

Callula Huy

Callula is the Marketing Executive at Magetop. With more than 5 years of copywriting under his belt, Callula is into creating valuable content that is straight to the point. Life student. Workaholic. Foreign languages and traveling aficionado.

Leave a Reply or put your Question here

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x