2

I am using following configurations for my magento2 project

Ubuntu 18.04
PHP 7.2
MYSQL 5.7
Elastic Search 7.x
Magento 2.3.5-p1

When i enabled elastic search in magento2 admin panel , the connection was successful but getting below error when i run indexer or navigates to category pages.

Fatal error: Uncaught Error: Cannot instantiate interface Magento\AdvancedSearch\Model\Client\ClientOptionsInterface in /var/www/html/myproj/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:121 Stack trace: 
#0 /var/www/html/myproj/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Advance...', Array) 
#1 /var/www/html/myproj/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Advance...') 
#2 /var/www/html/myproj/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectManager\Factory\Compiled->get('Magento\\Advance...') 
#3 /var/www/html/myproj/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Elastic...') 
#4 /var/www/html/myproj/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): Magento\Framework\ObjectMan in /var/www/html/myproj/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 121

Any solution for this?

2
  • Have you tried clearing the cache and generated files? rm -rf ./generated/code && magento cache:clean && magento indexer:reindex Sep 16, 2020 at 15:49
  • yes no use of this
    – Dinesh
    Oct 1, 2020 at 3:52

1 Answer 1

7

Check if the required modules are installed and enabled.

In my case (during an update from Magento 2.3 to Magento 2.4) the modules "Magento_Elasticsearch" and "Magento_Elasticsearch6" were disabled.

"Magento_Elasticsearch" contains the implementation of the "Magento\AdvancedSearch\Model\Client\ClientOptionsInterface".

3
  • 1
    This should be accepted, 2 days wasted. if that module is required magento should have enabled by default
    – Flak
    Jan 22, 2021 at 16:08
  • thank you so much, saved me ages trying to work out the root cause, I agree with ^
    – John
    Dec 3, 2021 at 8:50
  • I enabled this extension but still error
    – huykon225
    Jan 25, 2022 at 4:48

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.