4

I have been doing development on Magento 2 since couple of months and suddenly my Admin panel stopped logging in and gives following error

a:4:{i:0;s:70:"Class Magento\Authorization\Model\Acl\Role\GroupFactory does not exist";i:1;s:6145:"#0 /var/www/html/Magento/vendor/magento/framework/ObjectManager/Definition/Runtime.php(44): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\\Authori...')
#1 /var/www/html/Magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(71): Magento\Framework\ObjectManager\Definition\Runtime->getParameters('Magento\\Authori...')
#2 /var/www/html/Magento/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Authori...')
#3 /var/www/html/Magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(126): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Authori...')
#4 /var/www/html/Magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'roleLoader', 'Magento\\Framewo...')
#5 /var/www/html/Magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(82): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Framewo...', Array, Array)
#6 /var/www/html/Magento/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')
#7 /var/www/html/Magento/var/generation/Magento/Framework/Acl/Builder/Proxy.php(84): Magento\Framework\ObjectManager\ObjectManager->get('\\Magento\\Framew...')
#8 /var/www/html/Magento/var/generation/Magento/Framework/Acl/Builder/Proxy.php(95): Magento\Framework\Acl\Builder\Proxy->_getSubject()
#9 /var/www/html/Magento/vendor/magento/module-backend/Model/Auth/Session.php(221): Magento\Framework\Acl\Builder\Proxy->getAcl()
#10 /var/www/html/Magento/var/generation/Magento/Backend/Model/Auth/Session/Interceptor.php(102): Magento\Backend\Model\Auth\Session->processLogin()
#11 /var/www/html/Magento/vendor/magento/module-backend/Model/Auth.php(156): Magento\Backend\Model\Auth\Session\Interceptor->processLogin()
#12 /var/www/html/Magento/vendor/magento/framework/Interception/Interceptor.php(146): Magento\Backend\Model\Auth->login('demo', 'demo1234')
#13 /var/www/html/Magento/var/generation/Magento/Backend/Model/Auth/Interceptor.php(78): Magento\Backend\Model\Auth\Interceptor->___callPlugins('login', Array, Array)
#14 /var/www/html/Magento/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(205): Magento\Backend\Model\Auth\Interceptor->login('demo', 'demo1234')
#15 /var/www/html/Magento/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(157): Magento\Backend\App\Action\Plugin\Authentication->_performLogin(Object(Magento\Framework\App\Request\Http))
#16 /var/www/html/Magento/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(125): Magento\Backend\App\Action\Plugin\Authentication->_processNotLoggedInUser(Object(Magento\Framework\App\Request\Http))
#17 /var/www/html/Magento/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#18 /var/www/html/Magento/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Backend...', 'dispatch', Object(Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor), Array, 'adminMassaction...')
#19 /var/www/html/Magento/vendor/magento/module-backend/App/Action/Plugin/MassactionKey.php(33): Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#20 /var/www/html/Magento/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Backend\App\Action\Plugin\MassactionKey->aroundDispatch(Object(Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#21 /var/www/html/Magento/var/generation/Magento/Backend/Controller/Adminhtml/Index/Index/Interceptor.php(39): Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->___callPlugins('dispatch', Array, Array)
#22 /var/www/html/Magento/vendor/magento/framework/App/FrontController.php(55): Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#23 /var/www/html/Magento/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#24 /var/www/html/Magento/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#25 /var/www/html/Magento/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install')
#26 /var/www/html/Magento/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#27 /var/www/html/Magento/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#28 /var/www/html/Magento/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#29 /var/www/html/Magento/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#30 /var/www/html/Magento/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#31 /var/www/html/Magento/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#32 {main}";s:3:"url";s:102:"/Magento/admin/admin/index/index/key/90e6d1a675a5403c95c9b99ef4b31af5b275b23a49a6b48136ad244e25b596bc/";s:11:"script_name";s:18:"/Magento/index.php";}

What is the issue and why can't I login?

5 Answers 5

4

Delete your var/generation , var/cache , var/page_cache folder.

After that run php bin/magento setup:di:compile command.

It will compile and generate the factory class and depended proxy classes.

Lastly clear the cache by php bin/magento cache:clean command

1

I am not sure what was the issue but after deleting content of var/generation folder, it worked

0

I had the same issue but my solution was to remove all site data/cookies from chrome.

See how to do that here developers.google.com

0

in my case the problem was incorrect file permissions. the solution:

# chown -R www-data.www-data /var/www

problem solved immediately

0

If you don't have clues, you may try below commands.

rm -r pub/static/**/*
rm -r generated/**/*
rm -r var/view_preprocessed/**/*
php bin/magento c:f

If you've messed up with permissions, try below commands

find . -type f -exec chmod 644 {} +
find . -type d -exec chmod 755 {} +
find var/ pub/static pub/media app/etc generated/ -type f -exec chmod g+w {} +
find var/ pub/static pub/media app/etc generated/ -type d -exec chmod g+ws {} +
chmod 640 app/etc/env.php
chmod -R g+s .

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.