MDVA-33281 patch: inventory inconsistency issues

The MDVA-33281 patch fixes three inventory inconsistency issues. Click on the linked issues under the Issue section to see steps to reproduce these errors. This patch is available when the Quality Patches Tool (QPT) 1.0.14 is installed.

Affected products and versions

The patch is created for Adobe Commerce version:

Adobe Commerce on cloud infrastructure 2.3.5-p1

Compatible with Adobe Commerce versions:

Adobe Commerce on cloud infrastructure 2.3.4 - 2.3.5-p2

NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your Adobe Commerce version, update the magento/quality-patches package to the latest version and check the compatibility on the Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.

Issue

The patch fixes inventory inconsistency issues such as:

  • PHP Fatal error when running bin/magento inventory:reservation:list-inconsistencies in the CLI because of the wrong SKU parameter type.
  • Duplicate data in inconsistencies list.
  • New reservation will be created before order placed (previous realization based on reservation after order placed). In case of errors within order placement, additional reservation will be added to compensate.
NOTE
There is also a patch MDVA-30112 that solves the issue where there is an unexpectedly large number of reservation inconsistencies in our developer documentation, in the inventory_reservation table. For the solution, refer to MDVA-30112 Magento patch: large number reservation inconsistencies in our support knowledge base.

PHP Fatal Error

Steps to reproduce:

PHP Fatal error when running bin/magento inventory:reservation:list-inconsistencies.

To get a list of reservation inconsistencies, log in to the production server and run the following command in the CLI (-r switch - raw output):

bin/magento inventory:reservation:list-inconsistencies -r

Expected results:

The list of reservation inconsistencies is created. These would be returned in the following format

<ORDER_INCREMENT_ID>:<SKU>:<QUANTITY>:<STOCK-ID>

Actual results:

PHP Fatal Error is outputted.

Duplicate data

Duplicate data is in the inventory_reservation table.

Steps to reproduce:

To troubleshoot reservation inconsistencies, run the following command:

SELECT *, COUNT(*)
FROM inventory_reservation
GROUP BY metadata, sku, quantity
HAVING COUNT(*) > 1

Expected results:

No duplicates.

Actual results:

There are duplicates.

New reservation

Steps to reproduce:

New reservation created before order placed:

  1. Import the database.
  2. Run bin/magento setup:upgrade in the terminal.
  3. List inconsistencies by running bin/magento inventory:reservation:list-inconsistencies -i -r in the terminal.

Expected results:

No loop and much quicker results.

Actual results:

The same results are displayed in an infinite loop, or the command fails with memory_limit, depending on system settings.

Apply the patch

To apply individual patches, use the following links depending on your deployment method:

To learn more about Quality Patches Tool, refer to:

For info about other patches available in QPT, refer to the Patches available in QPT in our developer documentation.

recommendation-more-help
8bd06ef0-b3d5-4137-b74e-d7b00485808a