How To

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

Hello Magento Friends,

Today I will give you the solution for the most common error, the reindex issue with Elasticsearch.

When there is a change in data in your database you need to run the reindex command to update the rows and columns. But when you run the below reindex command

bin/magento indexer:reindex

An error is shown in the terminal as follows:

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:00
Product EAV index has been rebuilt successfully in 00:00:09
Stock index has been rebuilt successfully in 00:00:04
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:01: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}

This error means you do not have enough disk space to store or update data. The flood storage watermark is 95% default, so when it exceeds, the above error is shown and it puts the Elasticsearch into read-only mode. So you need to free up disk space or enlarge it.

Let’s get the solution for the above error in Magento 2.

Steps to Solve Reindex issue with Elasticsearch:

Step 1: From the terminal go to Magento Root path and run the below command:

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

Step 2: After this again run the reindex command in the terminal and check.

bin/magento indexer:reindex

Conclusion:

This way you can solve the reindex error for Elasticsearch. If you face any difficulty, feel free to share with me via the comment box. Moreover, check out other related articles and solutions for reindexing in Magento 2.

Share the solution with your fellow Magento developers to help them get rid of the error. See you with my next article till then stay in touch.

Happy Coding!

Click to rate this post!
[Total: 40 Average: 4.2]
Dhiren Vasoya

Dhiren Vasoya is a Director and Co-founder at MageComp, Passionate 🎖️ Certified Magento Developer👨‍💻. He has more than 9 years of experience in Magento Development and completed 850+ projects to solve the most important E-commerce challenges. He is fond❤️ of coding and if he is not busy developing then you can find him at the cricket ground, hitting boundaries.🏏

View Comments

  • I have Magento2.4 with an elastic search version (7.9.2), Indexing of the catalogsearch_fulltext shows error

    {"error":{"root_cause":[{"type":"cluster_block_exception","reason":"index [magen to2_product_1_v272] 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_v272] blocked by: [TOO_MANY_RE QUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-d elete block];"},"status":429}

    I tried running the following commands to free up.

    - curl -XPUT -H "Content-Type: application/json" http://localhost:9200/_cluster/settings -d '{ "transient": { "cluster.routing.allocation.disk.threshold_enabled": false } }'
    - curl -XPUT -H "Content-Type: application/json" http://localhost:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'
    - sudo systemctl restart elasticsearch

    and now if I run the index for the first time it works the second time again it shows the same error

    sudo php bin/magento indexer:reindex catalogsearch_fulltext ;

    I tried multiple times with free command facing the same issue.

    Also executed.

    sudo php bin/magento setup:upgrade;
    sudo php bin/magento setup:di:compile;
    sudo php bin/magento setup:static-content:deploy -f;
    sudo php bin/magento indexer:reindex;
    sudo php bin/magento cache:clean;
    sudo php bin/magento cache:flush;
    sudo chmod -R 0777 pub/;
    sudo chmod -R 0777 var/;
    sudo chmod -R 0777 generated/

    Note: I have a stock update cron that runs each night, Around 200+updates will happen and I have scheduled the index of all products from save to schedule (Default 1 min cron).

    This only happens at night, The clear command for elastic and restart I executed during the morning noticing the issue.

    Since its showing TOO_MANY_REQUESTS how that's being triggered. Is it from Magento or from Elasticsearch?

    How to fix it? Please help.

  • I've recieve ab error in my terminal. Can you give me some suggestions about it, please?
    ```
    curl: (7) Failed to connect to localhost port 9200: Connection refused
    ```

  • Why you are removing whole setting data ?
    why not first check which index exist into elastic, if other than current prefix then remove it

Recent Posts

How to Delete Product Variant in a Shopify Remix App using GraphQL Mutations?

Managing a Shopify store efficiently involves keeping your product catalog organized. This includes removing outdated…

18 hours ago

6 Innovative Tools Revolutionizing E-Commerce Operations

E-commerce has transformed the way consumers shop for products and services and interact with businesses.…

3 days ago

How Upcoming Cookie Changes Will Affect Your E-commerce Website?

The e-commerce world is constantly in flux. New tech and strategies emerge daily to help…

3 days ago

Magento 2: How to Add Header and Footer in Checkout

Hello Magento Friends, In today’s blog, we will discuss adding a header and footer to…

4 days ago

Understanding Flexbox Layout in React Native

Hello React Native Friends, Building a visually appealing and responsive mobile app is crucial in…

6 days ago

HYVÄ Themes Releases: 1.3.6 & 1.3.7 – What’s New

We have brought exciting news for Magento store owners. Hyvä Themes recently released 1.3.6 and…

6 days ago