I am using following configurations for my magento2 project

Ubuntu 18.04
PHP 7.2
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?

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

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".

  • This should be accepted, 2 days wasted. if that module is required magento should have enabled by default – Flakerim Jan 22 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.