0

I just updated my Magento instalation from 2.3.3 to 2.3.6.

PHP version 7.3

Everything seamed to fine except when I do reindex. I get this error:

PHP Fatal error:  Uncaught Error: Cannot instantiate interface Magento\InventoryCatalogApi\Model\GetProductTypesBySkusInterface in /chroot/home/a96f0e0b/stores.etailhandel.no/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121
Stack trace:
#0 /chroot/home/a96f0e0b/stores.etailhandel.no/html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Invento...', Array)
#1 /chroot/home/a96f0e0b/stores.etailhandel.no/html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Invento...')
#2 /chroot/home/a96f0e0b/stores.etailhandel.no/html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get('Magento\\Invento...')
#3 /chroot/home/a96f0e0b/stores.etailhandel.no/html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled-> in /chroot/home/a96f0e0b/stores.etailhandel.no/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 121

Do anyone know what this means? And can anyone help me please.

6
  • can you run all commands? Commented Jun 5, 2021 at 14:03
  • Yeah except reindex. But our products do not show anymore. It fails on catalogue search. Commented Jun 5, 2021 at 18:34
  • rm -rf generated Commented Jun 5, 2021 at 18:53
  • @Reshad Zazai what does that command do? And will that fox our reindex issue? Commented Jun 5, 2021 at 19:27
  • Your are configure Elasticsearch ? Commented Jun 5, 2021 at 19:33

2 Answers 2

2

-> if error in indexing after upgrade then run below sql query in phpmyadmin

CREATE
SQL SECURITY INVOKER
VIEW `inventory_stock_1`
AS
SELECT
DISTINCT
legacy_stock_status.product_id,
legacy_stock_status.website_id,
legacy_stock_status.stock_id,
legacy_stock_status.qty quantity,
legacy_stock_status.stock_status is_salable,
product.sku
FROM `cataloginventory_stock_status` `legacy_stock_status`
INNER JOIN `catalog_product_entity` product
ON legacy_stock_status.product_id = product.entity_id;

and run below commands

  • Clear var/generation
  • Clear var/cache
  • Enable Magento modules: bin/magento module:enable --all
  • Compile DI bin/magento setup:di:compile

hope this helps you:)

3
  • Tried t his and the same error.. Do I need to do upgrade etc after it? Commented Jun 6, 2021 at 9:50
  • no need to upgrade. its related to something else Commented Jun 6, 2021 at 11:07
  • updated answer. Commented Jun 6, 2021 at 11:08
0

Thank you all for all the help I got from you guys,

@Gohil Rajesh, your script worked but was also an issue with a module that also caused the problem. Disabled that and all indexes are now working.

Thanks, everyone!!

1
  • Happy to hear its works now Commented Jun 12, 2021 at 8:37

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.