1

When updated .magento.app.yaml php version to 8.1, the deployment to magento cloud failed and showed the error below:

  Executing build hook...
    W: Installing dependencies from lock file (including require-dev)
    W: Verifying lock file contents can be installed on current platform.
    W: Your lock file does not contain a compatible set of packages. Please run composer update.
    W: 
    W:   Problem 1
    W:     - laminas/laminas-dependency-plugin is locked to version 2.3.0 and an update of this package was not requested.
    W:     - laminas/laminas-dependency-plugin 2.3.0 requires composer-plugin-api >=1.1.0 <2.3.0 -> found composer-plugin-api[2.3.0] but it does not match the constraint.
    W:   Problem 2
    W:     - laminas/laminas-dependency-plugin 2.3.0 requires composer-plugin-api >=1.1.0 <2.3.0 -> found composer-plugin-api[2.3.0] but it does not match the constraint.
    W:     - magento/product-community-edition 2.4.4-p1 requires laminas/laminas-dependency-plugin ^2.2.0 -> satisfiable by laminas/laminas-dependency-plugin[2.3.0].
    W:     - magento/product-community-edition is locked to version 2.4.4-p1 and an update of this package was not requested.
    W: 
  
  E: Error building project: Step failed with status code 2.

E: Error: Unable to build application, aborting.

1 Answer 1

1

It seems that your composer.lock used Composer v2 (composer-plugin-api) inside it.

You might want to update your .magento.app.yaml and switch to using Composer v2, by default Magento Cloud will use Composer v1.

To do that, update your file as per the following

# This file describes an application. You can have multiple applications
# in the same project.


# The name of this app. Must be unique within a project.
name: mymagento

# The toolstack used to build the application.
type: php:8.1
build:
    flavor: none

# Composer v2 for faster deployment
dependencies:
    php:
        composer/composer: '^2.0'

....

hooks:
    # We run build hooks before your application has been packaged.
    build: |
        set -e
        composer --no-ansi --no-interaction install --no-progress --prefer-dist --optimize-autoloader
        php ./vendor/bin/ece-tools run scenario/build/generate.xml
        php ./vendor/bin/ece-tools run scenario/build/transfer.xml
    # We run deploy hook after your application has been deployed and started.
    deploy: |
        php ./vendor/bin/ece-tools run scenario/deploy.xml
    # We run post deploy hook to clean and warm the cache. Available with ECE-Tools 2002.0.10.
    post_deploy: |
        php ./vendor/bin/ece-tools run scenario/post-deploy.xml


....
1
  • 1
    Finally found that it works if i limited composer not greater than 2.2 . type: php:8.1 build: flavor: none dependencies: php: composer/composer: '>=2.0 <2.2'
    – leo
    Aug 10 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.