composer fail to upgrade from 8.4.4 to 8.5.0-alpha1

CommentFileSizeAuthor
#67 DrushUpdb.txt2.77 KBchrotto
#66 ComposerUpdate.txt2.68 KBchrotto

Comments

theroyal created an issue. See original summary.

larowlan’s picture

Status: Active » Postponed (maintainer needs more info)

Please provide some more detail or output

theroyal’s picture

I have Drupal 8.4.4 installed via composer using :
composer create-project drupal-composer/drupal-project:8.x-dev some-dir --stability dev --no-interaction

and now I wanted to upgrade to 8.5 alpha or beta,
I used update and used require but I failed :
below is a copy of my last try on terminal :
=================================
$ composer require "drupal/core:8.5.0-beta1"
./composer.json has been updated
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for drupal/core 8.5.0-beta1 -> satisfiable by drupal/core[8.5.0-beta1].
- Conclusion: remove symfony/class-loader v3.2.14
- Conclusion: don't install symfony/class-loader v3.2.14
- drupal/core 8.5.0-beta1 requires symfony/class-loader ~3.4.0 -> satisfiable by symfony/class-loader[3.4.x-dev, v3.4.0, v3.4.0-BETA1, v3.4.0-BETA2, v3.4.0-BETA3, v3.4.0-BETA4, v3.4.0-RC1, v3.4.0-RC2, v3.4.1, v3.4.2, v3.4.3, v3.4.4].
- Can only install one of: symfony/class-loader[3.4.x-dev, v3.2.14].
- Can only install one of: symfony/class-loader[3.4.x-dev, v3.2.14].
- Can only install one of: symfony/class-loader[v3.4.0, v3.2.14].
- Can only install one of: symfony/class-loader[v3.4.0-BETA1, v3.2.14].
- Can only install one of: symfony/class-loader[v3.4.0-BETA2, v3.2.14].
- Can only install one of: symfony/class-loader[v3.4.0-BETA3, v3.2.14].
- Can only install one of: symfony/class-loader[v3.4.0-BETA4, v3.2.14].
- Can only install one of: symfony/class-loader[v3.4.0-RC1, v3.2.14].
- Can only install one of: symfony/class-loader[v3.4.0-RC2, v3.2.14].
- Can only install one of: symfony/class-loader[v3.4.1, v3.2.14].
- Can only install one of: symfony/class-loader[v3.4.2, v3.2.14].
- Can only install one of: symfony/class-loader[v3.4.3, v3.2.14].
- Can only install one of: symfony/class-loader[v3.4.4, v3.2.14].
- Installation request for symfony/class-loader (locked at v3.2.14) -> satisfiable by symfony/class-loader[v3.2.14].

Installation failed, reverting ./composer.json to its original content.

larowlan’s picture

What if you try composer update "drupal/core" --with-dependencies

If that doesn't work, something you have installed requires a version of classloader incompatible with Drupal 8.5

composer why symfony/classloader will show you what that is.

theroyal’s picture

1- I did try update before require and here what I got :
================
$ composer update drupal/core --with-dependencies
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 3 updates, 0 removals
- Updating symfony/polyfill-mbstring (v1.6.0 => v1.7.0): Downloading (100%) - Updating symfony/polyfill-iconv (v1.6.0 => v1.7.0): Downloading (100%) - Updating symfony/debug (v3.4.3 => v3.4.4): Downloading (100%)
Writing lock file
Generating autoload files
> DrupalProject\composer\ScriptHandler::createRequiredFile
=====================

2- and upon your advice I ran : composer why symfony/classloader
and here what I got :
========================
$ composer why symfony/classloader

[InvalidArgumentException]
Could not find package "symfony/classloader" in your project

depends [-r|--recursive] [-t|--tree] [--]
[]
========================

larowlan’s picture

$ composer update drupal/core --with-dependencies
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 3 updates, 0 removals
- Updating symfony/polyfill-mbstring (v1.6.0 => v1.7.0): Downloading (100%) - Updating symfony/polyfill-iconv (v1.6.0 => v1.7.0): Downloading (100%) - Updating symfony/debug (v3.4.3 => v3.4.4): Downloading (100%)
Writing lock file
Generating autoload files
> DrupalProject\composer\ScriptHandler::createRequiredFile

Did that not update?

Sorry, I spelled it wrong

composer why symfony/class-loader

larowlan’s picture

theroyal’s picture

no it did not update, because there is nothing to be updated,
coz the current 8.4.4 is the latest in 8.4 branches.

and what I need is upgrade from 8.4 to 8.5

==============

$ composer why symfony/class-loader
drupal/core  8.4.4  requires  symfony/class-loader (~3.2.8)  
theroyal’s picture

$ composer remove symfony/class-loader
symfony/class-loader is not required in your composer.json and has not been removed
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
> DrupalProject\composer\ScriptHandler::createRequiredFiles
-sh-4.2$ composer require "symfony/class-loader:~3.4.0"
./composer.json has been updated
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for symfony/class-loader ~3.4.0 -> satisfiable by symfony/class-loader[3.4.x-dev, v3.4.0, v3.4.0-BETA1, v3.4.0-BETA2, v3.4.0-BETA3, v3.4.0-BETA4, v3.4.0-RC1, v3.4.0-RC2, v3.4.1, v3.4.2, v3.4.3, v3.4.4].
    - drupal/core 8.4.4 requires symfony/class-loader ~3.2.8 -> satisfiable by symfony/class-loader[3.2.x-dev].
    - drupal/core 8.4.4 requires symfony/class-loader ~3.2.8 -> satisfiable by symfony/class-loader[3.2.x-dev].
    - drupal/core 8.4.4 requires symfony/class-loader ~3.2.8 -> satisfiable by symfony/class-loader[3.2.x-dev].
    - Conclusion: don't install symfony/class-loader 3.2.x-dev
    - Installation request for drupal/core (locked at 8.4.4, required as ~8.4) -> satisfiable by drupal/core[8.4.4].


Installation failed, reverting ./composer.json to its original content.
-sh-4.2$ composer require "symfony/class-loader:~3.2.8"
./composer.json has been updated
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Writing lock file
Generating autoload files
> DrupalProject\composer\ScriptHandler::createRequiredFiles
-sh-4.2$ composer update symfony/class-loader
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
> DrupalProject\composer\ScriptHandler::createRequiredFiles




-sh-4.2$ composer why symfony/class-loader
drupal-composer/drupal-project  -      requires  symfony/class-loader (~3.2.8)  
drupal/core                     8.4.4  requires  symfony/class-loader (~3.2.8)  
-sh-4.2$ 
larowlan’s picture

Right, I guess your minimum stability prevents updating to alpha
Try
composer require "drupal/core:~8.5" --update-with-dependencies

theroyal’s picture

I got this :

$ composer require "drupal/core:~8.5" --update-with-dependencies
./composer.json has been updated
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Dependency "symfony/class-loader" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install drupal/core 8.5.0-beta1
    - Conclusion: don't install drupal/core 8.5.0-alpha1
    - Conclusion: don't install drupal/core 8.6.x-dev
    - Conclusion: remove symfony/class-loader v3.2.14
    - Installation request for drupal/core ~8.5 -> satisfiable by drupal/core[8.5.0-alpha1, 8.5.0-beta1, 8.5.x-dev, 8.6.x-dev].
    - Conclusion: don't install symfony/class-loader v3.2.14
    - drupal/core 8.5.x-dev requires symfony/class-loader ~3.4.0 -> satisfiable by symfony/class-loader[3.4.x-dev].
    - Can only install one of: symfony/class-loader[3.4.x-dev, v3.2.14].
    - Can only install one of: symfony/class-loader[3.4.x-dev, v3.2.14].
    - Installation request for symfony/class-loader (locked at v3.2.14, required as ~3.2.8) -> satisfiable by symfony/class-loader[v3.2.14].


Installation failed, reverting ./composer.json to its original content.
berdir’s picture

--update-with-all-dependencies from composer 1.6 might help, but I usually just update composer.json and then run composer update. That will of course update everything.

theroyal’s picture

what do you mean by "update composer.json" ?
do you mean edit certain values manual? then run the update drupal/core ?

berdir’s picture

Yes, exactly, edit the drupal/core row by hand, then run composer update *without* any arguments.

theroyal’s picture

Berdir Thanks so much, I edited the composer.json file
but I spent the whole day just trying different ways,
I did't know that the command is that simple:
composer update
this all what I did
Thanks for this useful video, at this part he uses this command,

https://youtu.be/dpdnfPqlvB0?t=1183

theroyal’s picture

@Bedir :) I just got your advice after re-reading your comment.
and yes, yourt way was the right one, thanks so much.

larowlan’s picture

Status: Postponed (maintainer needs more info) » Fixed

Thanks @theroyal - glad you got it working.

Thanks for testing the beta, hope it goes well.

theroyal’s picture

yes, I think it is working,
I forgot to thank you too,
Thanks,

but now since I messed a lot, I prefer to restart from a clean installation,
then re-do the update to 8.5.0-beta1 again.

Thanks for your time.

eiriksm’s picture

Just a quick note here:

I had the same problem, and I was a bit surprised to learn about the proposed solution.

You see, if you run composer update with no arguments, *all* of your dependencies will be attempted to be upgraded. Which might by pure coincidence be what you want, but for me it was not the case. I wanted to upgrade drupal core.

So my recommendation is to not run composer update with no arguments, unless you are 100% sure you know what this does, and you know this is what you want to do.

The problem of upgrading here, is somewhat of a catch 22. You can not install drupal 8.5 because it requires symfony 3.4, and you can not install symfony 3.4 because you have 3.2 since 8.4 requires this. You also cannot simply say "--update-with-dependencies", since the version resolution will complain about this long before the dependencies starts to upgrade.

The solution to this problem is to update core and symfony at the same time. So in theory you could say update drupal/core +, but since so many of them rely on symfony/config, this simple command fixed it for me:

composer update drupal/core symfony/config --with-dependencies

It still requires you to either manually or by requiring, to set your wanted drupal/core in composer.json to a 8.5 compatible constraint. For me, today, that was 8.5.0-rc1

Hope that helps someone!

berdir’s picture

Yes, compoer update updates everything and doing it as you suggested is the better option if you want to limit what you are updating.

The problem of upgrading here, is somewhat of a catch 22. You can not install drupal 8.5 because it requires symfony 3.4, and you can not install symfony 3.4 because you have 3.2 since 8.4 requires this.

It's actually even more complex than that. It only complains about symfony/config not symfony as a whole. Drupal core depends on a whole bunch of symfony dependencies but *not* symfony/config. It's other things like behat that require symfony/config.

So composer is able to resolve all explicit dependencies of drupal/core and wants to update them too, but it doesn't update symfony/config because that is *not* a dependency, but symfony/config 3.2 conflicts with other symfony 3.4 packages.

Conclusion: package managers and dependencies is a hard problem to solve.

eiriksm’s picture

Ah, right. I did not realize that. Then it makes more sense that my more straightforward attempts did not work before I got a bit more creative :)

Conclusion: package managers and dependencies is a hard problem to solve.

Very much so. And thanks for clarifying. Hope the combined info in this thread is of help to someone :)

larowlan’s picture

Drupal core depends on a whole bunch of symfony dependencies but *not* symfony/config.

Yep, your issue is likely with something like console or drush.

We removed console from most of our not-under-active-development projects as part of the 8.3 to 8.4 update for similar reasons.

If you're not actively developing new features and no longer require console's features, you're probably better off removing it.

Just like the old 'remove modules you no longer need' adage, the same applies for composer dependencies.

plato1123’s picture

So is the only way to do this update at present is to edit the composer.json file per #14?

edit: that did work great, btw, editing the drupal line in composer.json to

"drupal/core": "~8.5",

and then running composer update

theroyal’s picture

this is the perfect solution :

The solution to this is pretty simple:

Open your composer.json file
and replace the lines for
drupal/core
and webflo/drupal-core-require-dev
with the following:
"drupal/core": "~8.5"
// ...and
"webflo/drupal-core-require-dev": "~8.5"

Afterwards you can go ahead and run:

composer update drupal/core webflo/drupal-core-require-dev --with-dependencies

taken from this blog :
https://orkjern.com/updating-to-drupal-85-with-composer

bdanin’s picture

Thank you @eiriksm, composer update drupal/core symfony/config --with-dependencies worked well for me after manually updating composer.json to require "drupal/core": "8.5.0",

rshafakian’s picture

I've tried a lot of what's been suggested here, but I still cannot get it to work. I'm trying to update from 8.4.2 to 8.5

I've done a lot of variations but still can't update it. Here's what i get when I do

composer update drupal/core --with-dependencies

Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for symfony/yaml (locked at v3.2.14, required as ~3.2.8) -> satisfiable by symfony/yaml[v3.2.14].
- drupal/core 8.5.0 requires symfony/yaml ~3.4.5 -> satisfiable by symfony/yaml[3.4.x-dev].
- drupal/core 8.5.0-alpha1 requires symfony/yaml ~3.4.0 -> satisfiable by symfony/yaml[3.4.x-dev].
- drupal/core 8.5.0-beta1 requires symfony/yaml ~3.4.0 -> satisfiable by symfony/yaml[3.4.x-dev].
- drupal/core 8.5.0-rc1 requires symfony/yaml ~3.4.0 -> satisfiable by symfony/yaml[3.4.x-dev].
- drupal/core 8.5.x-dev requires symfony/yaml ~3.4.5 -> satisfiable by symfony/yaml[3.4.x-dev].
- drupal/core 8.6.x-dev requires symfony/yaml ~3.4.5 -> satisfiable by symfony/yaml[3.4.x-dev].
- Conclusion: don't install symfony/yaml 3.4.x-dev
- Installation request for drupal/core ^8.5 -> satisfiable by drupal/core[8.5.0, 8.5.0-alpha1, 8.5.0-beta1, 8.5.0-rc1, 8.5.x-dev, 8.6.x-dev].

thank you in advance

Malkiyahu’s picture

I had the same problem updating to 8.5.0 and the solution in #19 worked for me without touching composer.json.

I did not manually edit composer.json, I just ran

composer update drupal/core symfony/config --with-dependencies

and it worked.

theroyal’s picture

yes #19 will work coz you are updating to a stable release.
but for alpha and beta I blv #24 is the solution

technotim2010’s picture

I have the same issue as in#26
The fix was as follows

rm -rf vendor,
rm composer.lock
composer update drupal/core --with-dependencies

I had to do this from I think 8.2.x to 8.3

This has worked

Tim

berdir’s picture

If you delete the lock file then you could just as well do a full composer update, should result in the same.

This is really more of a drupal-composer issue than drupal core as all the problems here are due to additional dependencies (for example because of drupal/console depending on symfony/config or drupal-core-require-dev).

I'd suggest to add some documentation to the FAQ on https://github.com/drupal-composer/drupal-project. With github, that's as simple as editing the README file right there and submitting that as a pull request.

abx’s picture

What I did is by renamed composer.json in core directory to anything else.

Then, cd back to drupal root directory and run composer update from there. Then, it works.

Normal installation, we have composer.json under root that has below text :

        "merge-plugin": {
            "include": [
                "core/composer.json"
            ],

That is ... we also have core/composer.json too. In core/composer.json has a lot of requirement about Symfony that has specific version. Rename or delete that core/composer.json will make the update work.

fy1128’s picture

#31 you had saved my life.

mstef’s picture

#31 (deleting core/composer.json) works. thanks!

Edit: All composer calls afterwards fail now with:

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- The requested package symfony/css-selector (locked at v3.2.8, required as ^3.4.0) is satisfiable by symfony/css-selector[v3.2.8] but these conflict with your requirements or minimum-stability.
Problem 2
- The requested package symfony/phpunit-bridge (locked at v3.2.8, required as ^3.4.3) is satisfiable by symfony/phpunit-bridge[v3.2.8] but these conflict with your requirements or minimum-stability.

Installation failed, reverting ./composer.json to its original content.

Looks like an additional (composer update symfony/css-selector symfony/phpunit-bridge) works.

brulain’s picture

I wanted to upgrade from 8.4.5 to 8.5.0 via composer. Here is the result:

macbook-pro:drupal8training bruno$ composer update drupal/core --with-dependencies
> DrupalProject\composer\ScriptHandler::checkComposerVersion
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 3 updates, 0 removals
- Updating twig/twig (v1.35.0 => v1.35.2): Downloading (100%)
- Updating symfony/debug (v3.4.4 => v3.4.6): Downloading (100%)
- Updating zendframework/zend-diactoros (1.7.0 => 1.7.1): Downloading (100%)
Writing lock file
Generating autoload files
Removing packages services cache file:
/Applications/MAMP/htdocs/drupal8training/vendor/drupal/console/extend.console.uninstall.services.yml
Creating packages services cache file:
/Applications/MAMP/htdocs/drupal8training/vendor/drupal/console/extend.console.uninstall.services.yml
> DrupalProject\composer\ScriptHandler::createRequiredFiles

Drupal version is still 8.4.5.
Thanks for help.

eiriksm’s picture

To debug why it does not update you can try composer why-not drupal/core:8.5.0

This could give you a somehow conflicting result, but it might for example indicate that you have an old version of symfony/config installed, that conflicts with another symfony component required by drupal.

If this is the case, you might want to try composer update drupal/core symfony/config --with-dependencies. You might have another package that is causing this problem, or you might have several packages that is causing the problem. If there are more (you can run the why-not command again), you can try to add those to the list of updates.

Good luck!

vvvi’s picture

Thanks @eiriksm , seems #35 is most clean solution. I have updated to 8.5 with composer update drupal/core symfony/config webflo/drupal-core-require-dev --with-dependencies .

brulain’s picture

Thanks @eiriksm
I updated composer.json entry "drupal/core" from "~8.4" to "^8.5".
Then I removed core, vendor and composer.lock.
Finally I ran $ composer update drupal/core --with-dependencies.
Worked fine.

berdir’s picture

Running "composer update drupal/core" only makes sense if you do *not* delete the composer.lock.

Running composer with some arguments means update those packages (and their dependencies) but keep everything else *as specified in the lock file*. If you have no composer.lock file, then composer has no choice but to update everything as it doesn't know anymore what was installed before. If you do want to update everything, just run composer update and you're done, no need to delete anything first (not when using drupal/core aka drupal-project).

If you do *not* want to update everything, then follow the instructions on https://github.com/drupal-composer/drupal-project/#updating-drupal-core, that should work for basically everyone now who uses drupal-project, without any need to manually delete anything.

brulain’s picture

Thanks @Berdir for these precisions.
Best.

ugintl’s picture

@Berdir Does it mean we do not even have to edit anything? Like said in #37?

Just running "composer update" will work? I am currently running 8.4.5

berdir’s picture

That depends on your version constraint in your composer.json. See https://getcomposer.org/doc/articles/versions.md#next-significant-releas.... For example, "~8.4" or "^8.4" or "^8.4.0" all allow to update to 8.5 without any changes in the composer.json when using either composer update without arguments or the command documented in the drupal-project README. However, "8.4.5", "~8.4.0" or "8.4.*" all do not allow to update to 8.5.0 without adjusting it.

Use what makes sense for you, Use one of the first group if you want to be able to just run a single composer update and update to the latest minor version. If you want to make it a conscious decision to update and having to update the composer.json to do so, then pick one of the others.

hugronaphor’s picture

I did as following:
composer version: 1.6.3

- Removed the vendor/ directory
- Changed the "symfony/class-loader" version to "~3.4.0" in core/composer.json
- Ran composer update in core/ directory
- Then, edited the drupal version to "^8.5" in root's composer.json and ran composer update

geerlingguy’s picture

I've tried `composer update drupal/core --with-dependencies` and `composer update drupal/core --with-all-dependencies`, and my drupal/core version constraint is ~8.4.

In either case Drupal core remains what it was (currently 8.4.5) in the composer.lock file.

If I go nuclear and run composer update, drupal/core updates to 8.5.0.

If I run composer prohibits drupal/core:8.5.0, then I get:

drupal/core                     8.5.0       requires          symfony/class-loader (~3.4.0)                            
drupal-composer/drupal-project  dev-master  does not require  symfony/class-loader (but v3.2.14 is installed)          
drupal/core                     8.5.0       requires          symfony/console (~3.4.0)                                 
drupal-composer/drupal-project  dev-master  does not require  symfony/console (but v3.2.14 is installed)               
drupal/core                     8.5.0       requires          symfony/dependency-injection (~3.4.0)                    
drupal-composer/drupal-project  dev-master  does not require  symfony/dependency-injection (but v3.2.14 is installed)  
drupal/core                     8.5.0       requires          symfony/event-dispatcher (~3.4.0)                        
drupal-composer/drupal-project  dev-master  does not require  symfony/event-dispatcher (but v3.2.14 is installed)      
drupal/core                     8.5.0       requires          symfony/http-foundation (~3.4.0)                         
drupal-composer/drupal-project  dev-master  does not require  symfony/http-foundation (but v3.2.14 is installed)       
drupal/core                     8.5.0       requires          symfony/http-kernel (~3.4.0)                             
drupal-composer/drupal-project  dev-master  does not require  symfony/http-kernel (but v3.2.14 is installed)           
drupal/core                     8.5.0       requires          symfony/process (~3.4.0)                                 
drupal-composer/drupal-project  dev-master  does not require  symfony/process (but v3.2.14 is installed)               
drupal/core                     8.5.0       requires          symfony/routing (~3.4.0)                                 
drupal-composer/drupal-project  dev-master  does not require  symfony/routing (but v3.2.14 is installed)               
drupal/core                     8.5.0       requires          symfony/serializer (~3.4.0)                              
drupal-composer/drupal-project  dev-master  does not require  symfony/serializer (but v3.2.14 is installed)            
drupal/core                     8.5.0       requires          symfony/translation (~3.4.0)                             
drupal-composer/drupal-project  dev-master  does not require  symfony/translation (but v3.2.14 is installed)           
drupal/core                     8.5.0       requires          symfony/validator (~3.4.0)                               
drupal-composer/drupal-project  dev-master  does not require  symfony/validator (but v3.2.14 is installed)             
drupal/core                     8.5.0       requires          symfony/yaml (~3.4.5)                                    
drupal-composer/drupal-project  dev-master  does not require  symfony/yaml (but v3.2.14 is installed)

I seem to remember the same thing happening with Drupal 8.3.x to 8.4.0 when I attempted the upgrade with Composer. Full composer.json and lock file and everything else is public here: https://github.com/geerlingguy/drupalvm-live

Is there any way to solve this chicken-and-egg problem? Basically, Drupal core requires all these later symfony dependencies, but even when updating --with-all-dependencies none of those deps are updated, therefore Drupal core isn't updated.

cilefen’s picture

Did you try to require drupal/core:~8.5 --update-with-dependencies?

Caveat: I’m typing this on a phone

eiriksm’s picture

As Berdir explains in #20, the problem is that your project gets symfony/config installed (drush / drupal console and behat requires this).

When you try to update drupal/core it has a conflict with that symfony component, because it is not listed for upgrade.

To answer your question (it seems you ended up going nuclear in that repo): You can update by running the following command:

composer update drupal/core symfony/config --with-dependencies

geerlingguy’s picture

@eiriksm - Using composer update drupal/core symfony/config --with-dependencies worked! All the other symfony components, as well as Drupal core, were upgraded.

So... the question is, how did you determine I just had to add symfony/config and not type out all the other 13 or so symfony dependencies?

(This seems to be a recurring issue all over the place since most projects require drush/drush and/or drupal/console, so I've also added as much info in an answer on the Drupal stack exchange here: Updating packages with composer and knowing what to update.)

berdir’s picture

Because it's almost always symfony/config as that's the only one that drupal/core itself does not directly depend on.

Again. The recommended command is documented on https://github.com/drupal-composer/drupal-project/#updating-drupal-core and is:

composer update drupal/core webflo/drupal-core-require-dev symfony/* --with-dependencies

geerlingguy’s picture

@Berdir - Thanks for that; I didn't realize the command for drupal-project-based projects was different than the one recommended in the official docs :(

I think I'm going to add something to the docs page at least mentioning "what to do if drupal/core doesn't get updated" (unless someone objects).

Edit: Updated docs to mention troubleshooting with composer prohibit and give an example of adding symfony/* (which I think would solve the upgrade issue for 80%+ of the cases I see in forum topics and issues).

Edit: Also wrote this up in a blog post.

kerolar’s picture

Hi guys, I have a load of sites I've neglected because the lack of time to learn composer. I've spent a few days reading and trying and it's not easy. I have a test site I want to upgrade from 8.3.2 to 8.4.5 to 8.5, but I'm stuck with dependencies:

# composer prohibits drupal/core:8.4.5
drupal/core    8.4.5  requires  symfony/class-loader (~3.2.8)
drupal/drupal  -      requires  symfony/class-loader (~2.8)
drupal/core    8.4.5  requires  symfony/console (~3.2.8)
drupal/drupal  -      requires  symfony/console (~2.8)
drupal/core    8.4.5  requires  symfony/dependency-injection (~3.2.8)
drupal/drupal  -      requires  symfony/dependency-injection (~2.8)
drupal/core    8.4.5  requires  symfony/event-dispatcher (~3.2.8)
drupal/drupal  -      requires  symfony/event-dispatcher (~2.8)
drupal/core    8.4.5  requires  symfony/http-foundation (~3.2.8)
drupal/drupal  -      requires  symfony/http-foundation (~2.8)
drupal/core    8.4.5  requires  symfony/http-kernel (~3.2.8)
drupal/drupal  -      requires  symfony/http-kernel (~2.8)
drupal/core    8.4.5  requires  symfony/process (~3.2.8)
drupal/drupal  -      requires  symfony/process (~2.8)
drupal/core    8.4.5  requires  symfony/routing (~3.2.8)
drupal/drupal  -      requires  symfony/routing (~2.8)
drupal/core    8.4.5  requires  symfony/serializer (~3.2.8)
drupal/drupal  -      requires  symfony/serializer (~2.8)
drupal/core    8.4.5  requires  symfony/translation (~3.2.8)
drupal/drupal  -      requires  symfony/translation (~2.8)
drupal/core    8.4.5  requires  symfony/validator (~3.2.8)
drupal/drupal  -      requires  symfony/validator (~2.8)
drupal/core    8.4.5  requires  symfony/yaml (~3.2.8)
drupal/drupal  -      requires  symfony/yaml (~2.8)

I've removed drush for now, to avoid conflicts. I can't seem to be able to update symfony and I want to do it cleanly so I can transfer the method to production sites, any suggestions?

kerolar’s picture

I tried all the above in many combinations without success; I need to rest my eyes, take my sites down and think of another way, tomorrow is the 28th. I got hacked way back in the last Armageddon and had to rebuild my production server.

I think the loonies have taken over the asylum with Drupal 8 and all the composer stuff.

agileadam’s picture

I had the same issues as @kerolar. There are probably cleaner ways to move from 8.3.8 to 8.5.0, but here's what worked for me.
Note that some steps just produced errors... I included here in the event that you encounter the same results.

Here's the process that took me from 8.3.8 to 8.4.5:

#### Update Drush and Drupal Console
composer require drush/drush:^9.0 drupal/console:^1.0 --update-with-dependencies

#### Update Drupal core
composer update drupal/core --with-dependencies
# Composer updated Drupal core to 8.3.8 to 8.4.5

#### Fix patch issues
# On my site I got 3 patch errors prefixed with: Could not apply patch! Skipping.
# Fixed patches by editing composer.json using newer versions of the patches
# Did these one at a time, re-running composer update after each. composer
# install might be more appropriate but I used "update" so I don't want to document
# otherwise.
composer update drupal/core --with-dependencies

#### Restore .htaccess and robots.txt customizations
git difftool .htaccess
git difftool robots.txt

#### Git add/commit changes
git add/commit/pull/push/etc.

#### Skip drush updb... updating to 8.5.0 immediately

Here's the process that took me from 8.4.5 to 8.5.0:

#### Update to 8.5.0
composer update drupal/core --with-dependencies
# Got errors because of symfony packages

#### Figure out what's wrong
composer prohibits drupal/core 8.5.0
# Same output as explained here:
# https://www.drupal.org/project/drupal/issues/2943546#comment-12544083

#### Uninstall Drush and Drupal Console
# Because these are dependent upon locked versions of Symfony packages
composer remove drupal/console drush/drush
composer remove drupal/console-core drupal/console-en drupal/console-extend-plugin

#### Update Drupal core
composer update drupal/core symfony/* --with-dependencies

#### Re-add drush
composer require drush/drush --update-with-dependencies
# Had issues trying to get v9 installed, gave up after a few minutes.

#### Re-add drush (older version 8.1.16)
composer require drush/drush ~8.0 --update-with-dependencies
composer update drush/drush --with-dependencies

#### Re-add Drupal console
composer require drupal/console

#### Restore .htaccess and robots.txt customizations
git difftool .htaccess
git difftool robots.txt

#### Git add/commit changes
git add/commit/pull/push/etc.

#### Run database update hooks and clear the cache
drush updb
drush cr
gregbeat’s picture

I was able to go from 8.3.7 to 8.5 by doing the following

composer remove drush/drush
composer remove drupal/console drupal/console-core drupal/console-en drupal/console-extend-plugin
composer update drupal/core symfony/* --with-dependencies

Thanks to agileadam for the tip offline about removing the drupal console extras.

cilefen’s picture

akalata’s picture

I was using an old version of composer.json from drupal-composer/drupal-project which included a manual declaration of additional composer.jsons to dig into, ie:

"merge-plugin": {
  "include": [
    "core/composer.json",
    "modules/contrib/address/composer.json"
  ],
]

I was stuck in a loop where symfony/* needed to update from 8.5 core's composer.json, yet was contradicted by explicitly setting 8.4 core's composer.json as an include.

borwickja’s picture

To update core from 8.4.6 to 8.5.1 the following worked for me:

In composer.json changed "drupal/core":"8.4.6" to "drupal/core":"8.5.1"

From the command line ran: php composer.phar update drupal/core symfony/config --with-dependencies

semisem’s picture

#19 worked perfectly . Thanks !

rick hood’s picture

#19 did not work for me (8.4.6 > 8.5.0). See errors at bottom of this.

My composer.json has this:

"require": {
        "composer/installers": "^1.0.24",
        "wikimedia/composer-merge-plugin": "^1.4",
        "drupal/core": "8.5.0",
        "drupal/address": "^1.3"
    },

Note address is the only module installed - this is a site I was testing composer update with.

I am starting to conclude that "the answer" is that deleting the /vendor folder and the composer.lock file, then using composer update is fine, and that one should simply make sure the version numbers for dependencies in your composer.json file are what you want. It's not that big a deal to manage what module versions you want to keep or allow to update in composer.json.

For example:

"drupal/admin_toolbar": "1.18", means stick with 1.18

"drupal/admin_toolbar": "^1.18", means go ahead and update but within 1.x (not 2.x)

----

Errors:

composer update drupal/core symfony/config --with-dependencies

    1/2:	http://packagist.org/p/provider-latest$fcbefc686fa0f0441a3332fd0be3b80d5f79f293bd63877b2eb58413c5b7189b.json
    2/2:	http://packagist.org/p/provider-2018-01$21498765bb9efc5acadda003406ed9999cd36b32217fe3d8410b15ce9a74549b.json
    Finished: success: 2, skipped: 0, failure: 0, total: 2
Dependency "asm89/stack-cors" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "composer/semver" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "doctrine/annotations" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "doctrine/common" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "easyrdf/easyrdf" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "egulias/email-validator" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "guzzlehttp/guzzle" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "masterminds/html5" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "paragonie/random_compat" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "stack/builder" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "symfony-cmf/routing" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "symfony/class-loader" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "symfony/console" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "symfony/dependency-injection" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "symfony/event-dispatcher" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "symfony/http-foundation" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "symfony/http-kernel" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "symfony/polyfill-iconv" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "symfony/process" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "symfony/psr-http-message-bridge" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "symfony/routing" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "symfony/serializer" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "symfony/translation" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "symfony/validator" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "symfony/yaml" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "twig/twig" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "zendframework/zend-diactoros" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "zendframework/zend-feed" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Package "symfony/config" listed for update is not installed. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - symfony/yaml 3.4.x-dev conflicts with symfony/console[v3.2.8].
    - symfony/yaml 3.4.x-dev conflicts with symfony/console[v3.2.8].
    - symfony/yaml 3.4.x-dev conflicts with symfony/console[v3.2.8].
    - drupal/core 8.5.0 requires symfony/yaml ~3.4.5 -> satisfiable by symfony/yaml[3.4.x-dev].
    - Installation request for drupal/core 8.5.0 -> satisfiable by drupal/core[8.5.0].
    - Installation request for symfony/console (locked at v3.2.8, required as ~3.2.8) -> satisfiable by symfony/console[v3.2.8]

.

mjk73’s picture

I had almost exactly the same issues as @theroyal. I tried virtually everything suggested above, but what finally worked for me was #31.

Here's what I did:
1. Updated the composer.json in docroot

    "require": {
        "composer/installers": "^1.0.24",
        "wikimedia/composer-merge-plugin": "^1.4",
        "drupal/core": "^8.5.1"
    },

2. Renamed the composer.lock file in docroot
3. Renamed the composer.json in /core directory
4. Ran composer update drupal/core --with-dependencies

This updated all of my Symfony packages to 3.4.7, and then my Drupal core from 8.4.5 to 8.5.1. Yay.

This has been a bit of a painful one. Took me three nights to get one of my production sites updated. The composer.lock was restricting the package updates, and when I then tried to require a package to update the composer.lock, the core/composer.json was interfering...at least that is my working hypothesis.

Anyone else seeking some Composer clarity in Nashville next week? I currently support several D7 sites and three D8 sites and the gulf between the two versions is widening with every release. Read that however you'd like. There are pros and cons to that widening gulf. I need a week of Drupalcon to convince me that there are more pros than cons.

Hope this helps someone wrestling with this update. Cheers.

berdir’s picture

I guess you also didn't start with drupal-project originally (https://github.com/drupal-composer/drupal-project/) ?

If you started with a tarball that you downloaded then you have that merge plugin configuration that seems to be causing these kind of problems, that setup is not really designed to be update-able with composer. I strongly recommend everyone to (re-)start with drupal-project, that definitely does not have such issues.

The thing is that you are now likely somewhere in the middle of having downloaded tarball vs. a drupal-project aka drupal/core based installation and are likely missing several things from drupal-project like the ability to update the top-level files.

chrotto’s picture

Thanks MJK73!
You made my day!

phl3tch’s picture

#54 solved my problem.

rick hood’s picture

Tried #58 and did not work for me, experimenting with an 8.4.3 fresh install update to 8.5.1.

  Problem 1
    - Conclusion: don't install drupal/core 8.5.1
    - Conclusion: don't install drupal/core 8.6.x-dev
    - Installation request for drupal/core ^8.5.1 -> satisfiable by drupal/core[8.5.1, 8.5.x-dev, 8.6.x-dev].
    - Conclusion: remove symfony/class-loader v3.2.8
    - drupal/core 8.5.x-dev requires symfony/class-loader ~3.4.0 -> satisfiable by symfony/class-loader[3.4.x-dev, v3.4.0, v3.4.0-BETA1, v3.4.0-BETA2, v3.4.0-BETA3, v3.4.0-BETA4, v3.4.0-RC1, v3.4.0-RC2, v3.4.1, v3.4.2, v3.4.3, v3.4.4, v3.4.5, v3.4.6, v3.4.7, v3.4.8].
    - Can only install one of: symfony/class-loader[v3.2.8, 3.4.x-dev].
...lots more about symfony/class-loader

Also tried composer update drupal/core symfony/* --with-dependencies ...no luck.

The only thing that has always worked for me with minor version updates (8.4.x > 8.5.x) is composer update (which updates everything) - combined with making sure module versions in root composer.json are either locked to current versions, or you are OK with allowing them to update.

MJK73!: "Anyone else seeking some Composer clarity in Nashville next week? " YES!

goodboy’s picture

#29 helps me

laurajeans’s picture

#54 was my issue. Guess I also have the old composer.json file of drupal-composer/drupal-project.

Tried everything above. Kept getting caught in a loop.

Edited composer.json, removed merge-plugin object inside extra and ran composer update drupal/core symfony/* --with-dependencies

"merge-plugin": {
  "include": [
    "core/composer.json",
    "modules/contrib/address/composer.json"
  ],
}

Updates just fine now.

2dareis2do’s picture

Same problem for me when trying to update from 8.4 to 8.5 with composer.

Solution #14 worked for me. Thanks for your help as was driving me a little crazy.

From what I can tell composer is saying that you cannot update from 8.4 to 8.5 because the requirements for 8.5 conflict with 8.4?!

Also had to use composer update symfony/css-selector to resolve conflict in requirements between drupal and symfony?

chrotto’s picture

StatusFileSize
new2.68 KB

Have used #58 on a couple of sites and it seems to work OK.
Suddenly when using it on another site the composer update run without any errors but the site had totally crashed.
When running Drush updb I get error and nothing is updated.
My update was from 8.4.8 to 8.5.3.

The total error-free composer update process and the errors after drush updb is attached

Have done a restore and tested around for other solutions here, but can not find any that help me.

chrotto’s picture

StatusFileSize
new2.77 KB

The drush updb response attached.

berdir’s picture

You need to update page_manager too.

chrotto’s picture

Thank you very much, Berdir. Now everything is fine on this site also.

DhirendraGrazitti’s picture

when I updated drupal 8.3.9 to drupal 8.5.3 using composer update drupal/core --with-dependencies

all packages has installed then after when I ran drush cr command

following error is displying how to resolve the problem

Fatal error: Class 'Symfony\Component\Config\Resource\ClassExistenceResource' not found in E:\wamp64\www\website-d8\vendor\symfony\dependency-injection\ContainerBuilder.php on line 350
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Class 'Symfony\Component\Config\Resource\ClassExistenceResource' not found in E:\wamp64\www\website-d8\vendor\symfony\dependency-injection\ContainerBuilder.php, line 350

sauqi’s picture

I've updated from 8.4 to 8.5, but configuration menu is not working. Help me please. thx

cilefen’s picture

@sauqi Open a new issue please. This issue is about completing the code update.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

enrique.diaz’s picture

I was updating Drupal Core from 8.5.4 to 8.5.6 and composer kept me sending errors about incompatibilities with symfony/yaml like the ones in the post #26, I've tried several of the proposed solutions in here and in other posts elsewhere to no avail. I didn't want to go nuclear and delete core and vendor.

I thought, then, that the problem is composer reading the requirements in the two versions involved, so I edited the composer.json in my installation and replaced the symphony entries with the ones in the composer.json of the new version, thinking that the core would be replaced anyway.

It worked!

I repeated that in another update, this time from 8.4.4 to 8.5.6 with the same results.

Hope it helps others.

ggallant’s picture

Solution mentioned above in #45 and #46 is reasonable, but I still discovered issues... so ended up running
composer prohibits drupal/core:8.5.9
multiple times, each adding another package to the command until

composer update drupal/core:8.5.9  symfony/class-loader symfony/console  symfony/dependency-injection symfony/event-dispatcher symfony/routing  symfony/http-foundation symfony/http-kernel symfony/process symfony/serializer symfony/translation   symfony/validator symfony/yaml symfony/finder symfony/config twig/twig --with-dependencies

Rather painful that you can't just use symfony/*