2

After Upgrade Magento from 2.3.4 to 2.4 getting error.

main.CRITICAL: Error: Cannot instantiate interface Magento\InventoryApi\Api\SourceRepositoryInterface in /public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121

3
  • add permission to pub, var, and generated folder. Commented Sep 13, 2020 at 4:48
  • It;s not the permission issue, I run compile, deploy commands and give permission to pub, var, and generated folder but still facing the problem Commented Sep 16, 2020 at 5:18
  • check this link => magento.stackexchange.com/questions/282341/… Commented Sep 16, 2020 at 5:52

4 Answers 4

5

I had the same thing, I disabled Multi Source Inventory in 2.3.

To achieve the same in 2.4 you need to disable more modules:

php bin/magento module:disable -f Magento_Inventory Magento_InventoryAdminUi Magento_InventoryApi Magento_InventoryBundleProduct Magento_InventoryBundleProductAdminUi Magento_InventoryCatalog Magento_InventorySales Magento_InventoryCatalogAdminUi Magento_InventoryCatalogApi Magento_InventoryCatalogSearch Magento_InventoryConfigurableProduct Magento_InventoryConfigurableProductAdminUi Magento_InventoryConfigurableProductIndexer Magento_InventoryConfiguration Magento_InventoryConfigurationApi Magento_InventoryGroupedProduct Magento_InventoryGroupedProductAdminUi Magento_InventoryGroupedProductIndexer Magento_InventoryImportExport Magento_InventoryIndexer Magento_InventoryLowQuantityNotification Magento_InventoryLowQuantityNotificationAdminUi Magento_InventoryLowQuantityNotificationApi Magento_InventoryMultiDimensionalIndexerApi Magento_InventoryProductAlert Magento_InventoryReservations Magento_InventoryReservationsApi Magento_InventoryCache Magento_InventorySalesAdminUi Magento_InventorySalesApi Magento_InventorySalesFrontendUi Magento_InventoryShipping Magento_InventorySourceDeductionApi Magento_InventorySourceSelection Magento_InventorySourceSelectionApi Magento_InventoryShippingAdminUi Magento_InventoryDistanceBasedSourceSelectionAdminUi Magento_InventoryDistanceBasedSourceSelectionApi Magento_InventoryElasticsearch Magento_InventoryExportStockApi Magento_InventoryReservationCli Magento_InventoryExportStock Magento_CatalogInventoryGraphQl Magento_InventorySetupFixtureGenerator Magento_InventoryAdvancedCheckout Magento_InventoryDistanceBasedSourceSelection Magento_InventoryRequisitionList Magento_InventoryGraphQl Magento_InventoryBundleImportExport Magento_InventoryBundleProductIndexer Magento_InventoryInStorePickupApi Magento_InventoryInStorePickupAdminUi Magento_InventoryInStorePickup Magento_InventoryInStorePickupGraphQl Magento_InventoryInStorePickupShippingApi Magento_InventoryInStorePickupQuoteGraphQl Magento_InventoryInStorePickupSales Magento_InventoryInStorePickupSalesApi Magento_InventoryInStorePickupQuote Magento_InventoryInStorePickupShipping Magento_InventoryInStorePickupShippingAdminUi Magento_InventoryInStorePickupFrontend Magento_InventoryInStorePickupMultishipping Magento_InventoryInStorePickupSalesAdminUi Magento_InventoryInStorePickupWebapiExtension
2

I ran into this error as well when upgrading from v2.4.3-p1 to v2.4.5-p1 (it would happen when manually running php bin/magento queue:consumers:start product_alert)

In my installation, many of the Magento Inventory modules were disabled via composer.json by setting the version to * in the replace property.

To resolve my issue, I had to do the following:

  1. Install required packages
composer require magento/module-inventory magento/module-inventory-api magento/inventory-metapackage
  1. Ensure that any manual overrides in composer.json are removed fromt the replace property.

  2. Recompile Magento

php bin/magento module:enable Magento_Inventory Magento_InventoryApi
rm -rf generated/ vendor/ && composer install && php bin/magento setup:upgrade && php bin/magento setup:di:compile && php bin/magento cache:flush
0

Also you could add this line into replace section in composer.json:

"magento/inventory-metapackage": "*"

After that run composer update, and bin/magento se:up

0

We are getting similar issue, on bin/magento setup:upgrade

We are yet to resolve it as it happen on prod and not on staging. We will need to try it again. So we can use some help to resolve this.

If we do find an answer I will update this.

enter image description here

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.