cancel
Showing results for 
Search instead for 
Did you mean: 

Inconsistency in product salable quantity (Magento 2 Inventory Reservations is not working properly)

Inconsistency in product salable quantity (Magento 2 Inventory Reservations is not working properly)

A couple of weeks ago we began to notice this problem in one of our stores:

 

When an order is placed for any product and the order is canceled due to problems with the payment method, or abandonment by the customer, the stock of that product is deducted from the salable quantities. I understand that the Magento reservation system is involved in this process and that under normal conditions, canceled orders should not be discounted from salable quantities (or rather, should be restored)

 

The result is that our salable quantities are lower than the stock of the products, so that at some point the customer receives notification that the product is out of stock, even when the product is enabled and in stock.

 

Salable qty and Stock QtySalable qty and Stock Qty

 

I have read about the Magento 2 inventory reservation system (https://github.com/magento/inventory/wiki/Salable-Quantity-Calculation-and-Mechanism-of-Rervations) and by checking the database in my database inventory_reservation table I notice that what is happening is that the canceled orders are not being compensated (they are discounted but not added after the order is canceled)

 

inventory_reservation in my DBinventory_reservation in my DB

 

We began to notice this problem with a particular product, its stock was high (because they were the quantities offered by our supplier, several orders were issued for this product but then we had to reduce the stock of the product as indicated by our supplier, as a result the quantities salable took negative values), however the problem harms all the products in our inventory. Maybe because of this, my store's reservation system broke down?

 

Any ideas on how to fix this problem? How to compensate for orders that are being discounted from inventory_reservation or returning to normal magento behavior?

 

Some information about my store:

Magento 2.3.1
Stock management is enabled
I use Default Stock, I don't have an MSI configuration.

The problem is similar to the one described in: https://github.com/magento/inventory/issues/2046, with the difference that I do not have stock sources, only default stock

 

 

5 REPLIES 5

Re: Inconsistency in product salable quantity (Magento 2 Inventory Reservations is not working prope

Re: Inconsistency in product salable quantity (Magento 2 Inventory Reservations is not working prope

is any way to be fixed without create compensations command? 

 

Re: Inconsistency in product salable quantity (Magento 2 Inventory Reservations is not working prope

Hi, We are having a similar issue, we were able to list all inconsistencies through bin/magento inventory:reservation:list-inconsistencies -r, but when we add the compensation values for all SKU and try to correlate that with the current variance level it does not ass up write, for example SKU 4155 the current quantity is 8 saleable is 24, the inconsistencies shown through bin/magento inventory:reservation:list-inconsistencies -r is -18, therefore after running bin/magento inventory:reservation:create-compensations, to create -18 compensation for SKU 4155, the revised salable quantity would be 6 but the default quantity would be 8 leading to an inconsistency of +2 instead of the earlier -16, we do not have any order under processing for 4155.

 

Below are some other similar examples:

 

Product-SKUQuantity Salable QuantityInconsistency list After compensation
4155824-186
331843-8-5
380702-20

 

Re: Inconsistency in product salable quantity (Magento 2 Inventory Reservations is not working prope

Same issue for us, perhaps worse?

 

I noticed reservations for orderid's that didn't exist - perhaps they were early test orders that we deleted - nevertheless, I went into the reservations table and deleted all reservations by copying the existing reservations take to a backup, and the deleting current reservations.

 

I then ran the pipe version of the above mentioned commands.

 

The problem is that reservations are mysteriously reappearing in the table. I run the command, it completes, then I run it again to ensure it's clean, but it then reruns the reservation compensations.

 

My problem is that I now have some products which are even more out-of-whack than they were. The reservations table won't empty and there's no site activity....

 

There must be some way to fix this? We're a 2.4 site, and can't reset Salable Quantity to Quantity.... I was told that a setup:di:compile  would reset the two to equal Quantity but that's not the case.....

Re: Inconsistency in product salable quantity (Magento 2 Inventory Reservations is not working prope

when i run the detect inconsistencies command, it gives me 19 copies of the output and when I run the pipe compensate command, it also seems to run in loops, since compensated inventory numbers have thousands where there should be hundreds. So I either end up with thousands in stock that don't exists or with thousands in minus, so nothing is available on the storefront. Any ideas why this could be happening and how to fix it? My default stock values are still not consistent with my actual stock