I am attempting to update a Drupal 9.5 site to Drupal 10. Upgrade status says 100% ready PHP is 8.1.25 Webserver is nginx 1.18 MYSQL is 8.0.35-0ubuntu0.22.04.1 - (Ubuntu)
Following instructions here: https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-or-later/upgrading-a-composer-based-site
The composer update step completes, then php errors.
Details. Composer gets this far...
68/68 [============================] 100%
In FilesystemRepository.php line 163:
file_get_contents(/srv/sid2/vendor/composer/composer/src/Composer/Repository/../InstalledVersions.php): Failed to open stream: No such file or
directory
After that, any Composer or Drush command I try to execute does this...(srv/sid2/web is the document root for the site)
PHP Warning:
require(/srv/sid2/vendor/composer/../guzzlehttp/promises/src/functions_include.php): Failed to open stream: No such file or directory in /srv/sid2/vendor/composer/autoload_real.php on line 82
PHP Fatal error: Uncaught Error: Failed opening required '/srv/sid2/vendor/composer/../guzzlehttp/promises/src/functions_include.php' (include_path='/srv/sid2/vendor/pear/archive_tar:/srv/sid2/vendor/pear/console_getopt:/srv/sid2/vendor/pear/pear-core-minimal/src:/srv/sid2/vendor/pear/pear_exception:.:/usr/share/php') in /srv/sid2/vendor/composer/autoload_real.php:82
Stack trace:
#0 /srv/sid2/vendor/composer/autoload_real.php(65): composerRequireadb589663ee65f2462c8612df87cae83()
#1 /srv/sid2/vendor/autoload.php(7): ComposerAutoloaderInitadb589663ee65f2462c8612df87cae83::getLoader()
#2 /srv/sid2/vendor/drush/drush/drush.php(58): include_once('...')
#3 /srv/sid2/vendor/drush/drush/drush(4): require('...')
#4 /srv/sid2/vendor/bin/drush(120): include('...')
#5 {main}
thrown in /srv/sid2/vendor/composer/autoload_real.php on line 82
The site does not load of course.
What has me thinking I have a php include_path problem is this part: (include_path='/srv/sid2/vendor/pear/archive_tar:/srv/sid2/vendor/pear/console_getopt:/srv/sid2/vendor/pear/pear-core-minimal/src:/srv/sid2/vendor/pear/pear_exception:.:/usr/share/php')
But I don't understand php and/or Composer well enough to know what's gone wrong here or what the include_path needs to be to allow PHP to find all the stuff it's looking for.
But maybe I'm on the wrong track?
The first error, failing to find InstalledVersions.php: The file exists, but it's in /vendor/composer/composer/src/Composer not /vendor/composer/composer/src/Composer/Repository/../ (By the way, what does "/../" mean?)
Composer info:
which composer
, outside any Drupal projects, returns: /usr/local/bin/composer
which composer
inside one of my other projects (not yet upgraded) returns ./vendor/bin/composer
composer why composer/composer
inside other projects returns
drupal/core-dev 9.5.0 requires composer/composer (^2.2.12)
Inside a working project, composer -V
indicates version 2.2.22.
Globally, I get 2.5.4
Inside the failed upgrade project, all composer commands (so far) result in the errors already noted above.