1

Can anyone give me the solution on the following error i.e.

report.CRITICAL: Could not receive Stock Item data {"exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): Could not receive Stock Item data at \\vendor\\magento\\module-inventory-indexer\\Model\\ResourceModel\\GetStockItemData.php:68, Zend_Db_Statement_Exception(code: 0): SQLSTATE[HY000]: General error: 1449 The user specified as a definer ('user_8rwzz4kd1lr'@'%') does not exist, query was: SELECT `inventory_stock_1`.`quantity`, `inventory_stock_1`.`is_salable` FROM `inventory_stock_1` WHERE (sku = 'abc')

Why I am getting this error in the first place and why Magento is trying to fetch the data from a table which does not exist in my DB. Thanks in advance.

1 Answer 1

3

I found the answer to my question in the Magento community blog solution was to edit the inventory_stock_1 and change the user and database name, it invokes when the table is being called. you can check if the view is present in your DB or not else create using the following SQL query. If anyone can provide more information about this error or this view that will be very helpful.

DELIMITER $$

ALTER ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `inventory_stock_1` AS 
SELECT DISTINCT
  `legacy_stock_status`.`product_id`   AS `product_id`,
  `legacy_stock_status`.`website_id`   AS `website_id`,
  `legacy_stock_status`.`stock_id`     AS `stock_id`,
  `legacy_stock_status`.`qty`          AS `quantity`,
  `legacy_stock_status`.`stock_status` AS `is_salable`,
  `product`.`sku`                      AS `sku`
FROM (`cataloginventory_stock_status` `legacy_stock_status`
   JOIN `catalog_product_entity` `product`
     ON ((`legacy_stock_status`.`product_id` = `product`.`entity_id`)))$$

DELIMITER ;

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.