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

Drush user:login fails #4870

Closed
kwfinken opened this issue Oct 27, 2021 · 2 comments
Closed

Drush user:login fails #4870

kwfinken opened this issue Oct 27, 2021 · 2 comments

Comments

@kwfinken
Copy link

Describe the bug
All other commands seem to work, but when I do a drush user:login I get a stack dump. Doing drush user:login --debug gives me:

 [preflight] Config paths: /opt/drupal/vendor/drush/drush/drush.yml
 [preflight] Alias paths: /opt/drupal/web/drush/sites,/opt/drupal/drush/sites
 [preflight] Commandfile search paths: /opt/drupal/vendor/drush/drush/src
 [debug] Starting bootstrap to none [0.07 sec, 9.35 MB]
 [debug] Drush bootstrap phase 0 [0.07 sec, 9.35 MB]
 [debug] Try to validate bootstrap phase 0 [0.07 sec, 9.35 MB]
 [debug] Drush bootstrap phase: bootstrapDrupalRoot() [0.07 sec, 9.38 MB]
 [debug] Change working directory to /opt/drupal/web [0.07 sec, 9.38 MB]
 [debug] Initialized Drupal 9.2.7 root directory at /opt/drupal/web [0.07 sec, 9.38 MB]
 [debug] Drush bootstrap phase: bootstrapDrupalSite() [0.07 sec, 9.78 MB]
 [debug] Initialized Drupal site default at sites/default [0.07 sec, 10.01 MB]
 [debug] Drush bootstrap phase: bootstrapDrupalConfiguration() [0.07 sec, 10 MB]
 [debug] Add service modifier [0.08 sec, 10.19 MB]
 [debug] Drush bootstrap phase: bootstrapDrupalDatabase() [0.08 sec, 11.32 MB]
 [debug] Successfully connected to the Drupal database. [0.08 sec, 11.32 MB]
 [debug] Drush bootstrap phase: bootstrapDrupalFull() [0.08 sec, 11.32 MB]
 [debug] Start bootstrap of the Drupal Kernel. [0.08 sec, 11.32 MB]
 [debug] Finished bootstrap of the Drupal Kernel. [0.16 sec, 19.51 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\config\ConfigCommands [0.27 sec, 34.54 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\config\ConfigExportCommands [0.27 sec, 34.57 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\config\ConfigImportCommands [0.28 sec, 34.58 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\BatchCommands [0.28 sec, 34.58 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\CliCommands [0.28 sec, 34.59 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\DrupalCommands [0.28 sec, 34.59 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\DeployHookCommands [0.28 sec, 34.61 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\EntityCommands [0.28 sec, 34.62 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\ImageCommands [0.28 sec, 34.64 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\JsonapiCommands [0.28 sec, 34.65 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\LanguageCommands [0.28 sec, 34.65 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\LocaleCommands [0.28 sec, 34.66 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\MessengerCommands [0.28 sec, 34.68 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\MigrateRunnerCommands [0.28 sec, 34.69 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\QueueCommands [0.28 sec, 34.74 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\RoleCommands [0.28 sec, 34.75 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\StateCommands [0.28 sec, 34.77 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\TwigCommands [0.28 sec, 34.79 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\UserCommands [0.29 sec, 34.8 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\ViewsCommands [0.29 sec, 34.84 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\core\WatchdogCommands [0.29 sec, 34.87 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\pm\PmCommands [0.29 sec, 34.9 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\pm\ThemeCommands [0.29 sec, 34.91 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeCommands [0.29 sec, 34.92 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeCommentsCommands [0.29 sec, 34.93 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeSessionsCommands [0.29 sec, 34.93 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeUserFieldsCommands [0.29 sec, 34.93 MB]
 [debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeUserTableCommands [0.29 sec, 34.93 MB]
 [debug] Add a commandfile class: Drupal\colorbox\Commands\ColorboxCommands [0.29 sec, 34.94 MB]
 [debug] Add a commandfile class: Drupal\devel\Commands\DevelCommands [0.29 sec, 34.94 MB]
 [debug] Add a commandfile class: Drupal\devel_entity_updates\Commands\DevelEntityUpdatesCommands [0.29 sec, 34.97 MB]
 [debug] Add a commandfile class: Drupal\entity_usage\Commands\EntityUsageCommands [0.29 sec, 34.98 MB]
 [debug] Add a commandfile class: Drupal\flood_control\Commands\FloodUnblockCommands [0.29 sec, 34.98 MB]
 [debug] Add a commandfile class: Drupal\search_api\Commands\SearchApiCommands [0.29 sec, 34.99 MB]
 [debug] Add a commandfile class: Drupal\search_api_solr\Commands\SearchApiSolrCommands [0.3 sec, 35.07 MB]
 [debug] Add a commandfile class: Drupal\search_api_solr_admin\Commands\SearchApiSolrAdminCommands [0.3 sec, 35.1 MB]
 [debug] Add a commandfile class: Drupal\search_api_solr_devel\Commands\SearchApiSolrDevelCommands [0.3 sec, 35.11 MB]
 [debug] Add a commandfile class: Drupal\token\Commands\TokenCommands [0.3 sec, 35.11 MB]
 [debug] Add a commandfile class: Drupal\ultimate_cron\Commands\UltimateCronCommands [0.3 sec, 35.12 MB]
 [debug] Add a commandfile class: Drupal\unused_modules\Commands\UnusedModulesCommands [0.3 sec, 35.14 MB]
 [debug] Add a commandfile class: Drupal\upgrade_status\Commands\UpgradeStatusCommands [0.3 sec, 35.15 MB]
 [debug] Add a commandfile class: Drupal\views_bulk_operations\Commands\ViewsBulkOperationsCommands [0.3 sec, 35.18 MB]
 [debug] Add a commandfile class: Drupal\webform\Commands\WebformCommands [0.3 sec, 35.19 MB]
 [debug] Add a commandfile class: Drupal\webform\Commands\WebformSanitizeSubmissionsCommands [0.3 sec, 35.25 MB]
 [debug] Add a commandfile class: Drupal\webform_devel\Commands\WebformDevelCommands [0.3 sec, 35.26 MB]
 [debug] Add a commandfile class: Drupal\webform_scheduled_email\Commands\WebformScheduledEmailCommands [0.3 sec, 35.26 MB]
 [debug] Add a commandfile class: Drupal\workbench_access\Commands\WorkbenchAccessCommands [0.3 sec, 35.27 MB]
 [debug] Add a commandfile class: Drupal\pathauto\Commands\PathautoCommands [0.3 sec, 35.27 MB]
 [error]  Error: Call to a member function id() on null in Drush\Commands\core\LoginCommands->login() (line 76 of /opt/drupal/vendor/drush/drush/src/Commands/core/LoginCommands.php) #0 [internal function]: Drush\Commands\core\LoginCommands->login('', Array)
#1 /opt/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
#2 /opt/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#3 /opt/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#4 /opt/drupal/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(313): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#5 /opt/drupal/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /opt/drupal/vendor/symfony/console/Application.php(1027): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /opt/drupal/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /opt/drupal/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /opt/drupal/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /opt/drupal/vendor/drush/drush/src/Runtime/Runtime.php(48): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /opt/drupal/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
#12 /opt/drupal/vendor/drush/drush/drush(4): require('/opt/drupal/ven...')
#13 {main}. [0.31 sec, 35.82 MB]
Error: Call to a member function id() on null in /opt/drupal/vendor/drush/drush/src/Commands/core/LoginCommands.php on line 76 #0 [internal function]: Drush\Commands\core\LoginCommands->login('', Array)
#1 /opt/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
#2 /opt/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#3 /opt/drupal/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#4 /opt/drupal/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(313): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#5 /opt/drupal/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /opt/drupal/vendor/symfony/console/Application.php(1027): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /opt/drupal/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /opt/drupal/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /opt/drupal/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /opt/drupal/vendor/drush/drush/src/Runtime/Runtime.php(48): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /opt/drupal/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
#12 /opt/drupal/vendor/drush/drush/drush(4): require('/opt/drupal/ven...')
#13 {main}
Error: Call to a member function id() on null in Drush\Commands\core\LoginCommands->login() (line 76 of /opt/drupal/vendor/drush/drush/src/Commands/core/LoginCommands.php).
 [warning] Drush command terminated abnormally. [0.32 sec, 36.18 MB]

To Reproduce
drush uli or drush user:login

Expected behavior
give me a login token for drupal user 1

Actual behavior
Error as shown above

Workaround
-None found-

System Configuration

Q A
Drush version? 11.0.0-dev (also tried with 10.6.1)
Drupal version? 9.2.7
PHP version 7.4.25
OS? Windows
@weitzman
Copy link
Member

weitzman commented Nov 7, 2021

looks like drush cant load user id 1. maybe you disabled that user for security. try to login as a different user.

@weitzman weitzman closed this as completed Nov 7, 2021
@kwfinken
Copy link
Author

kwfinken commented Nov 7, 2021

THANK YOU!! That was exactly the problem, your help was invaluable. I only wish there had been something in the errors that said it was a missing user.

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

2 participants