Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebuild of ElastSuite indexes returns Unknown 413 error from OpenSearch #3522

Open
KathiD303 opened this issue Feb 13, 2025 · 15 comments
Open
Labels

Comments

@KathiD303
Copy link

KathiD303 commented Feb 13, 2025

Hello,

after updating to Magento 2.4.7-p3 all of our ElasticSuite indexes return the following error:

Rebuilding ElasticSuite Category Indexing index at 12:26:08
ElasticSuite Category Indexing indexer process unknown error:
Unknown 413 error from OpenSearch ""
Rebuilding Elasticsuite Cms Page Indexing index at 12:26:08
Elasticsuite Cms Page Indexing indexer process unknown error:
Unknown 413 error from OpenSearch ""
Rebuilding Catalog Search index at 12:38:25
Catalog Search indexer process unknown error:
Unknown 413 error from OpenSearch ""

It appears that the 413 error occurs during the execution of the catalogsearch_fulltext indexer because the server receives a payload that exceeds the configured request size. What can we do to resolve this issue? Any help would be appreciated.

Magento Version : Magento 2.4.7-p3 Commerce Cloud

ElasticSuite Version : 2.11.10

Environment : production

Third party modules : ReachDigital Better Indexer (see https://github.com/ho-nl/magento2-ReachDigital_BetterIndexer)

Steps to reproduce

  1. run bin/magento indexer:reindex catalogsearch_fulltext
  2. this will fail with the error messages above

Expected result

  1. reindex should be possible

Actual result

  1. see above

Best regards,
Katharina

@romainruaud
Copy link
Collaborator

Hi,

do you have more informations in the /var/log/opensearch.log ? Or in the Magento log files ?

If you enable the debug mode of Elasticsuite, can you share the content of the bulk queries that are sent to the Opensearch ?

Can you try to reduce the batch_indexing_size via the config and see what happens ? https://github.com/Smile-SA/elasticsuite/blob/2.11.x/src/module-elasticsuite-core/etc/config.xml#L36

Can you please share the output of "composer info | grep opensearch" as well ?

@ImanuelBertrand
Copy link

$ composer info | grep opensearch
opensearch-project/opensearch-php                                 2.4.0       PHP Client for OpenSearch
$

We're working on reducing the batch size - one test run on local instance with 100 didn't solve it, batch size 10 is being tested right now.
In the attached zip file there is an excerpt with the payload and the error log.

opensearch-error.zip

@Neos2007
Copy link

We faced the same issue (reproduced in all environments)
Magento Version : Magento 2.4.7-p3 Commerce Cloud

ElasticSuite Version : 2.11.6.1

@Neos2007
Copy link

I downgraged the version of the opensearch-project/opensearch-php package to 2.3.1 and this resolved the issue.
Also reindexing the catalogsearch_fulltext index with the opensearch-project/opensearch-php v 2.4.0 produced very huge indices (several times larger in size compared to those generated by version 2.3.1).

@romainruaud
Copy link
Collaborator

Good catch @Neos2007 so we'll have to dig on what has changed between opensearch client 2.3.1 and 2.4.0.

Forcing the downgrade in the meantime seems to be a good workaround.

However I'm not able actually to reproduce this locally actually, and it's not the case either on our CI/CD here on github, probably due to the fact that the sample data catalog size is not big enough to reach the OOM point of failure.

Gonna dig more on that and will keep you informed.

best regards

@ImanuelBertrand
Copy link

For reference: We have ~250.000 products

@romainruaud
Copy link
Collaborator

What's the version of the Opensearch server also ?

@ImanuelBertrand
Copy link

We have OpenSearch 2.12

@ImanuelBertrand
Copy link

I can confirm that opensearch-project/opensearch-php 2.3.1 works 👍

@romainruaud
Copy link
Collaborator

@Neos2007 are you also using the ReachDigital Better Indexer module ?

Regards

@ImanuelBertrand
Copy link

Oh, yeah, I forgot to mention that: I tried locally without that module and it didn't change the behaviour

@romainruaud
Copy link
Collaborator

I generated a catalog of 50.000 SKUs locally and tried with both version of Opensearch client :

With 2.3.1 the full reindex takes ~4min.

With 2.4.1 the full reindex takes ~8min. It doesn't crash but my laptop becomes kinda unresponsive.

So yes, there is most probably a performance issue with this version of the client.

Will have to dig more on that but sticking on "opensearch-project/opensearch-php 2.3.1" seems the way to go for now.

It's likely we'll add a "opensearch-project/opensearch-php <= 2.3.1" as a dependency in next version if we don't manage to understand properly the issue.

regards

@romainruaud
Copy link
Collaborator

Hi, I escalated this into the opensearch repo since it clearly looks the issue in on their side.

For now, I released an emergency minor release that will prevent the opensearch-client to go upper than 2.3.x.

Feel free to use it.

Regards

@Neos2007
Copy link

@Neos2007 are you also using the ReachDigital Better Indexer module ?

Regards

No. We don't

@Neos2007
Copy link

I generated a catalog of 50.000 SKUs locally and tried with both version of Opensearch client :

With 2.3.1 the full reindex takes ~4min.

With 2.4.1 the full reindex takes ~8min. It doesn't crash but my laptop becomes kinda unresponsive.

So yes, there is most probably a performance issue with this version of the client.

Will have to dig more on that but sticking on "opensearch-project/opensearch-php 2.3.1" seems the way to go for now.

It's likely we'll add a "opensearch-project/opensearch-php <= 2.3.1" as a dependency in next version if we don't manage to understand properly the issue.

regards

@romainruaud We have about 50,000 visible products (about 10000 of them are configurable with about 50000 not visible individually simple products) with a huge amount of custom attributes, 18 websites, and 22 store views.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants