Dependency problem externalauth

Created on 14 January 2022, over 2 years ago
Updated 31 January 2024, 5 months ago

Problem/Motivation

When adding the ldap requirement via composer, unsolvable dependency.

Environnment:
* Composer version 2.2.4 2022-01-08 12:30:42
* Debian 10
* PHP7.3

Steps to reproduce

  1. Clean install via composer ./composer.phar create-project drupal/recommended-project test-project
  2. Add authorization requirement composer.phar require drupal/authorization:^1.0@beta
  3. Add ldap requirement composer.phar require drupal/ldap
  4. Requirement fails

Detailed logs

./composer.phar create-project drupal/recommended-project test-project
Creating a "drupal/recommended-project" project at "./test-project"
Installing drupal/recommended-project (9.3.2)
  - Installing drupal/recommended-project (9.3.2): Extracting archive
Created project in /var/www/drupal/test-project
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Package operations: 62 installs, 0 updates, 0 removals
  - Installing composer/installers (v1.12.0): Extracting archive
composer/installers contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
Do you trust "composer/installers" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] y
  - Installing drupal/core-composer-scaffold (9.3.2): Extracting archive
drupal/core-composer-scaffold contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
Do you trust "drupal/core-composer-scaffold" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] y
  - Installing drupal/core-project-message (9.3.2): Extracting archive
drupal/core-project-message contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
Do you trust "drupal/core-project-message" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] y
  - Installing typo3/phar-stream-wrapper (v3.1.7): Extracting archive
  - Installing symfony/polyfill-mbstring (v1.23.1): Extracting archive
  - Installing symfony/polyfill-ctype (v1.23.0): Extracting archive
  - Installing twig/twig (v2.14.7): Extracting archive
  - Installing symfony/yaml (v4.4.34): Extracting archive
  - Installing symfony/polyfill-php80 (v1.23.1): Extracting archive
  - Installing symfony/var-dumper (v5.4.0): Extracting archive
  - Installing symfony/translation-contracts (v2.5.0): Extracting archive
  - Installing symfony/validator (v4.4.35): Extracting archive
  - Installing symfony/translation (v4.4.34): Extracting archive
  - Installing symfony/deprecation-contracts (v2.5.0): Extracting archive
  - Installing psr/container (1.1.1): Extracting archive
  - Installing symfony/service-contracts (v2.5.0): Extracting archive
  - Installing symfony/serializer (v4.4.35): Extracting archive
  - Installing symfony/routing (v4.4.34): Extracting archive
  - Installing symfony/polyfill-php72 (v1.23.0): Extracting archive
  - Installing symfony/polyfill-intl-normalizer (v1.23.0): Extracting archive
  - Installing symfony/polyfill-intl-idn (v1.23.0): Extracting archive
  - Installing symfony/mime (v5.4.0): Extracting archive
  - Installing symfony/http-foundation (v4.4.34): Extracting archive
  - Installing psr/http-message (1.0.1): Extracting archive
  - Installing symfony/psr-http-message-bridge (v2.1.2): Extracting archive
  - Installing symfony/process (v4.4.35): Extracting archive
  - Installing symfony/polyfill-iconv (v1.23.0): Extracting archive
  - Installing symfony/polyfill-php73 (v1.23.0): Extracting archive
  - Installing symfony/http-client-contracts (v2.5.0): Extracting archive
  - Installing symfony/event-dispatcher-contracts (v1.1.11): Extracting archive
  - Installing symfony/event-dispatcher (v4.4.34): Extracting archive
  - Installing psr/log (1.1.4): Extracting archive
  - Installing symfony/debug (v4.4.31): Extracting archive
  - Installing symfony/error-handler (v4.4.34): Extracting archive
  - Installing symfony/http-kernel (v4.4.35): Extracting archive
  - Installing symfony/dependency-injection (v4.4.34): Extracting archive
  - Installing symfony/console (v4.4.34): Extracting archive
  - Installing symfony-cmf/routing (2.3.4): Extracting archive
  - Installing stack/builder (v1.0.6): Extracting archive
  - Installing ralouphie/getallheaders (3.0.3): Extracting archive
  - Installing psr/http-factory (1.0.1): Extracting archive
  - Installing psr/cache (1.0.1): Extracting archive
  - Installing pear/pear_exception (v1.0.2): Extracting archive
  - Installing pear/console_getopt (v1.4.3): Extracting archive
  - Installing pear/pear-core-minimal (v1.10.11): Extracting archive
  - Installing pear/archive_tar (1.4.14): Extracting archive
  - Installing masterminds/html5 (2.7.5): Extracting archive
  - Installing laminas/laminas-stdlib (3.6.1): Extracting archive
  - Installing laminas/laminas-escaper (2.9.0): Extracting archive
  - Installing laminas/laminas-feed (2.15.0): Extracting archive
  - Installing laminas/laminas-diactoros (2.8.0): Extracting archive
  - Installing guzzlehttp/psr7 (1.8.3): Extracting archive
  - Installing guzzlehttp/promises (1.5.1): Extracting archive
  - Installing guzzlehttp/guzzle (6.5.5): Extracting archive
  - Installing doctrine/lexer (1.2.1): Extracting archive
  - Installing egulias/email-validator (3.1.2): Extracting archive
  - Installing doctrine/annotations (1.13.2): Extracting archive
  - Installing doctrine/reflection (1.2.2): Extracting archive
  - Installing composer/semver (3.2.6): Extracting archive
  - Installing asm89/stack-cors (1.3.0): Extracting archive
  - Installing drupal/core (9.3.2): Extracting archive
  - Installing drupal/core-recommended (9.3.2)
Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
Generating autoload files
41 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Scaffolding files for drupal/core:
  - Copy [project-root]/.editorconfig from assets/scaffold/files/editorconfig
  - Copy [project-root]/.gitattributes from assets/scaffold/files/gitattributes
  - Copy [web-root]/.csslintrc from assets/scaffold/files/csslintrc
  - Copy [web-root]/.eslintignore from assets/scaffold/files/eslintignore
  - Copy [web-root]/.eslintrc.json from assets/scaffold/files/eslintrc.json
  - Copy [web-root]/.ht.router.php from assets/scaffold/files/ht.router.php
  - Copy [web-root]/.htaccess from assets/scaffold/files/htaccess
  - Copy [web-root]/example.gitignore from assets/scaffold/files/example.gitignore
  - Copy [web-root]/index.php from assets/scaffold/files/index.php
  - Copy [web-root]/INSTALL.txt from assets/scaffold/files/drupal.INSTALL.txt
  - Copy [web-root]/README.md from assets/scaffold/files/drupal.README.md
  - Copy [web-root]/robots.txt from assets/scaffold/files/robots.txt
  - Copy [web-root]/update.php from assets/scaffold/files/update.php
  - Copy [web-root]/web.config from assets/scaffold/files/web.config
  - Copy [web-root]/sites/README.txt from assets/scaffold/files/sites.README.txt
  - Copy [web-root]/sites/development.services.yml from assets/scaffold/files/development.services.yml
  - Copy [web-root]/sites/example.settings.local.php from assets/scaffold/files/example.settings.local.php
  - Copy [web-root]/sites/example.sites.php from assets/scaffold/files/example.sites.php
  - Copy [web-root]/sites/default/default.services.yml from assets/scaffold/files/default.services.yml
  - Copy [web-root]/sites/default/default.settings.php from assets/scaffold/files/default.settings.php
  - Copy [web-root]/modules/README.txt from assets/scaffold/files/modules.README.txt
  - Copy [web-root]/profiles/README.txt from assets/scaffold/files/profiles.README.txt
  - Copy [web-root]/themes/README.txt from assets/scaffold/files/themes.README.txt
  * 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

  Congratulations, you’ve installed the Drupal codebase
  from the drupal/recommended-project template!


Next steps:
  * Install the site: https://www.drupal.org/docs/8/install
  * 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
  * 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

Then I add the authorization as suggested in #5 in issue 3227473 β†’ :

/var/www/drupal/test-project$ ../composer.phar require drupal/authorization:^1.0@beta
./composer.json has been updated
Running composer update drupal/authorization
Loading composer repositories with package information
Updating dependencies
Lock file operations: 2 installs, 0 updates, 0 removals
  - Locking drupal/authorization (1.0.0-beta6)
  - Locking drupal/externalauth (2.0.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
  - Installing drupal/externalauth (2.0.0): Extracting archive
  - Installing drupal/authorization (1.0.0-beta6): Extracting archive
Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
Generating autoload files
41 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

Up to here, everything is fine.

However, adding the ldap module, I get:

/var/www/drupal/test-project$ ../composer.phar require drupal/ldap
Using version ^4.3 for drupal/ldap
./composer.json has been updated
Running composer update drupal/ldap
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires drupal/ldap ^4.3 -> satisfiable by drupal/ldap[4.3.0].
    - drupal/ldap 4.3.0 requires drupal/externalauth ^1.0 -> found drupal/externalauth[1.0.0, ..., 1.4.0] but the package is fixed to 2.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require drupal/ldap:*" to figure out if any version is installable, or "composer require drupal/ldap:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Strangely, the problem seems to be externalauth, which was locked at 2.0, therefore ^1.0, but I'm not sure why this would not fit the requirement.

Pointers to what I missed would be much appreciated.

πŸ› Bug report
Status

Closed: duplicate

Version

4.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024