I am relatively new to Composer. I just upgraded from 8.3.7 to 8.4.0 after reading every entry on upgrading in this forum. My site now is totally down. I have had to restore from a backup. Here are the steps that I followed. Can someone point out what the problem might be?

The steps that I followed:

1) Renamed composer.lock, core and vendor to _composer.lock, _core and _vender, respectively.

2) Added "drupal/core": "~8.4" to my composer.json. (see below for my composer.json file).

3) $composer update --with-dependencies

My error messages:

-bash-4.1$ composer update drupal/core --with-dependencies

Loading composer repositories with package information

Updating dependencies (including require-dev)

Package operations: 37 installs, 0 updates, 0 removals

  - Installing composer/installers (v1.4.0): Loading from cache

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing wikimedia/composer-merge-plugin (v1.4.1): Loading from cache

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing webmozart/assert (1.2.0): Loading from cache

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing webmozart/path-util (2.3.0): Loading from cache

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing webflo/drupal-finder (1.0.0): Loading from cache

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing symfony/yaml (v3.3.10): Downloading (100%)         

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing symfony/polyfill-mbstring (v1.6.0): Downloading (100%)         

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing symfony/var-dumper (v3.3.10): Downloading (100%)         

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing symfony/process (v3.3.10): Downloading (100%)         

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing symfony/finder (v3.3.10): Downloading (100%)         

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing symfony/event-dispatcher (v3.3.10): Downloading (100%)         

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing psr/log (1.0.2): Loading from cache

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing symfony/debug (v3.3.10): Downloading (100%)         

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing symfony/console (v3.3.10): Downloading (100%)         

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing symfony/filesystem (v3.3.10): Downloading (100%)         

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing symfony/config (v3.3.10): Downloading (100%)         

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing sebastian/version (1.0.6): Loading from cache

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing jakub-onderka/php-console-color (0.1): Loading from cache

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing jakub-onderka/php-console-highlighter (v0.3.2): Loading from cache

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing dnoegel/php-xdg-base-dir (0.1): Loading from cache

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing nikic/php-parser (v3.1.1): Downloading (100%)         

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing psy/psysh (v0.8.13): Downloading (100%)         

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing phpdocumentor/reflection-docblock (2.0.5): Loading from cache

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing pear/console_table (v1.3.0): Loading from cache

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing psr/container (1.0.0): Loading from cache

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing container-interop/container-interop (1.2.0): Loading from cache

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing league/container (2.4.1): Loading from cache

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing dflydev/dot-access-data (v1.1.0): Loading from cache

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing grasmash/yaml-expander (1.2.0): Downloading (100%)         

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing consolidation/output-formatters (3.1.12): Downloading (100%)         

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing consolidation/log (1.0.3): Loading from cache

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing consolidation/annotated-command (2.8.1): Downloading (100%)         

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing consolidation/config (1.0.6): Downloading (100%)         

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing consolidation/robo (1.1.4): Downloading (100%)         

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing twig/twig (v1.35.0): Downloading (100%)         

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing chi-teck/drupal-code-generator (1.20.0): Downloading (100%)         

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

  - Installing drush/drush (9.0.0-beta7): Downloading (100%)         

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script

symfony/var-dumper suggests installing ext-symfony_debug ()

symfony/event-dispatcher suggests installing symfony/dependency-injection ()

symfony/event-dispatcher suggests installing symfony/http-kernel ()

psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.)

psy/psysh suggests installing hoa/console (A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit.)

phpdocumentor/reflection-docblock suggests installing dflydev/markdown (~1.0)

phpdocumentor/reflection-docblock suggests installing erusev/parsedown (~1.0)

pear/console_table suggests installing pear/Console_Color2 (>=0.1.2)

consolidation/robo suggests installing pear/archive_tar (Allows tar archives to be created and extracted in taskPack and taskExtract, respectively.)

consolidation/robo suggests installing henrikbjorn/lurker (For monitoring filesystem changes in taskWatch)

consolidation/robo suggests installing patchwork/jsqueeze (For minifying JS files in taskMinify)

consolidation/robo suggests installing natxet/CssMin (For minifying CSS files in taskMinify)

Writing lock file

Generating autoload files

Class Drupal\Core\Composer\Composer is not autoloadable, can not call pre-autoload-dump script

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-autoload-dump script

Loading composer repositories with package information

Updating dependencies (including require-dev)

Nothing to install or update

Generating autoload files

Class Drupal\Core\Composer\Composer is not autoloadable, can not call pre-autoload-dump script

Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-autoload-dump script

My composer.json file:

{
    "name": "drupal/drupal",
    "description": "Drupal is an open source content management platform powering millions of websites and applications.",
    "type": "project",
    "license": "GPL-2.0+",
    "require": {
        "composer/installers": "^1.0.24",
        "wikimedia/composer-merge-plugin": "~1.4",
        "drush/drush": "9.*",
        "drupal/core": "~8.4"
    },
    "replace": {
        "drupal/core": "~8.3"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "config": {
        "preferred-install": "dist",
        "autoloader-suffix": "Drupal8"
    },
    "extra": {
        "_readme": [
            "By default Drupal loads the autoloader from ./vendor/autoload.php.",
            "To change the autoloader you can edit ./autoload.php.",
            "This file specifies the packages.drupal.org repository.",
            "You can read more about this composer repository at:",
            "https://www.drupal.org/node/2718229"
        ],
        "merge-plugin": {
            "include": [
                "core/composer.json"
            ],
            "recurse": false,
            "replace": false,
            "merge-extra": false
        },
        "installer-paths": {
            "core": [
                "type:drupal-core"
            ],
            "modules/contrib/{$name}": [
                "type:drupal-module"
            ],
            "profiles/contrib/{$name}": [
                "type:drupal-profile"
            ],
            "themes/contrib/{$name}": [
                "type:drupal-theme"
            ],
            "drush/contrib/{$name}": [
                "type:drupal-drush"
            ],
            "modules/custom/{$name}": [
                "type:drupal-custom-module"
            ],
            "themes/custom/{$name}": [
                "type:drupal-custom-theme"
            ]
        }
    },
    "autoload": {
        "psr-4": {
            "Drupal\\Core\\Composer\\": "core/lib/Drupal/Core/Composer"
        }
    },
    "scripts": {
        "pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump",
        "post-autoload-dump": [
            "Drupal\\Core\\Composer\\Composer::ensureHtaccess"
        ],
        "post-package-install": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
        "post-package-update": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup"
    },
    "repositories": {
        "0": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        "drupal": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    }
}

Comments

BeginnersMind’s picture

I am not surprised that there ist no solution for this problem. It seems to me that the Drupal update process is somewhat broken. Drupal appears to become a developer-only CMS.

bburg’s picture

Some of us developers are also having a tough time with it...

Metatag should be in core.

BeginnersMind’s picture

When I tried to update from 8.5.5 to 8.5.6 I ended up with 8.6.beta! This means that composer ignored the version constraint ^8.5.6 (i.e. >=8.5.6 <8.6) in the require section which is very strange. It seems to be that the reason for this was that I actually forgot to delete the vendor directory. Updating the database then gave errors. Therefore, I had to replay the backup. After having deleted composer.lock and the vendor dir the update worked.

It seems to be that composer is able to install the vendor packages but not to update them.

mmjvb’s picture

According to the docs: 

Caret Version Range (^)#

The ^ operator behaves very similarly but it sticks closer to semantic versioning, and will always allow non-breaking updates. For example ^1.2.3 is equivalent to >=1.2.3 <2.0.0 as none of the releases until 2.0 should break backwards compatibility. For pre-1.0 versions it also acts with safety in mind and treats ^0.3 as >=0.3.0 <0.4.0.

This is the recommended operator for maximum interoperability when writing library code.

^8.5.6 is equivalent of >=8.5.6 <9.0.0, which is what happened in your case. See https://getcomposer.org/doc/articles/versions.md

BeginnersMind’s picture

Yes, mmjvb is right. I misinterpreted the fact that ^ should not break the site. :-) But 8.6beta actually broke my site since I got errors when updating the DB. In the future I will no longer use ^ but use a more conservative constraint for the drupal core version such as ~8.5.6 instead. ^8.5.6-stable should perhaps also avoid RCs, betas, etc.

mmjvb’s picture

Please check the issue queue and report unknown issues.

Don't know about -stable, maybe someone else knows and informs us. Wouldn't expect this to happen with an -rc, though.

michaelrajchandra’s picture

I am really wondering what has happened to Drupal - how has it become so problematic and complex!!

I have been using Drupal since 2010 and very dispointed in the way its become so difficult to even install and use drupal via the command line...

So many errors... and no resource online to help.

I think i have so shift my focus to other CMS or i will be out of work soon...

kristindev’s picture

I am spending so much time wrangling composer - it's really a problem.

ethelburga’s picture

Same here. Drupal 8 has been a time consuming nightmare with the upgrade process now seemingly broken. I'm stuck on 8.4.8 after two malware attacks brought 8.4.4 down.

Hugely disappointing as have had no trouble with a reasonably large site since 2012.

And where did the help go? I'm having to clear the caches manually, once a week, to avoid my database breaking my ISP's 1 Gb limit. I've turned caching off entirely (makes no difference) yet no replies to my question.

It's failing as a CMS for non developers.

abhaisasidharan’s picture

Change :

 "replace": {
        "drupal/core": "~8.3"
    },
 "replace": {
        "drupal/core": "*"
    },
joshua.boltz’s picture

This worked for me when updating from 8.5.0 to 8.5.1

Edit composer.json to set `"drupal/core": "~8.5.1",`

rm -rf vendor

rm composer.lock

composer update drupal/core --with-dependencies
BeginnersMind’s picture

As joshua.boltz mentioned, editing composer.json, removing vendor and composer.lock most of the time works. To remove the lock file together with the vendor directory is almost always necessary for minor version updates especially if symfony is updated. Patch updates might work without this.

nateB’s picture

Thanks! @nileema's method in comment #6 worked for me