magento / magento-cloud-docker

All Submissions you make to Magento Inc. (“Magento") through GitHub are subject to the following terms and conditions: (1) You grant Magento a perpetual, worldwide, non-exclusive, no charge, royalty free, irrevocable license under your applicable copyrights and patents to reproduce, prepare derivative works of, display, publically perform, sublicense and distribute any feedback, ideas, code, or other information (“Submission") you submit through GitHub. (2) Your Submission is an original work of authorship and you are the owner or are legally entitled to grant the license stated above. (3) You agree to the Contributor License Agreement found here: https://github.com/magento/magento2/blob/master/CONTRIBUTOR_LICENSE_AGREEMENT.html
Open Software License 3.0
256 stars 192 forks source link

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

Closed dshevtsov closed 2 years ago

dshevtsov commented 3 years ago

Preconditions

  1. macOS 11.5
  2. Docker version 20.10.7, build f0df350
  3. Composer version 2.0.12
  4. PHP 7.4.20

Steps to reproduce

  1. Clean / purge data on Docker
  2. git clone --branch 2.4.3 git@github.com:magento/magento-cloud.git magento-cloud-2.4.3
  3. cd magento-cloud-2.4.3
  4. cp ~/.composer/auth.json . || exit
  5. COMPOSER_MEMORY_LIMIT=-1 composer update
  6. ./vendor/bin/ece-docker build:compose
  7. docker-compose up --detach
  8. docker-compose run --rm build cloud-build

Expected result

  1. No failures are expected

Actual result

$ docker-compose run --rm build cloud-build
Creating magento-cloud-243_build_run ... done
Cleaning directories:
Cleaning setup directory.
Cleaning vendor directory.
Cleaning generated directory.
Removing app/etc/env.php file
Installing dependencies.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for ocramius/proxy-manager 2.10.1 -> satisfiable by ocramius/proxy-manager[2.10.1].
    - ocramius/proxy-manager 2.10.1 requires composer-runtime-api ^2.0.0 -> no matching package found.
  Problem 2
    - ocramius/proxy-manager 2.10.1 requires composer-runtime-api ^2.0.0 -> no matching package found.
    - symfony/proxy-manager-bridge v4.4.18 requires ocramius/proxy-manager ~2.1 -> satisfiable by ocramius/proxy-manager[2.10.1].
    - Installation request for symfony/proxy-manager-bridge v4.4.18 -> satisfiable by symfony/proxy-manager-bridge[v4.4.18].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
ERROR: 2
BaDos commented 3 years ago

Hi @dshevtsov, Please, try the one of these:

dshevtsov commented 3 years ago

update composer inside docker before running the build phase

How do I do this?

andriyShevtsov commented 3 years ago

Answered in slack

dshevtsov commented 3 years ago

Changing local Composer version helped.

Though it is expected to use Composer 2 since version 2.4.2 per official system requirements.

YPyltiai commented 2 years ago

@BaDos , any fixes required here? I think @dshevtsov is right saying that Composer 2 is recommended, so rolling back to v1.x is not an obvious solution.

BaDos commented 2 years ago

@dshevtsov @YPyltiai By default MCD use Composer 1 After generating docker-compose.yaml file you can add ENV variable with specific composer version:

For example:

...
  generic:
    hostname: generic.magento2.docker
    image: 'magento/magento-cloud-docker-php:8.0-cli-1.3.0'
    env_file: ./.docker/config.env
    environment:
      - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium'
      - 'SENDMAIL_PATH=/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025'
      - 'COMPOSER_VERSION=2.1.9'
...
dshevtsov commented 2 years ago

Changing local Composer version helped.

Though it is expected to use Composer 2 since version 2.4.2 per official system requirements.

I fixed the issue with a workaround. The only concern that remains is that as a user, I expect that an environment from the template corresponds to Commerce's official system requirements.