Hello,

Today I set out to update my local (lando) "drupal/core-dev": "^10.0" site to drupal 10.1.5.

I ran : 

composer update "drupal/core-*" --with-all-dependencies

and got the following error message after completion : 

In FilesystemRepository.php line 165: file_get_contents(/app/vendor/composer/composer/src/Composer/Repository/../InstalledVersions.php): Failed to open stream: No such file or directory

Now my site is displaying 

Warning: require(/app/vendor/composer/../guzzlehttp/promises/src/functions_include.php): Failed to open stream: No such file or directory in /app/vendor/composer/autoload_real.php on line 59 Fatal error: Uncaught Error: Failed opening required '/app/vendor/composer/../guzzlehttp/promises/src/functions_include.php' (include_path='/app/vendor/pear/archive_tar:/app/vendor/pear/console_getopt:/app/vendor/pear/pear-core-minimal/src:/app/vendor/pear/pear_exception:.:/usr/local/lib/php') in /app/vendor/composer/autoload_real.php:59 Stack trace: #0 /app/vendor/composer/autoload_real.php(42): composerRequire4a20aba6ba4dc2db3a803bb6d66c77c7('c964ee0ededf28c...', '/app/vendor/com...') #1 /app/vendor/autoload.php(25): ComposerAutoloaderInit4a20aba6ba4dc2db3a803bb6d66c77c7::getLoader() #2 /app/web/autoload.php(16): require('/app/vendor/aut...') #3 /app/web/index.php(14): require_once('/app/web/autolo...') #4 {main} thrown in /app/vendor/composer/autoload_real.php on line 59

and I cannot run 

lando drush updatedb

I cannot find an explanation for this and I am totally stuck 

here is my composer file : 

{
    "name": "drupal/recommended-project",
    "description": "Project template for Drupal projects with a relocated document root",
    "type": "project",
    "license": "GPL-2.0-or-later",
    "homepage": "https://www.drupal.org/project/drupal",
    "support": {
        "docs": "https://www.drupal.org/docs/user_guide/en/index.html",
        "chat": "https://www.drupal.org/node/314178"
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    ],
    "require": {
        "composer/installers": "^2.0",
        "drupal/backup_migrate": "^5.0",
        "drupal/bootstrap_barrio": "^5.5",
        "drupal/core-composer-scaffold": "^10.0",
        "drupal/core-project-message": "^10.0",
        "drupal/core-recommended": "^10.0",
        "drupal/ctools": "^4.0",
        "drupal/devel": "^5.0",
        "drupal/devel_entity_updates": "^4.1",
        "drupal/field_group": "^3.4",
        "drupal/field_group_bootstrap": "^3.0",
        "drupal/google_tag": "^2.0",
        "drupal/pathauto": "^1.11",
        "drupal/restui": "^1.21",
        "drupal/simple_sitemap": "^4.1",
        "drush/drush": "^12.2"
    },
    "require-dev": {
        "drupal/core-dev": "^10.0"
    },
    "conflict": {
        "drupal/drupal": "*"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "config": {
        "allow-plugins": {
            "composer/installers": true,
            "drupal/core-composer-scaffold": true,
            "drupal/core-project-message": true,
            "phpstan/extension-installer": true,
            "dealerdirect/phpcodesniffer-composer-installer": true
        },
        "sort-packages": true
    },
    "extra": {
        "drupal-scaffold": {
            "locations": {
                "web-root": "web/"
            }
        },
        "installer-paths": {
            "web/core": ["type:drupal-core"],
            "web/libraries/{$name}": ["type:drupal-library"],
            "web/modules/contrib/{$name}": ["type:drupal-module"],
            "web/profiles/contrib/{$name}": ["type:drupal-profile"],
            "web/themes/contrib/{$name}": ["type:drupal-theme"],
            "drush/Commands/contrib/{$name}": ["type:drupal-drush"],
            "web/modules/custom/{$name}": ["type:drupal-custom-module"],
            "web/profiles/custom/{$name}": ["type:drupal-custom-profile"],
            "web/themes/custom/{$name}": ["type:drupal-custom-theme"]
        },
        "drupal-core-project-message": {
            "include-keys": ["homepage", "support"],
            "post-create-project-cmd-message": [
                "<bg=blue;fg=white>                                                         </>",
                "<bg=blue;fg=white>  Congratulations, you’ve installed the Drupal codebase  </>",
                "<bg=blue;fg=white>  from the drupal/recommended-project template!          </>",
                "<bg=blue;fg=white>                                                         </>",
                "",
                "<bg=yellow;fg=black>Next steps</>:",

                "  * Install the site: https://www.drupal.org/docs/installing-drupal",
                "  * Read the user guide: https://www.drupal.org/docs/user_guide/en/index.html",
                "  * Get support: https://www.drupal.org/support",
                "  * Get involved with the Drupal community:",
                "      https://www.drupal.org/getting-involved",
                "  * Remove the plugin that prints this message:",
                "      composer remove drupal/core-project-message"
            ]
        }
    }
}

Comments

apprentia’s picture

On checking the file : 

/app/vendor/composer/../guzzlehttp/promises/src/functions_include.php

is not there.

apprentia’s picture

I think that I have solved this with the following steps : 

  1. Deleted the vendor folder
  2. Deleted composer.lock
  3. Ran the command lando composer clearcache
  4. Ran lando composer install
  5. Ran lando drush updatedb

I'm not 100% certain why this has worked.. as in I don't know what happened for the vendor folder not to have all the necessary items... I'd love to understand what happened here...

melvix’s picture

Thank you so much for posting this solution! This worked for upgrading from 9.5 to 10.1.6.

slideaway’s picture

I've been banging my head off the wall for 2 days with getting ddev to work and this was it. This was my first time installing Drupal locally and I just couldn't figure out why it wouldn't find the twig templates. Thank you so much!

melvix’s picture

Although this solution worked for me for one site, on another site it did not.

Eventually I came to understand that the root of the problem was a conflict between the version of Composer running in Lando and the version installed in the vendor directory.

So I upgraded Composer in Lando by editing my .lando.yml file like this:

name: myappname
recipe: drupal9
config:
  webroot: web
  php: '8.2'
services:
  appserver:
    composer_version: "2.6.5"
tooling:
  composer:
    service: appserver
    cmd: php /usr/local/bin/composer

After making these changes, I used lando rebuild and then I was able to see the version change:

$ lando composer --version
Composer version 2.6.5 2023-10-06 10:11:52

Afterwards I was able to go through the normal upgrade steps without any errors.

If you leave out the tooling portion of the snippet you can still use the updated version of Composer, but you would do it like this:

$ lando php /usr/local/bin/composer

If you are not using Lando, you would simply upgrade the version of Composer that you have installed locally.

camilo.escobar’s picture

Thanks @melvix, you've hit the nail on the head.

kimble’s picture

This worked for me too. It was a life saver!

bob.hinrichs’s picture

I ran into a similar issue having updated my version of lando, tried some of these things and they did not work.

Make sure to remember the lando destroy command, this worked for my problem and has sometimes been necessary to clear up similar issues.