I got strange error while running command "php bin/magento setup:upgrade".
Error: We can't find the role for the user you wanted...
Unable to complete my all command process.
Please help.
in my case it was caused by Shopial_Facebook (which I do not need). I ran
php bin/magento module:disable Shopial_Facebook
cleared cache and the error was gone. I hope it helps.
Solution:
Please go to file: vendor/magento/module-authorization/Model/Acl/AclRetriever.php at line# 85 and edit below code into edit one:
Original Code:
if (!$role) {
throw new AuthorizationException(
__('We can\'t find the role for the user you wanted.')
);
}
$allowedResources = $this->getAllowedResourcesByRole($role->getId());
Edit Code:
if (!$role) {
$allowedResources = array();
}
Now, please run setup:upgrade and rest commands.
Important:
Once success, please revert back the file.
Thanks,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With