0

Upgraded site from drupal 9.5 to 10.2.2. After pulling update on server with git, everything is fine except for drush. My local machine (8.1.20) and server (8.1.21) both php 8.1, no global drush installed, I've grep'd for absolute paths in vendor, checked printenv, no old files leftover on server. I'm out of ideas, but I'm blaming composer :)

local: $ ./vendor/bin/drush --version Drush Commandline Tool 12.5.3.0

server: $ ./vendor/bin/drush --version PHP Fatal error: Uncaught Error: Class "Drush\DrupalFinder\DrushDrupalFinder" not found in /var/www/html/xxx/www/vendor/drush/drush/src/Preflight/Preflight.php:75 Stack trace: #0 /var/www/html/xxx/www/vendor/drush/drush/drush.php(135): Drush\Preflight\Preflight->__construct() #1 /var/www/html/xxx/www/vendor/drush/drush/drush(4): require('...') #2 /var/www/html/xxx/www/vendor/bin/drush(119): include('...') #3 {main} thrown in /var/www/html/xxx/www/vendor/drush/drush/src/Preflight/Preflight.php on line 75

11
  • Did you composer install after moving to this platform?
    – mona lisa
    Commented Aug 19 at 20:37
  • I did not. It has to pull from the git repo and run as is on all servers.
    – sapinva
    Commented Aug 19 at 20:42
  • You are blaming Composer yet you did not run it on the server. Did you in fact look to see if the class file for Drush\DrupalFinder\DrushDrupalFinder is among the files you deployed?
    – mona lisa
    Commented Aug 19 at 20:44
  • 2
    /var/www/html/xxx/www/vendor/drush is an unusual path, you would normally expect to find drush in /var/www/html/xxx/vendor. Maybe you have a custom solution which needs upgrading along with the Drupal version
    – Clive
    Commented Aug 19 at 20:49
  • 1
    It's not likely Composer is making assumptions, or doing anything wrong per se; barring bugs it will only do what it's told, and this doesn't sound like a bug. A typical modern Drupal installation has a composer.json above the web root, which is configured to install packages to vendor/, <webroot>/core, <webroot>/modules/contrib, and so on - seeing a <webroot>/vendor/ folder implies you're not following the usual practice, so it's difficult to advise
    – Clive
    Commented Aug 19 at 20:59

1 Answer 1

-1

Sometimes the drush upgrade recreates the file with incorrect permissions. You may need to run something like this to fix it: chmod 770 vendor/bin/drush

Or... I have also seen certain upgraded drush commands fail until a drush cr is run and the failed command is retried.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.