elasticsuite: Can not install Elasticsuite 2.7.0
Cannot instantiate interface Magento\InventorySalesApi\Api\StockResolverInterface
Preconditions
PHP 7.1.24, Elasticsearch 6.5
Magento Version : 2.3.0 CE
ElasticSuite Version : 2.7.0
Environment : Production
Third party modules : none
Steps to reproduce
After require and add config Elasticsuite follow wiki document
run command bin/magento setup:upgrade
Expected result
- Install Elasticsuite without error
Actual result
- [Screenshot, logs]
Module 'Magento_WishlistAnalytics':
Module 'Smile_ElasticsuiteCore':
Module 'Smile_ElasticsuiteCatalog':
Installing data... PHP Fatal error: Uncaught Error: Cannot instantiate interface Magento\InventorySalesApi\Api\StockResolverInterface in /var/www/clients/client0/web6/web/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:50
Stack trace:
#0 /var/www/clients/client0/web6/web/vendor/magento/framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Invento...')
#1 /var/www/clients/client0/web6/web/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Invento...')
#2 /var/www/clients/client0/web6/web/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Invento...', NULL, 'stockResolver', 'Smile\\Elasticsu...')
#3 /var/www/clients/client0/web6/web/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resol in /var/www/clients/client0/web6/web/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 50
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 21 (5 by maintainers)
Commits related to this issue
- Fixes #1222 Explicit composer/module dependencies to MSI modules — committed to rbayet/elasticsuite by rbayet 6 years ago
- Fixes #1222 Explicit composer/module dependencies to MSI modules — committed to rbayet/elasticsuite by rbayet 6 years ago
- Merge pull request #1229 from rbayet/fix_1222_explicit_module_dependencies Fixes #1222 Explicit composer/module dependencies — committed to Smile-SA/elasticsuite by romainruaud 6 years ago
If the class
Magento\InventorySalesApi\Api\StockResolverInterfacecannot be instantiated, it is possible that the module is disabled inapp/etc/config.phpfile. Make sure that the Inventory modules are enabled:Hello @minhluan259
I have followed this guide but I ran into the same problem. Can you tell me want exactly was the solution.
Thanks in advance Jens
EDIT:
Solution:
php bin/magento module:enable Magento_Inventory Magento_InventoryApi Magento_InventoryCatalogApi Magento_InventorySalesApi Magento_InventoryConfigurationApi Magento_InventoryReservationsApi Magento_InventorySourceDeductionApi Magento_SalesInventory Magento_InventorySales Magento_InventoryMultiDimensionalIndexerApi Magento_InventoryIndexer Magento_InventoryConfiguration Magento_InventoryCatalog Magento_InventoryReservations Magento_InventoryReservationsApiThen you should be able to run setup:upgrade
Als described here https://github.com/Smile-SA/elasticsuite/issues/1243 by @joshmcoffman
@SolsWebdesign @paalsoberg
Here’s a patch I made to make Elasticsuite work without any MSI modules actually installed (so removed with the composer replace trick). Formatted for use with vaimo/composer-patches.
Hello Guys,
Anyone have a news about this issue ?
Thank’s
This seems to be related to your installation.
Magento\InventorySalesApi\Api\StockResolverInterfaceshould be available invendor/magento/module-inventory-sales-api/Api/StockResolverInterface.phpon a Magento 2.3 installation (and mapped invendor/magento/module-inventory-sales/etc/di.xmlto<preference for="Magento\InventorySalesApi\Api\StockResolverInterface" type="Magento\InventorySales\Model\StockResolver"/>.We’ve had the same ‘issue’ but it was due to the fact that we had removed the magento/module-inventory-sales-api using composer replace. Could also be related to the generated folder or old cache.
Hello @paalsoberg,
2.7.7 and 2.8.0 releases introduced a fix that should allow you to use either the MSI modules or the legacy cataloginventory module. Unless you’re using PHP 7.3 which does not like a particular return type annotation : this is to be addressed in our (very soon) incoming 2.8.3 release.
Regards,