Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to change role using drush #4077

Closed
solomon123 opened this issue May 22, 2019 · 1 comment
Closed

Unable to change role using drush #4077

solomon123 opened this issue May 22, 2019 · 1 comment

Comments

@solomon123
Copy link

When I run the following drush command, found this error. my drush works fine except this user-add-role command.
$ drush urol "Administrator" 4, --mail=[email protected]
Drush\Role\RoleException: Could not find the role: Administrator in [error] /Applications/MAMP/htdocs/drupal/vendor/drush/drush/lib/Drush/Role/RoleBase.php:46
Stack trace:
#0 [internal function]: Drush\Role\RoleBase->__construct('Content Manager')
#1 /Applications/MAMP/htdocs/drupal/vendor/drush/drush/includes/drush.inc(117): ReflectionClass->newInstanceArgs(Array)
#2 /Applications/MAMP/htdocs/drupal/vendor/drush/drush/commands/core/role.drush.inc(274): drush_get_class('Drush\Role\Role', Array)
#3 /Applications/MAMP/htdocs/drupal/vendor/drush/drush/commands/user/user.drush.inc(282): drush_role_get_class('Content Manager')
#4 /Applications/MAMP/htdocs/drupal/vendor/drush/drush/includes/command.inc(422): drush_user_add_role('Content Manager')
#5 /Applications/MAMP/htdocs/drupal/vendor/drush/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#6 /Applications/MAMP/htdocs/drupal/vendor/drush/drush/includes/command.inc(199): drush_command('Content Manager')
#7 /Applications/MAMP/htdocs/drupal/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#8 /Applications/MAMP/htdocs/drupal/vendor/drush/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#9 /Applications/MAMP/htdocs/drupal/vendor/drush/drush/drush.php(12): drush_main()
#10 {main}

$ drush rls
this works fine, and list all the roles in my site.
I'm using Drush version: 8.1.18

I'm working on Drupal 8.7.1
I tried to use different roles the same error is showing. Other than this my drush works properly.
Thanks :)

@solomon123
Copy link
Author

Got it:- Syntax error. It should be as:
$ drush urol administrator [email protected]

to remove role:
$ drush urrol role_machine_name [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant