inventory: Inventory reservation list inconsistencies command does not work
The command to list inconsistencies never completes in Magento 2.3.2. Database size: ~15GB Order Count: ~1137711 SKU Count: 7788
Preconditions (*)
- Migrated from Magento 1.9.4 to Magento 2.3.1
- Upgraded from Magento 2.3.1 to Magento 2.3.2
- Migration from 1.9 to 2.3 caused inventory inconsistencies as listed here - https://devdocs.magento.com/guides/v2.3/inventory/inventory-cli-reference.html
Steps to reproduce (*)
- Upgrade from 2.3.1 to 2.3.2
- Run the command to list inventory inconsistencies
php -d memory_limit=-1 bin/magento inventory:reservation:list-inconsistencies -ir
Expected result (*)
- It should list the inconsistent inventories for effected SKUs
Actual result (*)
- The command keeps running forever and does not yield any result. It takes up all the server memory and still no result.
- In our case, it takes more than 20GB of memory and still not finished. here is screenshot from our server:
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 18
@chrisbadley @moderncodes - thanks for input, this really saved my day. After making your modification, truncating order tables and then manually clearing inventory_reservation table, everything is working as it’s supposed to. Pfew 😉
@chrisbadley @ef1970
vendor/magento/module-inventory-reservation-cli/Model/SalableQuantityInconsistency/FilterManagedStockProducts.php
should fix it temporary, until someone fixes it in prod
Doesn’t seem that there’s an internal ticket for this issue.
We ran into this when we had products with all numeric SKUs and this error cropped up. Seems that for some reason all numeric SKUs are being interpreted as an integer at some point. Casting them to a string when calling the
execute
function resolves this particular issue.I applied the same changes that @moderncodes posted here and it started working. It’s not a permanent fix, but it got me past where I needed to be.