Magento 2.x: Setup upgrade error “We can’t find the role for the user you wanted” – quick fix


If you are getting the error “We can’t find the role for the user you wanted”, while you are trying to do a php bin/magento setup:upgrade, the following workaround would help you.

go to file: vendor/magento/module-authorization/Model/Acl/AclRetriever.php at line# 85 and change original code into edit one:

Original code:

 

Edit code:

Then, run php bin/magento setup:upgrade.

IMPORTANT: Once success, please revert back the file.