Showing results for 
Search instead for 
Did you mean: 

Magento 2 admin login recaptcha error

Magento 2 admin login recaptcha error

When i try login admin i am getting the following error,


Error: Cannot instantiate interface Magento\ReCaptchaUi\Model\ErrorMessageConfigInterface in C:\xampp\htdocs\m3\vendor\magento\framework\ObjectManager\Factory\Dynamic\Developer.php:50 Stack trace: #0 C:\xampp\htdocs\m3\vendor\magento\framework\ObjectManager\ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\ReCaptc...') #1 C:\xampp\htdocs\m3\vendor\magento\module-re-captcha-user\Observer\LoginObserver.php(107): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\ReCaptc...') #2 C:\xampp\htdocs\m3\vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php(121): Magento\ReCaptchaUser\Observer\LoginObserver->__construct(Object(Magento\ReCaptchaUi\Model\CaptchaResponseResolver), Object(Magento\ReCaptchaUi\Model\ValidationConfigResolver), Object(Magento\ReCaptchaValidation\Model\Validator), Object(Magento\ReCaptchaUi\Model\IsCaptchaEnabled), Object(Magento\Framework\App\Request\Http), Object(Magento\Framework\Logger\Monolog), 'adminhtml_index...', NULL, NULL) #3 C:\xampp\htdocs\m3\vendor\magento\framework\ObjectManager\Factory\Dynamic\Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\ReCaptc...', Array) #4

Re: Magento 2 admin login recaptcha error

Hi @Aveeva 


Trust you are doing well,


I think many issues are triggered during this. Rather than solving all these complicated questions, you must try Magento 2 hCaptcha Extension. It eventually helps in securing your frontend as well as backend pages.


Hope this helps you,

Problem solved? Hit the Kudos button and "Accept it as Solution"

Re: Magento 2 admin login recaptcha error

Hi @Aveeva,


If you use redis, run:

redis-cli flushall


If you also use an environment like ansible (lxc - server), you'll need to do that command in container. I did the following:

- Clear var/generation

- Clear var/cache

- Enable Magento modules: bin/magento module:enable --all

- Compile DI bin/magento setup:di:compile


Hope this can help you! Let me know if you need further assistance.


If issue solved, Click Kudos & Accept as Solution.

Marcus | LitExtension Expert