2

I'm using Magento 2.4.3 and have sold an item, but when I go to ship it, I get this error "Following products with requested skus were not found: Prod-P1234".

The product exists with that SKU, and the stock levels indicate Quantity 1, Salable Quantity 0. The inventory_reservation database table has an entry for this item with a -1 quantity. There are no spaces either side of the sku.

I've tried re-saving the product with a higher quantity in stock in case that was the issue, as well as using the indexer:reindex command.

The product was Migrated from Magento 1.9 originally, so that may be a factor, but this is the first time in over a year that this message has occurred.

Any ideas why it can't find the SKU or things to check?

UPDATE

I've had a look at the file where the exception is triggered from (\vendor\magento\module-inventory-catalog\Model\GetProductIdsBySkus.php) to compare the skus being passed into it against those in the products table, and for some reason the invoiced product SKU has an extra spacebar on the end, where as the product its self does not.

I've spoken to my client (the Magento 2 site owner) who has said they originally tried to save the product sku with a space on the end, but Magento wouldn't allow it, so they removed the space and it then saved.

I've found an old database from Magento 1 and the product SKU had a space on the end originally, which has now gone in Magento 2. It looks like Magento 2 stripped the space off the end, but didn't update the table inventory_source_item which still listed the sku with a space.

2
  • You might have stock, if the salable quantity is still 0 it kinda makes sense to me that the product can't be sold. Have you tried adding salable quantity then reindexing ? Also Check if the sku really exist in your product entity table. In last you can try to go on the file that throw the error then going back in the code method by method until finding the real one that make the issue in your product to see what is the real issue behind all that
    – Claims
    Jan 20, 2022 at 10:38
  • Thanks for your reply @Claims, it seems the my client may have caused the problem with an extra space in the sku when it was originally created. Although the space doesn't exist now, it seems to have made it into the customers order.
    – Chris
    Jan 20, 2022 at 11:17

1 Answer 1

4

Keeping this here in case someone else experiences the same problem from a Magento 1 migration.

I've had a look at the file where the exception is triggered from (\vendor\magento\module-inventory-catalog\Model\GetProductIdsBySkus.php) to compare the skus being passed into it against those in the products table, and for some reason the invoiced product SKU has an extra spacebar on the end, where as the product its self does not.

I've spoken to my client (the Magento 2 site owner) who has said they originally tried to save the product sku with a space on the end, but Magento wouldn't allow it, so they removed the space and it then saved.

I've found an old database from Magento 1 and the product SKU had a space on the end originally, which has now gone in Magento 2. It looks like Magento 2 stripped the space off the end, but didn't update the table inventory_source_item which still listed the sku with a space.

4
  • 1
    First time I see this error, and problem in our case was the same, an extra blank space in inventory_source_item for a certain sku. Kudos for you. Thanks Aug 24, 2022 at 7:45
  • Thanks, this was exactly my problem. Saved me a lot of time..
    – Arne
    Jan 18, 2023 at 14:22
  • That helped me find the issue too. I had changed the SKU of the product but inventory_source_item still had the old SKU. Feb 24, 2023 at 5:14
  • To fix the actual shipment issue, I had to update the simple_sku within the product_options column. Feb 24, 2023 at 5:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.