You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If you enter an invalid/ undefined alias on a drush command, you do not get a "Unknown alias" or similar error. Instead you get a PHP Fatal error: with no other explanation.
To Reproduce
The command:
drush @xxx.xxx status
Returns the PhP Fatal errors.
Also happens if the group is valid but site name is wrong, e.g. drush @my-sites.wrong-alias status
Expected behavior
The expected behavior would be just a message like:
[preflight] The alias @xxx.xxx could not be found.
Actual behavior
The command returns this error stack trace.
PHP Fatal error: Uncaught TypeError: Return value of Drush\Preflight\PreflightSiteLocator::determineSelf() must be an instance of Consolidation\SiteAlias\SiteAlias, bool returned in /app/vendor/drush/drush/src/Preflight/PreflightSiteLocator.php:68
Stack trace:
#0 /app/vendor/drush/drush/src/Preflight/PreflightSiteLocator.php(39): Drush\Preflight\PreflightSiteLocator->determineSelf(Object(Drush\Preflight\PreflightArgs), Object(Drush\Config\Environment), '/app/docroot') #1 /app/vendor/drush/drush/src/Preflight/Preflight.php(286): Drush\Preflight\PreflightSiteLocator->findSite(Object(Drush\Preflight\PreflightArgs), Object(Drush\Config\Environment), '/app/docroot') #2 /app/vendor/drush/drush/src/Runtime/Runtime.php(69): Drush\Preflight\Preflight->preflight(Array) #3 /app/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput)) #4 /app/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array) #5 /app/vendor/drush/drush/drush(3): require('/ in /app/vendor/drush/drush/src/Preflight/PreflightSiteLocator.php on line 68
Fatal error: Uncaught TypeError: Return value of Drush\Preflight\PreflightSiteLocator::determineSelf() must be an instance of Consolidation\SiteAlias\SiteAlias, bool returned in /app/vendor/drush/drush/src/Preflight/PreflightSiteLocator.php:68
Stack trace:
#0 /app/vendor/drush/drush/src/Preflight/PreflightSiteLocator.php(39): Drush\Preflight\PreflightSiteLocator->determineSelf(Object(Drush\Preflight\PreflightArgs), Object(Drush\Config\Environment), '/app/docroot') #1 /app/vendor/drush/drush/src/Preflight/Preflight.php(286): Drush\Preflight\PreflightSiteLocator->findSite(Object(Drush\Preflight\PreflightArgs), Object(Drush\Config\Environment), '/app/docroot') #2 /app/vendor/drush/drush/src/Runtime/Runtime.php(69): Drush\Preflight\Preflight->preflight(Array) #3 /app/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput)) #4 /app/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array) #5 /app/vendor/drush/drush/drush(3): require('/ in /app/vendor/drush/drush/src/Preflight/PreflightSiteLocator.php on line 68
Workaround
Drop back to Drush 10.
System Configuration
Q
A
Drush version?
11.1.1
Drupal version?
9.4.5
PHP version
7.4
OS?
Mac using Lando drupal9 setup. / Also tested in Acquia server shell - same result
Additional information
None.
The text was updated successfully, but these errors were encountered:
Describe the bug
If you enter an invalid/ undefined alias on a drush command, you do not get a "Unknown alias" or similar error. Instead you get a PHP Fatal error: with no other explanation.
To Reproduce
The command:
drush @xxx.xxx status
Returns the PhP Fatal errors.
Also happens if the group is valid but site name is wrong, e.g. drush @my-sites.wrong-alias status
Expected behavior
The expected behavior would be just a message like:
[preflight] The alias @xxx.xxx could not be found.
Actual behavior
The command returns this error stack trace.
PHP Fatal error: Uncaught TypeError: Return value of Drush\Preflight\PreflightSiteLocator::determineSelf() must be an instance of Consolidation\SiteAlias\SiteAlias, bool returned in /app/vendor/drush/drush/src/Preflight/PreflightSiteLocator.php:68
Stack trace:
#0 /app/vendor/drush/drush/src/Preflight/PreflightSiteLocator.php(39): Drush\Preflight\PreflightSiteLocator->determineSelf(Object(Drush\Preflight\PreflightArgs), Object(Drush\Config\Environment), '/app/docroot')
#1 /app/vendor/drush/drush/src/Preflight/Preflight.php(286): Drush\Preflight\PreflightSiteLocator->findSite(Object(Drush\Preflight\PreflightArgs), Object(Drush\Config\Environment), '/app/docroot')
#2 /app/vendor/drush/drush/src/Runtime/Runtime.php(69): Drush\Preflight\Preflight->preflight(Array)
#3 /app/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /app/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
#5 /app/vendor/drush/drush/drush(3): require('/ in /app/vendor/drush/drush/src/Preflight/PreflightSiteLocator.php on line 68
Fatal error: Uncaught TypeError: Return value of Drush\Preflight\PreflightSiteLocator::determineSelf() must be an instance of Consolidation\SiteAlias\SiteAlias, bool returned in /app/vendor/drush/drush/src/Preflight/PreflightSiteLocator.php:68
Stack trace:
#0 /app/vendor/drush/drush/src/Preflight/PreflightSiteLocator.php(39): Drush\Preflight\PreflightSiteLocator->determineSelf(Object(Drush\Preflight\PreflightArgs), Object(Drush\Config\Environment), '/app/docroot')
#1 /app/vendor/drush/drush/src/Preflight/Preflight.php(286): Drush\Preflight\PreflightSiteLocator->findSite(Object(Drush\Preflight\PreflightArgs), Object(Drush\Config\Environment), '/app/docroot')
#2 /app/vendor/drush/drush/src/Runtime/Runtime.php(69): Drush\Preflight\Preflight->preflight(Array)
#3 /app/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /app/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
#5 /app/vendor/drush/drush/drush(3): require('/ in /app/vendor/drush/drush/src/Preflight/PreflightSiteLocator.php on line 68
Workaround
Drop back to Drush 10.
System Configuration
Additional information
None.
The text was updated successfully, but these errors were encountered: