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

Composer 2x: Composer\DependencyResolver\SolverBugException #9078

Closed
mxr576 opened this issue Jul 27, 2020 · 7 comments
Closed

Composer 2x: Composer\DependencyResolver\SolverBugException #9078

mxr576 opened this issue Jul 27, 2020 · 7 comments
Assignees
Milestone

Comments

@mxr576
Copy link
Contributor

mxr576 commented Jul 27, 2020

I tried to update an existing site installed with "drupal/core": "^8.8.0" "drupal/core-dev": "^8.8.0", to Drupal 9 when I bumped into this issue.

My composer.json:

{
    "name": "drupal-composer/drupal-project",
    "description": "Project template for Drupal 8 projects with composer",
    "type": "project",
    "license": "GPL-2.0-or-later",
    "authors": [
        {
            "name": "",
            "role": ""
        }
    ],
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        {
            "type": "vcs",
            "url": "https://github.com/mxr576/composer-patches.git"
        }
    ],
    "require": {
        "php": ">=7.4",
        "composer/installers": "^1.2",
        "drupal/core": "^8.8.0 || ^9.0",
        "drupal/core-composer-scaffold": "^8.8.0",
        "drush/drush": "^9.7.1 | ^10.0.0",
        "mxr576/composer-patches": "^1.100",
        "vlucas/phpdotenv": "^4.0",
        "webflo/drupal-finder": "^1.0.0"
    },
    "require-dev": {
        "drupal/coder": "^8.3",
        "drupal/core-dev": "^8.8.0 || ^9.0",
        "pronovix/drupal-qa": "^2.8"
    },
    "conflict": {
        "drupal/drupal": "*"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "config": {
        "sort-packages": true
    },
    "autoload": {
        "classmap": [
            "scripts/composer/ScriptHandler.php"
        ],
        "files": ["load.environment.php"]
    },
    "scripts": {
        "pre-install-cmd": [
            "DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
        ],
        "pre-update-cmd": [
            "DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
        ],
        "post-install-cmd": [
            "DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
        ],
        "post-update-cmd": [
            "DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
        ]
    },
    "extra": {
        "composer-exit-on-patch-failure": true,
        "patchLevel": {
            "drupal/core": "-p2"
        },
        "drupal-scaffold": {
            "locations": {
                "web-root": "web/"
            }
        },
        "enable-patching": true,
        "patches": {
            "drupal/core": {
                "foo": "https://www.drupal.org/files/issues/2020-07-22/content_moderation-support-view-any-unpublished-entity-type-permission-3160748-3.patch"
            }
        },
        "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"]
        }
    }
}

Output of composer diagnose:

Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com oauth access: OK
Checking disk free space: OK
Checking pubkeys: FAIL
Missing pubkey for tags verification
Missing pubkey for dev verification
Run composer self-update --update-keys to set them up
Checking composer version: You are not running the latest stable version, run `composer self-update` to update (2.0.0-alpha2 => 1.10.9)
Composer version: 2.0.0-alpha2
PHP version: 7.4.4
PHP binary path: /usr/local/bin/php
OpenSSL version: OpenSSL 1.1.1d  10 Sep 2019

When I run this command:

composer update drupal/core-dev drupal/core --with-dependencies --ignore-platform-reqs

I get the following output:

The "dealerdirect/phpcodesniffer-composer-installer" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
The "pronovix/drupal-qa" plugin was skipped because it requires a Plugin API version ("^1.1") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
Gathering patches for root package.
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies                                                                                                                  Dependency "drupal/coder" is also a root requirement. Package has not been listed as an update argument, so keeping locked at old version. Use --with-all-dependencies to include root dependencies.
Dependency "composer/installers" is also a root requirement. Package has not been listed as an update argument, so keeping locked at old version. Use --with-all-dependencies to include root dependencies.

                                                                                                                                                           
  [Composer\DependencyResolver\SolverBugException]                                                                                                         
  Reached invalid decision id 0 while looking through (113) for a literal present in the analyzed rule (-113|8610|8611|8612|8613|8614|8615|8616|8617|8618  
  |8619|8620|8621|8622|8623|8624|8694|8695|8696|8697|8698|8699|8700|8701|8702|8703|8704|8705|8706|8707|8708|8709|8710|8711|8712|8713|8714|8715|8716|8717|  
  8718|8719|8720|8721|8722|8723|8724|8725|8726|8727|8728|8729|8730|8731|8732|8733|8734|8735|8736|8737|8738|8739|8740|8741|8742|8743|8744|8745|8746|8747|8  
  748|8749|8750|8751|8752|8753|8754|8755|8756|8757|8758|8759|8760|8761|8762|8763|8764|8765|8766|8767|8768|8769|8770|8771|8772|8773|8774|8775|8776|8777|87  
  78|8779|8780|8781|8782|8783|8784|8785|8786|8787|8788|8789|8790|8791|8792|8793|8794|8795|8796|8797|8798|8799|8800|8801|8802|8803|8804|8805|8806|8807|880  
  8|8809|8810|8811|8812|8813|8814|8815|8816|8817|8818|8819|8820|8821|8822|8823|8824|8825|8826|8827|8828|8829|8830|8831|8832|8833|8834|8835|8836|8837|8838  
  |8839|8840|8841|8842|8843|8844|8845|8846|8847|8848|8849|8850|8851|8852|8853|8854|8855|8856|8857|8858|8859|8860|8861|8862|8863|8864|8865|8866|8867|8868|  
  8869|8870|8871|8872|8873|8874|8875|8876|8877|8878|8879|8880|8881|8882|8883|8884|8885|8886|8887|8888|8889|8890|8891|8892|8893|8894|8895|8896|8897|8898|8  
  899|8900|8901|8902|8903|8904|8905|8906|8907|8908|8909|8910|8911|8912|8913|8914|8915|8916|8917|8918|8919|8920|8921|8922|8923|8924|8925|8926|8927|8928|89  
  29|8930|8931|8932|8933|8934|8935|8936|8937|8938|8939|8940|8941|8942|8943|8944|8945|11055|11060|11061|11062|11063|11064|11065|11066|11067|11068).         
  This exception was most likely caused by a bug in Composer.                                                                                              
  Please report the command you ran, the exact error you received, and your composer.json on https://github.com/composer/composer/issues - thank you!      
                                                                                                                                                           

update [--with WITH] [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-install] [--no-autoloader] [--no-scripts] [--no-suggest] [--no-progress] [--with-dependencies] [--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>]...
@mxr576
Copy link
Contributor Author

mxr576 commented Jul 28, 2020

Related: #9067

@mxr576 mxr576 changed the title Composer\DependencyResolver\SolverBugException Composer 2x: Composer\DependencyResolver\SolverBugException Jul 28, 2020
@Seldaek Seldaek added the Bug label Jul 29, 2020
@Seldaek Seldaek added this to the 2.0-core milestone Jul 29, 2020
@Seldaek Seldaek added the Solver label Jul 29, 2020
@jimrome
Copy link

jimrome commented Jul 29, 2020

I got this also

@jimrome
Copy link

jimrome commented Jul 29, 2020

And this prevents rollback from working. I had to reinstall composer 1
`[~/www]# composer self-update --rollback

Fatal error: Uncaught Error: Undefined class constant 'PRE_DEPENDENCIES_SOLVING' in /home/stelnews/public_html/vendor/wikimedia/composer-merge-plugin/src/MergePlugin.php:159
Stack trace:
#0 phar:///home/stelnews/public_html/composer/src/Composer/EventDispatcher/EventDispatcher.php(376): Wikimedia\Composer\MergePlugin::getSubscribedEvents()
#1 phar:///home/stelnews/public_html/composer/src/Composer/Plugin/PluginManager.php(315): Composer\EventDispatcher\EventDispatcher->addSubscriber(Object(Wikimedia\Composer\MergePlugin))
#2 phar:///home/stelnews/public_html/composer/src/Composer/Plugin/PluginManager.php(216): Composer\Plugin\PluginManager->addPlugin(Object(Wikimedia\Composer\MergePlugin))
#3 phar:///home/stelnews/public_html/composer/src/Composer/Plugin/PluginManager.php(379): Composer\Plugin\PluginManager->registerPackage(Object(Composer\Package\CompletePackage))
#4 phar:///home/stelnews/public_html/composer/src/Composer/Plugin/PluginManager.php(85): Composer\Plugin\PluginManager->loadRepository(Object(Composer\Reposito in /home/stelnews/public_html/vendor/wikimedia/composer-merge-plugin/src/MergePlugin.php on line 159`

@Seldaek
Copy link
Member

Seldaek commented Jul 29, 2020

@jimrome this is an unrelated issue IMO. Please report it in the composer-merge-plugin repo, it seems like they should use defined() to check for the PRE_DEPENDENCIES_SOLVING constant existing before assuming it does. Or maybe you still had the old version of the plugin which does not support composer 2? I'm not sure.

@jimrome
Copy link

jimrome commented Jul 29, 2020

Where do I do this? I'll be glad to.

@Seldaek
Copy link
Member

Seldaek commented Jul 29, 2020

At https://github.com/wikimedia/composer-merge-plugin/issues - but it seems wikimedia/composer-merge-plugin#184 is already tracking this issue.

@Seldaek
Copy link
Member

Seldaek commented Oct 21, 2020

This has now been fixed. You can try with the latest snapshot (composer self-update --snapshot) if you'd like to confirm.

@Seldaek Seldaek closed this as completed Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants