cancel
Showing results for 
Search instead for 
Did you mean: 

Upgrade from 2.3.5 to 2.4.0 - Issue with cart

SOLVED

Upgrade from 2.3.5 to 2.4.0 - Issue with cart

Hello Everyone, 

I did an upgrade of a test environment from 2.3.5 (Enterprise) to 2.4.0, all went fine (upgraded PHP, ElasticSearch, ...) to meet the requirements of the 2.4.0 version.

 

I am able to navigate on the website, to go into the admin, but as soon as i try to add a product to my cart, nothing happens.

 

I got the following error in my logs :

 

Error: Cannot instantiate interface Magento\InventoryDistanceBasedSourceSelectionApi\Api\GetLatsLngsFromAddressInterface in /var/www/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121

With the below stacktrace

Stack trace:
#0 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject()
#1 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create()
#2 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get()
#3 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create()
#4 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get()
#5 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create()
#6 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php(125): Magento\Framework\ObjectManager\Factory\Compiled->get()
#7 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php(86): Magento\Framework\ObjectManager\Factory\Compiled->parseArray()
#8 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create()
#9 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get()
#10 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create()
#11 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get()
#12 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create()
#13 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php(125): Magento\Framework\ObjectManager\Factory\Compiled->get()
#14 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php(86): Magento\Framework\ObjectManager\Factory\Compiled->parseArray()
#15 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create()
#16 /var/www/magento/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get()
#17 /var/www/magento/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Compiled->create()
#18 /var/www/magento/vendor/magento/module-shipping/Model/CarrierFactory.php(74): Magento\Framework\ObjectManager\ObjectManager->create()
#19 /var/www/magento/vendor/magento/module-shipping/Model/Config.php(94): Magento\Shipping\Model\CarrierFactory->create()
#20 /var/www/magento/vendor/magento/module-inventory-shipping/Model/Source/Validator/CarrierLinksValidator.php(69): Magento\Shipping\Model\Config->getAllCarriers()
#21 /var/www/magento/vendor/magento/module-inventory-api/Model/SourceValidatorChain.php(61): Magento\InventoryShipping\Model\Source\Validator\CarrierLinksValidator->validate()
#22 /var/www/magento/vendor/magento/module-inventory/Model/Source/Command/Save.php(57): Magento\InventoryApi\Model\SourceValidatorChain->validate()
#23 /var/www/magento/vendor/magento/module-inventory/Model/SourceRepository.php(58): Magento\Inventory\Model\Source\Command\Save->execute()
#24 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Inventory\Model\SourceRepository->save()
#25 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Inventory\Model\SourceRepository\Interceptor->___callParent()
#26 /var/www/magento/vendor/magento/module-inventory-indexer/Plugin/InventoryApi/InvalidateAfterEnablingOrDisablingSourcePlugin.php(65): Magento\Inventory\Model\SourceRepository\Interceptor->Magento\Framework\Interception\{closure}()
#27 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(135): Magento\InventoryIndexer\Plugin\InventoryApi\InvalidateAfterEnablingOrDisablingSourcePlugin->aroundSave()
#28 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Inventory\Model\SourceRepository\Interceptor->Magento\Framework\Interception\{closure}()
#29 /var/www/magento/generated/code/Magento/Inventory/Model/SourceRepository/Interceptor.php(26): Magento\Inventory\Model\SourceRepository\Interceptor->___callPlugins()
#30 /var/www/magento/vendor/magento/module-inventory-admin-ui/Controller/Adminhtml/Source/Save.php(136): Magento\Inventory\Model\SourceRepository\Interceptor->save()
#31 /var/www/magento/vendor/magento/module-inventory-admin-ui/Controller/Adminhtml/Source/Save.php(94): Magento\InventoryAdminUi\Controller\Adminhtml\Source\Save->processSave()
#32 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(58): Magento\InventoryAdminUi\Controller\Adminhtml\Source\Save->execute()
#33 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(138): Magento\InventoryAdminUi\Controller\Adminhtml\Source\Save\Interceptor->___callParent()
#34 /var/www/magento/vendor/magento/framework/App/Action/Plugin/ActionFlagNoDispatchPlugin.php(51): Magento\InventoryAdminUi\Controller\Adminhtml\Source\Save\Interceptor->Magento\Framework\Interception\{closure}()
#35 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Framework\App\Action\Plugin\ActionFlagNoDispatchPlugin->aroundExecute()
#36 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(153): Magento\InventoryAdminUi\Controller\Adminhtml\Source\Save\Interceptor->Magento\Framework\Interception\{closure}()
#37 /var/www/magento/generated/code/Magento/InventoryAdminUi/Controller/Adminhtml/Source/Save/Interceptor.php(26): Magento\InventoryAdminUi\Controller\Adminhtml\Source\Save\Interceptor->___callPlugins()
#38 /var/www/magento/vendor/magento/framework/App/Action/Action.php(111): Magento\InventoryAdminUi\Controller\Adminhtml\Source\Save\Interceptor->execute()
#39 /var/www/magento/vendor/magento/module-backend/App/AbstractAction.php(151): Magento\Framework\App\Action\Action->dispatch()
#40 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Backend\App\AbstractAction->dispatch()
#41 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(138): Magento\InventoryAdminUi\Controller\Adminhtml\Source\Save\Interceptor->___callParent()
#42 /var/www/magento/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): Magento\InventoryAdminUi\Controller\Adminhtml\Source\Save\Interceptor->Magento\Framework\Interception\{closure}()
#43 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch()
#44 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(153): Magento\InventoryAdminUi\Controller\Adminhtml\Source\Save\Interceptor->Magento\Framework\Interception\{closure}()
#45 /var/www/magento/generated/code/Magento/InventoryAdminUi/Controller/Adminhtml/Source/Save/Interceptor.php(39): Magento\InventoryAdminUi\Controller\Adminhtml\Source\Save\Interceptor->___callPlugins()
#46 /var/www/magento/vendor/magento/framework/App/FrontController.php(186): Magento\InventoryAdminUi\Controller\Adminhtml\Source\Save\Interceptor->dispatch()
#47 /var/www/magento/vendor/magento/framework/App/FrontController.php(118): Magento\Framework\App\FrontController->processRequest()
#48 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch()
#49 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent()
#50 /var/www/magento/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}()
#51 /var/www/magento/generated/code/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins()
#52 /var/www/magento/vendor/magento/framework/App/Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch()
#53 /var/www/magento/vendor/magento/framework/App/Bootstrap.php(263): Magento\Framework\App\Http->launch()
#54 /var/www/magento/pub/index.php(40): Magento\Framework\App\Bootstrap->run()
#55 {main} [] []

I checked and i got the requested interface.

It seems to be related to the MSI part, and when i check the Store > Configuration > Catalog > Inventory, i am missing the Distance Providers for Distance Based SSA block in the page.

 

Any ideas ?

 

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Upgrade from 2.3.5 to 2.4.0 - Issue with cart

For a reason or another, the module was disabled in the /app/etc/config.php...

Guess i was a bit too tired yesterday.

 

Works flawlessly now. 

View solution in original post

5 REPLIES 5

Re: Upgrade from 2.3.5 to 2.4.0 - Issue with cart

For a reason or another, the module was disabled in the /app/etc/config.php...

Guess i was a bit too tired yesterday.

 

Works flawlessly now. 

Re: Upgrade from 2.3.5 to 2.4.0 - Issue with cart

Hi - thanks for this.

 

I had exactly the same problem and after a lot of searching found this thread which resolved it for me.

Re: Upgrade from 2.3.5 to 2.4.0 - Issue with cart

Hi,
I'm also getting this issue.
Error: Cannot instantiate interface Magento\InventoryApi\Api\SourceRepositoryInterface

Can you please tell me which module is the cause of this?

Also, I need to disable the Multi store Inventory.

Re: Upgrade from 2.3.5 to 2.4.0 - Issue with cart

 run following commands 
php bin/magento module:enable --all
php bin/magento setup:di:compile
php bin/magento cache:flush



Re: Upgrade from 2.3.5 to 2.4.0 - Issue with cart

Only 3 modules need to be enabled:

'Magento_InventoryDistanceBasedSourceSelection' => 1,
'Magento_InventoryDistanceBasedSourceSelectionAdminUi' => 1,
'Magento_InventoryDistanceBasedSourceSelectionApi' => 1,