We get a lot of this type of notice in our system.log, but can't see what is causing this critical notice.
Framework: Magento M2 2.3.3
Have anyone seen this before ?
[2019-11-14 14:00:08] main.CRITICAL: The stock item with the "37520" ID wasn't found. Verify the ID and try again. [] []
[2019-11-14 14:00:13] main.CRITICAL: The stock item with the "39393" ID wasn't found. Verify the ID and try again. [] []
[2019-11-14 14:00:14] main.CRITICAL: The stock item with the "5610" ID wasn't found. Verify the ID and try again. [] []
[2019-11-14 14:00:19] main.CRITICAL: The stock item with the "10691" ID wasn't found. Verify the ID and try again. [] []
[2019-11-14 14:00:20] main.CRITICAL: The stock item with the "20589" ID wasn't found. Verify the ID and try again. [] []
[2019-11-14 14:00:22] main.CRITICAL: The stock item with the "47337" ID wasn't found. Verify the ID and try again. [] []
[2019-11-14 14:00:30] main.CRITICAL: The stock item with the "13366" ID wasn't found. Verify the ID and try again. [] []
Hi, check my response. Mark question as answered, if it works for you.
Best Answer
I had the same problem. Following the solution by @hitesh-kashyap, I was able to modify the the following code.
Problem: When the BuildProductRequest function is called in the ProductFeed class it creates a StockItemRepository object. If the product is a new product an exception is thrown because the newly created product does not have a record on the cataloginventory_stock_item table yet.
Solution: Add a try catch section to Facebook/BusinessExtension/Model/Feed/ProductFeed.php
With
with
With
Finally, save the file.
Limitations, at the time you create a product the stock information will be 0 and out of stock. You will need to save the product a second time to update the stock information on Facebook.
Tested on Magento 2.3