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

Incompatibility with Magento 2.4.4 (PHP extensions missing) #344

Closed Axel29 closed 2 years ago

Axel29 commented 2 years ago

Preconditions

  1. Magento 2.4.2 (not testing on other 2.4.x versions)
  2. magento-cloud-docker images with -1.3.2 tag, including magento/magento-cloud-docker-php:8.1-fpm-1.3.2 and magento/magento-cloud-docker-php:8.1-cli-1.3.2

Steps to reproduce

Try to upgrade to Magento 2.4.4 by following the steps described in the Perform an upgrade guide:

  1. Use PHP 7.4 in the docker-compose.yml file
  2. Run composer require magento/composer-root-update-plugin ~2.0 --no-update
  3. Run composer update
  4. Update the docker-compose.yml file to use PHP 8.1-1.3.2 (or even 1.3.1)
  5. Restart the docker containers: docker-compose up -d
  6. Connect to the deploy container: bin/magento-docker bash
  7. Run composer require-commerce magento/product-community-edition 2.4.4 --no-update
  8. Run composer update

Expected result

  1. No error is thrown when starting the deploy container
  2. The composer update command works fine

Actual result

  1. The following errors are thrown when accessing the deploy container (with bin/magento-docker bash):
    
    error: 'imagick' does not exist

usage: /usr/local/bin/docker-php-ext-enable [options] module-name [module-name ...] ie: /usr/local/bin/docker-php-ext-enable gd mysqli /usr/local/bin/docker-php-ext-enable pdo pdo_mysql /usr/local/bin/docker-php-ext-enable --ini-name 0-apc.ini apcu apc

Possible values for module-name: bcmath.so blackfire.so bz2.so calendar.so exif.so gd.so gettext.so gmp.so gnupg.so intl.so ldap.so mailparse.so msgpack.so mysqli.so oauth.so opcache.so pcntl.so pcov.so pdo_mysql.so pspell.so raphf.so redis.so shmop.so soap.so sockets.so sodium.so sysvmsg.so sysvsem.so sysvshm.so tidy.so xdebug.so xmlrpc.so xsl.so yaml.so zip.so zookeeper.so

Some of the above modules are already compiled into PHP; please check the output of "php -i" to see which modules are already loaded.

2. The `composer update` command fails with the following errors:
```bash
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires magento/product-community-edition 2.4.4 -> satisfiable by magento/product-community-edition[2.4.4].
    - magento/product-community-edition 2.4.4 requires ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.
  Problem 2
    - magento/magento2-functional-testing-framework[3.7.0, ..., 3.8.0] require ext-intl * -> it is missing from your system. Install or enable PHP's intl extension.
    - Root composer.json requires magento/magento2-functional-testing-framework ^3.7 -> satisfiable by magento/magento2-functional-testing-framework[3.7.0, ..., 3.8.0].

To enable extensions, verify that they are enabled in your .ini files:
    - 
    - /usr/local/etc/php/conf.d/blackfire.ini
    - /usr/local/etc/php/conf.d/gnupg.ini
    - /usr/local/etc/php/conf.d/zz-magento.ini
    - /usr/local/etc/php/conf.d/zz-mail.ini
    - /usr/local/etc/php/conf.d/zz-pcov-settings.ini
    - /usr/local/etc/php/conf.d/zz-xdebug-settings.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-gd --ignore-platform-req=ext-intl` to temporarily ignore these required extensions.

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

I'm closing this issue since I found the solution.

For those who are in the same situation, this was due to my docker-compose.yml file that was outdated. I recreated it with the following command ./vendor/bin/ece-docker 'build:compose' --with-entrypoint --with-xdebug --set-docker-host --no-os --php='8.1' --expose-db-port=3307 --mode=developer --sync-engine=native --es='7.11' --rmq='3.9' and it worked again.

I guess the issue was in this diff in the fpm_xdebug and generic services:

- - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip redis xsl blackfire sodium imagick xdebug'
+ - 'PHP_EXTENSIONS=bcmath bz2 calendar exif gd gettext intl mysqli pcntl pdo_mysql soap sockets sysvmsg sysvsem sysvshm opcache zip xsl sodium xdebug'
Axel29 commented 1 year ago

Reopening this issue as the fix suggested above doesn't include Imagick by default in the Docker image.