I am running into the below issue :

The website encountered an unexpected error. Please try again later.InvalidArgumentException: Class "\Drupal\cognito\Form\Email\UserLoginForm" does not exist. in Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition() (line 24 of core/lib/Drupal/Core/DependencyInjection/ClassResolver.php).

  1. I installed the Cognito module.
  2. Its not properly built yet hence on installing it throws an error did not allow me to login into back end.
  3. I tried to manually uninstall the module by deleting the folder and then i cleared the cache through drush.
  4. Tried re-installing and un-installing the cognito module with Drush commands as well but still throws the same error.

But this is the error that i get even on clearing the cache.

2 Answers 2


You can't uninstall modules by deleting them. You need to run the uninstall routine. Via UI (which doesn't work in your case as you can't log in) or via CLI (Drush or Drupal Console).

  1. Put the module back.
  2. Uninstall it via Drush.
  3. Log in.

  1. drush pm:download cognito
  2. drush pm:uninstall cognito
  3. Log in.
  • I already did this multiple times but still throws the same error. Commented Sep 20, 2018 at 21:11
  • @JigneshRawal - Then you should add this info to your question.
    – leymannx
    Commented Sep 20, 2018 at 21:15

There was no better way of resolving this.Since i am using acquia cloud i had an option to restore my DB backup for a day prior. Acquia platform does take daily backup which turned out to be useful.

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.