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

Recent deploy causes PHP Fatal Error #67

Open
tbutterf opened this issue May 9, 2024 · 4 comments
Open

Recent deploy causes PHP Fatal Error #67

tbutterf opened this issue May 9, 2024 · 4 comments

Comments

@tbutterf
Copy link

tbutterf commented May 9, 2024

The Drastically simplify using Composer Runtime API commit deployed to the master branch on May 8, 2024 is causing problems on Drupal 10 sites with Drush version 2.4.3. Composer builds properly, but when I try to run a Drush command, such as a cache-rebuild, I get the following error:

PHP Fatal error:  Uncaught TypeError: is_link(): Argument #1 ($filename) must be of type string, Drush\Config\Environment given in /var/www/html/vendor/webflo/drupal-finder/src/DrupalFinder.php:153
Stack trace:
#0 /var/www/html/vendor/webflo/drupal-finder/src/DrupalFinder.php(153): is_link(Object(Drush\Config\Environment))
#1 /var/www/html/vendor/webflo/drupal-finder/src/DrupalFinder.php(75): DrupalFinder\DrupalFinder->discoverRoots(Object(Drush\Config\Environment))
#2 /var/www/html/vendor/drush/drush/src/Preflight/Preflight.php(310): DrupalFinder\DrupalFinder->__construct(Object(Drush\Config\Environment))
#3 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(58): Drush\Preflight\Preflight->preflight(Array)
#4 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 /var/www/html/vendor/drush/drush/drush.php(139): Drush\Runtime\Runtime->run(Array)
#6 /var/www/html/vendor/drush/drush/drush(4): require('/var/www/html/v...')
#7 /var/www/html/vendor/bin/drush(119): include('/var/www/html/v...')
#8 {main}
  thrown in /var/www/html/vendor/webflo/drupal-finder/src/DrupalFinder.php on line 153
@tbutterf
Copy link
Author

tbutterf commented May 9, 2024

It looks like updating Drush to the latest supported version solves this issue.

@tbutterf
Copy link
Author

tbutterf commented May 9, 2024

However, sometimes updating Drush to the latest isn't possible or advisable. If a site is on Drupal 9, it can't run the latest (12.x) Drush version, since Drupal 9 uses the 11.x branch of Drush.

@FraserThompson
Copy link

We were experiencing this with Drush 12.4.3 and updating to the latest 12.x (12.5.2) fixed it. However as noted above, Drush 12.x isn't compatible with Drupal 9, so this workaround won't work for Drupal <10.

@tbutterf
Copy link
Author

I did some more testing in Drupal 9 with Drush 11.x, and it looks like Drush 11.x isn't affected by this issue. So, maybe nothing needs to be done?

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