Magento 2.3.4 | the stock item was unable to be saved. Please try again.

Development Notes: Magento 2.3.4 | the stock item was unable to be saved. Please try again.

Environment:

Magento 2.3.4, Elastic Seach, Disabled MSI.

Problem:

Editing the stock quantity of some select products would trigger the error:

'the stock item was unable to be saved. Please try again.'.

The change in quantity could not be saved.

Consequential Problems:

  • Overselling occurred due to the stock quantity not correctly changing to 0 and forcing product out of stock.
  • Duplicate orders occurred
  • Duplicate charges occurred

What we tried:

  • Changing the method of save for all indexes.
  • Switching from Elastic Search to default MYSQL.
  • Reindexing / Cache Refresh

How we recreated the problem:

Identified a problem product (indicated in our ERP logs) and attempted to save it from 1 to 0. It would save for a quantity of 1 but not for 0. Changing the same product from 'enabled' to 'disabled' would result in the following error:

'Unable to rollback transaction'.

Solution for this case:

After investigating the MYSQL logs, we found a crashed M2EPRO log table which was repaired. We emptied the log table which contained 24959 rows.

Conclusion

This problem was evident for a select number of products. It stopped inventory changes and it also impacted the order confirmation process, presumably as the inventory attempted to update for these selected products.



Get a Quote

If you would like a bespoke price for your web design project, please complete the form shown here and we'll get back to you.

Web Design Articles