cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to upgrade to Magento 2.4.1 due to laminas-dependency-plugin not working with Composer 2

Unable to upgrade to Magento 2.4.1 due to laminas-dependency-plugin not working with Composer 2

Hi all!

 

I have a Magento 2.3.4 store currently hosted at www.cloudways.com.  I've cloned the server to stage upgrading to v2.4.1, but the Setup Wizard upgrade is failing to proceed past enabling maintenance mode.  My next step was to try upgrading via composer, but I ran into the following:

 

 

rdiasudfza@412349 ~/public_html $ composer update
The "magento/magento-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 "magento/inventory-composer-installer" 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.
Loading composer repositories with package information
Updating dependencies
Warning from repo.magento.com: You haven't provided your Magento authentication keys. For instructions, visit https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html
    Authentication required (repo.magento.com):
      Username: <snip>
      Password: 
Do you want to store credentials for repo.magento.com in /home/412349.cloudwaysapps.com/rdiasudfza/.config/composer/auth.json ? [Yn] 
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laminas/laminas-dependency-plugin[1.0.0, ..., 1.0.4] require composer-plugin-api ^1.1 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - magento/product-community-edition 2.4.1 requires laminas/laminas-dependency-plugin ^1.0 -> satisfiable by laminas/laminas-dependency-plugin[1.0.0, ..., 1.0.4].
    - Root composer.json requires magento/product-community-edition 2.4.1 -> satisfiable by magento/product-community-edition[2.4.1].

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

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

If I'm not mistaken, it's stuck because laminas/laminas-dependency-plugin doesn't seem to support composer 2?  The software stack on cloudways has Composer 2.0.2 pre-installed and it can't be downgraded.

 

Is it correct that I assume laminas/laminas-dependency-plugin is a dependency for magento/product-community-edition?  It's required regardless?

 

I see there's a bug report for this on the laminas project: https://github.com/laminas/laminas-dependency-plugin/issues/21

 

What I don't understand is I can't seem to find any other reports of others having issues upgrading?  Am I missing something basic?

 

Thanks in advance!

 

9 REPLIES 9

Re: Unable to upgrade to Magento 2.4.1 due to laminas-dependency-plugin not working with Composer 2

Hi, I had the same issue. for temporary solutions, I just downloaded the last composer.phar 1 version and stored in Magento root catalog. `php composer.phar install` works like before. Smiley Happy 

Re: Unable to upgrade to Magento 2.4.1 due to laminas-dependency-plugin not working with Composer 2

If you face this issue.
And using version want to upgrade to version 2.4.1 with composer 2, it will not work.
Magento 2 probably still not ready for composer 2.
Please look this issue.
https://github.com/magento/magento2/issues/30741

Probably summary is use Composer 1.
This could help 

wget https://github.com/composer/composer/releases/download/1.10.17/composer.phar

mv composer.phar /usr/local/bin/composer

chmod +x /usr/local/bin/composer

Re: Unable to upgrade to Magento 2.4.1 due to laminas-dependency-plugin not working with Composer 2

Did you ever get this fixed in the end?

 

I am in exactly the same position. Trying to upgrade a 2.3.4 store on Cloudways to 2.4.0.

 

It does not seem possible to downgrade composer so trying to battle upgrading the modules with endless errors.

 

Any tips?

Re: Unable to upgrade to Magento 2.4.1 due to laminas-dependency-plugin not working with Composer 2

You can ask Cloudways' support to downgrade the composer to version 1 if needed. They did that for me.

Re: Unable to upgrade to Magento 2.4.1 due to laminas-dependency-plugin not working with Composer 2

I am having the same issue at Cloudways. The support team has offered to downgrade to Composer1. Not sure if it will break other installs.

 

Re: Unable to upgrade to Magento 2.4.1 due to laminas-dependency-plugin not working with Composer 2

Last days I´m facing DOM error, high usage of swap memory and crash the website, only came back live again after clean all cache from magento, that reduce swap memory usage. The only change I did in the website was to use some carrousel banner at homepage, from the theme developer.

 

But I search at the web and found some people relating excessive use of memory, DOM errors, with the version 2.4.0 and it was fixed at 2.4.1.

 

Sio, I´m trying to upgrade from 2.4.0 to 2.4.1 and got the same error with version of composer.

Will submit a ticket at cloudways to downgrade to composer version 1.

 

Did you upgrade succefully after the downgrade?

 

I will try to follow this procedure:

https://forums.envato.com/t/how-to-upgrade-magento-version-from-2-4-0-to-2-4-1/340406

Re: Unable to upgrade to Magento 2.4.1 due to laminas-dependency-plugin not working with Composer 2

Support of Cloudways give a fast response.

 

Composer 1 and 2 both at the same time on the Server:

cd /home/master/ && wget https://getcomposer.org/download/1.10.17/composer.phar
chmod +x composer.phar
mv composer.phar composer

SSH via Master Credentials and run these commands:Now if you wish to use composer 1 instead of using composer commands like composer install, Kindly run commands as follows for composer 1:

/home/master/composer install

In this way, you will be able to have both Composer 1 and 2 at the same time and don't require to rollback and upgrade again and again.

Re: Unable to upgrade to Magento 2.4.1 due to laminas-dependency-plugin not working with Composer 2

Now I'm facing lack of memory errors.

I use a 4Gb server, that has 1Gb of swap.

Any ideia how can I solve this?

 

/home/master/composer update
Loading composer repositories with package information
Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2 is now available and you should upgrade. See https://getcomposer.org/2
Updating dependencies (including require-dev)
Package operations: 19 installs, 270 updates, 6 removals
- Removing psr/simple-cache (1.0.1)
Removing Psr/SimpleCache
- Removing league/mime-type-detection (1.5.1)
Removing League/MimeTypeDetection
- Removing league/flysystem (1.1.3)
Removing League/Flysystem
- Removing doctrine/inflector (v1.1.0)
Removing Doctrine/Inflector
- Removing doctrine/cache (1.10.2)
Removing Doctrine/Cache
- Removing cache/cache (0.4.0)
Removing Cache/Cache
- Updating symfony/process (v4.4.16 => v4.4.20): Downloading (100%)
- Updating symfony/polyfill-php80 (v1.20.0 => v1.22.1): Downloading (100%)
- Updating symfony/polyfill-php73 (v1.20.0 => v1.22.1): Downloading (100%)
- Updating symfony/polyfill-mbstring (v1.20.0 => v1.22.1): Downloading (100%)
- Updating symfony/console (v4.4.16 => v4.4.20): Downloading (100%)
- Updating symfony/polyfill-ctype (v1.20.0 => v1.22.1): Downloading (100%)
- Updating symfony/finder (v5.1.8 => v5.2.4): Downloading (100%)
- Updating symfony/filesystem (v5.1.8 => v5.2.4): Downloading (100%)
- Updating seld/jsonlint (1.8.2 => 1.8.3): Downloading (100%)
- Updating composer/xdebug-handler (1.4.4 => 1.4.5): Downloading (100%)
- Updating composer/spdx-licenses (1.5.4 => 1.5.5): Downloading (100%)
- Updating composer/semver (1.7.1 => 1.7.2): Downloading (100%)
- Updating composer/ca-bundle (1.2.8 => 1.2.9): Downloading (100%)
- Updating composer/composer (1.10.6 => 1.10.19): Downloading (100%)
- Updating magento/magento-composer-installer (0.1.13 => 0.2.0): Downloading (100%)
- Updating magento/composer-root-update-plugin (1.0.0 => 1.1.0): Downloading (100%)

Installing "magento/composer-root-update-plugin: 1.1.0" for the Web Setup Wizard
Loading composer repositories with package information
Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2 is now available and you should upgrade. See https://getcomposer.org/2
Updating dependencies
Package operations: 24 installs, 0 updates, 0 removals
- Installing react/promise (v2.8.0): Downloading (100%)
proc_open(): fork failed - Cannot allocate memory
The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)
Unzip with unzip command failed, falling back to ZipArchive class
Web Setup Wizard installation of "magento/composer-root-update-plugin: 1.1.0" failed
proc_open(): fork failed - Cannot allocate memory
- Updating magento/module-ui (101.2.0 => 101.2.1): The following exception is caused by a lack of memory or swap, or not having swap configured
Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details

PHP Warning: proc_open(): fork failed - Cannot allocate memory in phar:///home/master/composer/vendor/symfony/console/Application.php on line 952

Warning: proc_open(): fork failed - Cannot allocate memory in phar:///home/master/composer/vendor/symfony/console/Application.php on line 952

[ErrorException]
proc_open(): fork failed - Cannot allocate memory

Re: Unable to upgrade to Magento 2.4.1 due to laminas-dependency-plugin not working with Composer 2

I restart the server and did the update.

Everything goes fine.

 

Anyone nows if I can use the same procedure to goes to 2.4.2?