skip to Main Content

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.

2

Answers


  1. 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,

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search