Cluster_block_exception Too Many Requests, Disk Exceeded

If you are doing reindexing in Magento 2 store and if you are facing any problem while indexing like catalog search index process unknown cluster_block_exception is a very common problem that comes.

There is a very simple solution to this issue, if this issue comes in your Magento 2.3 store or Magento 2.4 store both have the same solution.

The reason for the issue varies from DB to DB. Most of the elastic search errors appear in your 2.4 stores.

If you are re-indexing in the version above 2.4 and if there is more disk usage then this problem also comes at that time.

And even in the 2.3 version, the same problem is created, at that time you will see the problem of too many requests.

Here I am giving you the solution for that, if you run the command step by step, then your problem will be solved.

 

Magento 2.3 Reindexing Issue

When you do re-indexing in your Magento 2.1, 2.2, 2.3 versions you will see some errors like this.

cluster_block_exception [TOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block]

php bin/magento indexer:reindex
Design Config Grid index has been rebuilt successfully in 00:00:00
Customer Grid index has been rebuilt successfully in 00:00:05
Category Flat Data index has been rebuilt successfully in 00:00:00
Category Products index has been rebuilt successfully in 00:00:06
Product Categories index has been rebuilt successfully in 00:00:00
Catalog Rule Product index has been rebuilt successfully in 00:00:03
Product EAV index has been rebuilt successfully in 00:00:07
Stock index has been rebuilt successfully in 00:00:05
Inventory index has been rebuilt successfully in 00:00:00
Catalog Product Rule index has been rebuilt successfully in 00:00:00
Product Price index has been rebuilt successfully in 00:03:57
Google Product Removal Feed index has been rebuilt successfully in 00:00:00
Google Product Feed index has been rebuilt successfully in 00:00:00
Catalog Search index process unknown error:
{"error":{"root_cause":[{"type":"cluster_block_exception","reason":"index [magento2_product_1_v1516] 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_v1516] blocked by: [TOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];"},"status":429}

 

Reindexing Issue in Magento 2.4

The problem is the same in the 24 version of magento, but sometimes it is also due to low disk, as if you see the log, you will see something like this.

Catalog Search index process unknown error

error: root_cause: cluster_block_exception reason:

Elasticsearch error: cluster_block_exception [FORBIDDEN/12/index read-only / allow delete (api)], flood stage disk watermark exceeded

Elastic search log

flood stage disk watermark [95%] exceeded ... all indices on this node will marked read-only.

cluster_block_exception
Magento 2 Reindexing Issue

In Magento 2, when we configure Elasticsearch it tries to get the available disk space on a node.

When it decides it has to allocate a new shark to that node or actively send that shark to some distance away from that particular node.

The percentage of disk space that's free. (That means you need 50GB of free space in 1TB hard disk.)

 

Solution Reindex issue with Elasticsearch

In order to solve this issue, you just have to go into the root directory of the Magento 2 store and then execute the below command one by one.

Command - 1

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

Command - 2

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

Command - 3

Now run the final command

php bin/magento indexer:reindex

 

cluster_block_exception

This issue can be solved by executing the above command and then you can do the reindexing successfully.

 

Read more: Best 3 Simple Ways to Upgrade Magento 2 Store in 2022

 

References:

https://stackoverflow.com/

elastic.co