This article provides a patch as a workaround, but the issue was permanently fixed in Adobe Commerce on cloud infrastructure v2.3.3 release, and it is recommended that you upgrade to v2.3.3. Follow the steps in Upgrade Adobe Commerce version in our developer documentation.
This article provides a patch for the known Adobe Commerce on cloud infrastructure 2.2.0 issue related to store front catalog pages being inaccessible, with the error message similar to the following in log: Integrity constraint violation: 1062 Duplicate entry ‘%entry%’ for key ‘PRIMARY’, query was: INSERT INTO `search_tmp_%number%.
Store front catalog pages become inaccessible unexpectedly. The error log has an error description similar to the following: Integrity constraint violation: 1062 Duplicate entry ‘%entry%’ for key ‘PRIMARY’, query was: INSERT INTO `search_tmp_%number%.
The issue is related to searching and caused by the existence of the outdated index along with the new one after reindex.
To fix the problem, you need to remove outdated indexes from ElasticSearch and apply the patch to prevent them from appearing.
To list all the indexes, use the following command:
curl -X GET %elasticsearch_domain%:%elasticsearch_port%/_cat/indices
To remove the outdated indexes, find the them in the database and then use the following command:
curl -X DELETE %elasticsearch_domain%:%elasticsearch_port%/%product_id%_v%outdated_version%
curl -X DELETE 127.0.0.1:9200/magento2_product_8_v332
The patches are attached to this article. To download a patch, scroll down to the end of the article and click the required file name, or click one the following links:
The patches were created for the following editions and versions:
MDVA-9590_EE_2.2.0_COMPOSER_v2 patch is also compatible (but might not solve the issue) with the following Adobe Commerce versions and editions:
MDVA-13203_EE_2.2.4_V1_COMPOSER patch is also compatible (but might not solve the issue) with the following Adobe Commerce versions and editions:
For instructions, see How to apply a composer patch provided by Adobe in our support knowledge base.