The MDVA-13203 Magento patch fixes the issue where your site is showing a maintenance page and there are CRITICAL: SQLSTATE[23000]: Integrity constraint violation errors in the system.log
. This patch is available when the Magento Quality Patch (MQP) tool 1.0.13 is installed.
Affected products and versions
The patch is created for Magento version:
Magento Commerce Cloud 2.2.4.
Compatible with Magento versions:
Magento Commerce and Magento Commerce Cloud 2.3.0-2.4.1.
Note: the patch can be applicable to other versions. To check if the patch is compatible with your Magento version, run ./vendor/bin/magento-patches status
.
Issue
Steps to reproduce:
- Go to the affected URL.
- You see the maintenance page.
- Check that the site is not in maintenance status via ssh:
php bin/magento maintenance:status
Status: maintenance mode is not active
List of exempt IP-addresses: none
4. Look at system.log
:
grep critical -i var/log/system.log |tail [2018-09-04 17:05:18] report.CRITICAL: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '4613' for key 'PRIMARY', query was: INSERT INTO `search_tmp_5b8ebb4e994da5_88027289` (`entity_id`,`score`) VALUES (?, ?),... (?, ?), (?, ?) [] [] [2018-09-04 17:05:21] report.CRITICAL: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '4613' for key 'PRIMARY', query was: INSERT INTO `search_tmp_5b8ebb51579943_52333638` (`entity_id`,`score`) VALUES (?, ?),...,(?, ?) [] [] [2018-09-04 17:05:47] report.CRITICAL: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1350' for key 'PRIMARY', query was: INSERT INTO `search_tmp_5b8ebb6b7028f4_68065024` (`entity_id`,`score`) VALUES (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?) [] [] [2018-09-04 17:05:47] report.CRITICAL: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1350' for key 'PRIMARY', query was: INSERT INTO `search_tmp_5b8ebb6b7885a9_23360993` (`entity_id`,`score`) VALUES (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?), (?, ?) [] [] date Tue Sep 4 17:06:11 UTC 2018
Expected results:
You should see the site.
Actual results:
The maintenance page shows because of database consistency issues.
Apply the patch
For instructions on how to apply an MQP patch, use the following links depending on your Magento product:
- Magento Commerce: DevDocs Apply patches using Magento Quality Patches Tool.
- Magento Commerce Cloud: DevDocs Upgrades and Patches > Apply patches.
Related reading
To learn more about Magento Quality Patches, refer to:
For info about other patches available in MQP tool, refer to the Patches available in MQP tool section.