drush – What does this Composer error mean when I try to update my drupal core project?

I’ve installed my Drupal 9 site with the drupal/core-recommended composer project and was not having any issues until recently. Every time I try to update core with the following command (Which I’m getting from the official documentation), I get an error.

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

Console Error

Anyone know how I can get around this and update what is needed to get my site back on track? I’ve tried numerous things that either error out or don’t work + searched online but haven’t found anything that is of use to me.

magento2 – Composer Install throws error downloading Magento Package in Magento 2.4.1

Trying to run composer install in a Magento 2.4.1 project is netting the following error:

The "https://repo.magento.com/archives/magento/module-page-builder/magento-module-page-builder-2.1.0.0.zip" file could not be downloaded (HTTP/1.1 404 Not Found)

All magento modules previous to this work, which means the Keys works. I have even created a different key to try and still same issue. What can I do?

Issues updating core to 9.1.2 with Composer

On my local site, I had updates for 2 modules and Drupal core. To update, I typed in composer update, which had worked for me previously just fine.

Composer indicated everything updated, although on the site itself, it shows Drupal core did not update. Also by typing in drush status, Composer shows the previous version of Drupal.

To see what is preventing the specific update, I type in:
composer prohibits drupal/core:9.1.2 which gives me this:

drupal/core-recommended  9.0.10  requires          drupal/core (9.0.10)
drupal/core              9.1.2   requires          composer/semver (^3.0)
drupal/legacy-project    -       does not require  composer/semver (but 1.5.1 is installed)

To update any blocking dependencies with the core update, I then try the following (I used require instead of update as update didn’t give me any results or useful into.):

composer require drupal/core:9.1.2 composer/semver --with-dependencies

This returns the following:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - drupal/core-recommended is locked to version 9.0.10 and an update of this package was not requested.
    - drupal/core-recommended 9.0.10 requires composer/semver 1.5.1 -> found composer/semver(1.5.1) but it conflicts with your root composer.json require (^3.2).
  Problem 2
    - drush/drush is locked to version dev-master and an update of this package was not requested.
    - drush/drush dev-master requires composer/semver ^1.4 -> found composer/semver(1.4.0, ..., 1.x-dev) but it conflicts with your root composer.json require (^3.2).

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

I read that Composer update problems are often related to abandoned composer templates or bad settings in composer.json. My composer files indicates at the top I am using drupal/legacy-project, not drupal/recommended. Although there is a line in my json file for "drupal/core-recommended": "^9". I’m not sure how to edit this file correctly.

I’m beating my head against the wall trying to figure out how to update Drupal core. Any recommendations much appreciated. Using Composer is very new to me.

composer update to drupal 8.9.12 gives UnexpectedValueException

Locally, I first tried to update core individually using the command

composer update drupal/core drupal/core-recommended –with-all-dependencies

This gave an error. So eventually I just used “composer update”, which usually works. But now I got the error below…

The full error (see screenshot):

Install of drupal/core failed

Followed by

(UnexpectedValueException)
‘C:wamp64wwwtantrayonimassage/vendor/composer/tmp-6c1ec2df3485bdc02d3abaf470e0d9a8’ is not a zip archive.

screenshot

Any idea how to resolve this?

Composer keeps ReInstalling my Drupal/Core v9.1.2

I am new to administering Drupal. Not sure where to ask for help.

https://github.com/composer/composer/issues/9597

I have a problem in that I manually updated my Drupal9 install to v9.1.2 and it seems to be working fine. Now I need to enable a module: “real_aes” but it requires a dependency: “defuse/php-encryption”.

I attempted to install it using composer but composer tries to update my Drupal Core to v9.1.2 again and then my Drupal is broken, and I have to restore from backups.

Any help would be greatly appreciated!

root@Main01:/usr/local/www/drupal9 # composer --no-plugins --no-scripts require defuse/php-encryption

PHP Warning: Module ‘pdo_mysql’ already loaded in Unknown on line 0
Do not run Composer as root/super user! See https://getcomposer.org/root for details

Continue as root/super user (yes)?

Using version ^2.2 for defuse/php-encryption
./composer.json has been updated
Running composer update defuse/php-encryption

Loading composer repositories with package information

Updating dependencies

Lock file operations: 2 installs, 0 updates, 0 removals

  • Locking defuse/php-encryption (v2.2.1)
  • Locking paragonie/random_compat (v9.99.100)

Writing lock file

Installing dependencies from lock file (including require-dev)
Package operations: 3 installs, 0 updates, 0 removals

  • Installing paragonie/random_compat (v9.99.100): Extracting archive
  • Installing defuse/php-encryption (v2.2.1): Extracting archive
  • Installing drupal/core (9.1.2): Extracting archive

1 package suggestions were added by new dependencies, use composer suggest to see details.

Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.

Generating autoload files

37 packages you are using are looking for funding.
Use the composer fund command to find out more!

Thank you.

-Ben

magento2 – Magento 2 composer issue with bitbucket pipelines

I made a bitbucket pipeline and I would like to do some deployments, but my pipeline got stuck with a composer issue.
This is the error message from the pipeline:

The 'https://repo.magento.com/archives/magento/framework/magento-framework-102.0.4.0.zip' URL required authentication.                                
You must be using the interactive console to authenticate       

   

If I access that link, I got this:

You haven't provided your Magento authentication keys. For instructions, visit 
https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html

But the thing is that I have my keys added in the auth.json and if do a composer install or update, it works, so I m not sure why it doesn’t work from the pipeline and what exactly that error means. Can you please clarify it ? or give me some advice?

Thank you

How can I get hold of the Composer object?

Usually, I’m doing this using ReflectionClass.

Take this example: to load the cacert file which comes inside one of composer packages:

  • First, locate any class in that package using ReflectionClass.
  • Secondly, get the package path using dirname bypassing the file name.

Code example:

// Load certificate file.
$reflection = new ReflectionClass(GSRequest::class);
$packagePath = dirname($reflection->getFileName());
$gsRequest::setCAFile(realpath($packagePath . '/cacert.pem'));

composer – How do I update from 9.0.10 to 9.1.0?

I have tried to update drupal 9.0.10 to 9.1 with composer but I cannot:

composer outdated 'drupal/*' 
 drupal/core             9.0.10 **9.1.0** Drupal is an open source content manage... 
 drupal/core-recommended 9.0.10 **9.1.0** Locked core dependencies; require this ...

I have executed “composer update drupal/core-recommended –with-all-dependencies” and this is the result

loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
Generating autoload files

This is my composer.json

{
    "name": "drupal/recommended-project",
    "description": "Project template for Drupal 8 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": "^1.9",
        "drupal/bootstrap": "^3.23",
        "drupal/core-composer-scaffold": "^9",
        "drupal/core-project-message": "^9",
        "drupal/core-recommended": "^9",
        "drupal/metatag": "^1.13",
        "drupal/migrate_plus": "^5.1",
        "drupal/migrate_tools": "^4.5|^5",
        "drupal/migrate_upgrade": "^3.2",
        "drupal/pathauto": "^1.8",
        "drupal/redirect": "^1.6",
        "drush/drush": "^10.3"
    },
    "conflict": {
        "drupal/drupal": "*"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "config": {
        "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/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/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"
            )
        }
    }
}

How can I get hold of the Composer object in Drupal code?

I’m trying to get the file location of something in an installed package.

https://stackoverflow.com/questions/15714809/get-filesystem-path-of-installed-composer-package says I can get that from the Composer object.

But in Drupal, how do I get the Composer object?

upgrading – How to update drupal from 9.0.10 to 9.1.0 with composer

I have tried to update drupal 9.0.10 to 9.1 with composer but I cannot:

composer outdated 'drupal/*' 
 drupal/core             9.0.10 **9.1.0** Drupal is an open source content manage... 
 drupal/core-recommended 9.0.10 **9.1.0** Locked core dependencies; require this ...

I have executed “composer update drupal/core-recommended –with-all-dependencies” and this is the result

loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
Generating autoload files