Solution for : “Fatal error: Uncaught Error: Call to a member function setActive() on boolean in magento2.2.0.dev

Some time we may get the blank frontend website when we use magento2.2.0.dev version. No data will be logged from log file or exception file. At a same time when you hit the admin page, we may get following error message.

Fatal error: Uncaught Error: Call to a member function setActive() on boolean in
\app\code\Magento\Backend\App\AbstractAction.php:138 Stack trace: #0
\app\code\Magento\User\Controller\Adminhtml\User\Role.php(94):
Magento\Backend\App\AbstractAction->_setActiveMenu(‘Magento_User::s…’) #1
\app\code\Magento\User\Controller\Adminhtml\User\Role\EditRole.php(27):
Magento\User\Controller\Adminhtml\User\Role->_initAction() #2
\lib\internal\Magento\Framework\App\Action\Action.php(107):
\app\code\Magento\Backend\App\AbstractAction.php on line 138

Exactly we coundn’t re-produce this issue. But in my case i got the issue when i execute the following commands
php bin/magento maintenance:enable;
php bin/magento setup:upgrade;
php bin/magento setup:di:compile;
php bin/magento setup:static-content:deploy -f;
php bin/magento cache:clean;
php bin/magento maintenance:disable

I got this after i execute the above 6 commands.

Solution:
Magento2.2.0.dev version onwards we can find one more new folder which is introduce by magento team. Folder name called “generated” in root the project. This is auto generated folder.  Delete “root/generated/metadata” folder & run the deploy command (again same folder will create). The website start works after delete the folder.

 

 

Leave a Reply