drush-ops / drush

Drush is a command-line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those who spend their working hours hacking away at the command prompt.
https://www.drush.org
2.33k stars 1.08k forks source link

drush core-cli throws InvalidArgumentException: Command name "" is invalid #4207

Open kbearcreation opened 4 years ago

kbearcreation commented 4 years ago

In a Drupal 8.7.7 installation on MacOS (MAMP Pro), with drush 8.3.0 installed using PHP 7.2.1, when I run drush core-cli or drush php I get the error below.

Error:

$ drush php
Symfony\Component\Console\Exception\InvalidArgumentException: Command name "" is invalid. in                                         [error]
/Applications/MAMP/htdocs/ctz/migrated8/releases/migrate/vendor/symfony/console/Command/Command.php:661
Stack trace:
#0 /Applications/MAMP/htdocs/ctz/migrated8/releases/migrate/vendor/symfony/console/Command/Command.php(423):
Symfony\Component\Console\Command\Command->validateName('')
#1 /Applications/MAMP/htdocs/ctz/migrated8/releases/migrate/vendor/drush/drush/lib/Drush/Psysh/DrushCommand.php(69):
Symfony\Component\Console\Command\Command->setName('')
#2 /Applications/MAMP/htdocs/ctz/migrated8/releases/migrate/vendor/symfony/console/Command/Command.php(77):
Drush\Psysh\DrushCommand->configure()
#3 /Applications/MAMP/htdocs/ctz/migrated8/releases/migrate/vendor/drush/drush/lib/Drush/Psysh/DrushCommand.php(45):
Symfony\Component\Console\Command\Command->__construct()
#4 /Applications/MAMP/htdocs/ctz/migrated8/releases/migrate/vendor/drush/drush/commands/core/cli.drush.inc(68):
Drush\Psysh\DrushCommand->__construct(Array)
#5 /Applications/MAMP/htdocs/ctz/migrated8/releases/migrate/vendor/drush/drush/includes/command.inc(422): drush_cli_core_cli()
#6 /Applications/MAMP/htdocs/ctz/migrated8/releases/migrate/vendor/drush/drush/includes/command.inc(231): _drush_invoke_hooks(Array,
Array)
#7 /Applications/MAMP/htdocs/ctz/migrated8/releases/migrate/vendor/drush/drush/includes/command.inc(199): drush_command()
#8 /Applications/MAMP/htdocs/ctz/migrated8/releases/migrate/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#9 /Applications/MAMP/htdocs/ctz/migrated8/releases/migrate/vendor/drush/drush/includes/preflight.inc(67):
Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#10 /Applications/MAMP/htdocs/ctz/migrated8/releases/migrate/vendor/drush/drush/drush.php(12): drush_main()
#11 {main}
dungahk commented 3 years ago

I'm getting the same issue using PHP 7.4 with all the Drush versions I tried so far, from 8.4.5 to 8.2.3

I'm installing Drush by downloading the phar file, example: https://github.com/drush-ops/drush/releases/download/8.2.3/drush.phar

Funny enough this is an EC2 instance that I created based on an image from another EC2 instance and on the original one Drush works fine.

I found this https://github.com/drush-ops/drush/issues/2959 but I'm not using vendor as it's a Drupal 7 site.

dungahk commented 3 years ago

It turns out it was caused by this https://www.drupal.org/project/advagg/issues/3155080 so maybe it's a similar or the same issue for you @kbearcreation ?