Magento: Error removing old index from Elastic Search.

0

Hello,

When I start indexing, the old indexes are not deleted. Normally old indexes are deleted to leave shareds.

Is this a configuration problem?

Error logs:

[2022-08-10 08:05:36] main.CRITICAL: {"error":{"root_cause":[{"type":"snapshot_in_progress_exception","reason":"Cannot delete indices that are being snapshotted: [[magento2_product_4_v12854/gZH6DirdQ2GBwVUVZoTP4w]]. Try again after snapshot finishes or cancel the currently running snapshot."}],"type":"snapshot_in_progress_exception","reason":"Cannot delete indices that are being snapshotted: [[magento2_product_4_v12854/gZH6DirdQ2GBwVUVZoTP4w]]. Try again after snapshot finishes or cancel the currently running snapshot."},"status":400} {"exception":"[object] (Elasticsearch\\Common\\Exceptions\\BadRequest400Exception(code: 400): {\"error\":{\"root_cause\":[{\"type\":\"snapshot_in_progress_exception\",\"reason\":\"Cannot delete indices that are being snapshotted: [[magento2_product_4_v12854/gZH6DirdQ2GBwVUVZoTP4w]]. Try again after snapshot finishes or cancel the currently running snapshot.\"}],\"type\":\"snapshot_in_progress_exception\",\"reason\":\"Cannot delete indices that are being snapshotted: [[magento2_product_4_v12854/gZH6DirdQ2GBwVUVZoTP4w]]. Try again after snapshot finishes or cancel the currently running snapshot.\"},\"status\":400} at /home/site/irrijardin-ecommerce/www/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:675)"} []

Technical context :

  • Magento 2 ver. 2.4.3-p1

Thank you

Bastien
已提問 2 年前檢視次數 792 次
2 個答案
0

When I start indexing, the old indexes are not deleted. Normally old indexes are deleted to leave shareds. This statement is a bit unclear. What's the expectation about index deletion?

Based on the logs you shared, it's clear that there is a snapshot in progress and you cannot delete an index when a snapshot is in progress. Either wait for completion or cancel the snapshot (as suggested in the log as well)

--Syd

profile picture
Syd
已回答 2 年前
0

You'll need to update the ElasticSearch indexer to properly handle this error being returned from the AWS ElasticSearch API. Unfortunately the indexer doesn't properly handle this. AWS provides a few API's that you can call to check on the status to determine when the snapshot is finished and then you can proceed to properly delete the indice. If you don't do this; the indice will stick around and then you'll be stuck with unused indices and therefore will start bleeding shards over time per index. (note: AWS ES/OpenSearch does a snapshot every hour and the only way to change this is to submit a ticket to the AWS ES team to remove that feature - but it has consequences. Therefore it's best to update the code to properly handle the error.)

Bill
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南