magento2: Elasticsearch 8 package has incompatible composer dependencies with elasticsearch 7

Preconditions and environment

  • Magento version: 2.4-develop
Bildschirmfoto_2022-12-30_um_11 55 35

Looks like the dependencies determined for the meta package contain both magento/module-elasticsearch-7 and magento/module-elasticsearch-8

But those have incompatible base package dependencies

Steps to reproduce

Check the composer.json of the packages in the 2.4-develop branch.

Try to composer install these two packages in the same project.

Expected result

Successful install.

Actual result

Bildschirmfoto_2022-12-30_um_11 55 35

Additional information

No response

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 2
  • Comments: 34 (14 by maintainers)

Most upvoted comments

@damienwebdev: So, using Magento 2.4.6-beta1, I see the following:

  • The module magento/module-elasticsearch contains the constraint "elasticsearch/elasticsearch": "~7.17.0"
  • The module magento/module-elasticsearch-7 contains the constraint "elasticsearch/elasticsearch": "^7.17"
  • The module magento/module-elasticsearch-8 does not contain any constraint for elasticsearch/elasticsearch
  • The metapackage magento/product-community-edition contains the constraint "elasticsearch/elasticsearch": "^7.17||^8.5"

So it sounds like some shenanigans is happening in the packaging phase where they removed the constraint from magento/module-elasticsearch-8 for now, until they figure out how to make this work.

Maybe @tpogrebniak can elaborate on what’s going on and what the plans are for the final release?

thanks I just stepped down to es7 as it seems like the package has been removed.

The docs for v2.4.6 are wrong. You can only use 7.17. 8.4 won’t be available until v2.4.7.

Small update for the people interested, this is the current status in Magento 2.4.6-beta8:

  • The module magento/module-elasticsearch contains the constraint "elasticsearch/elasticsearch": "~7.17.0 || ~8.5.0"
  • The module magento/module-elasticsearch-7 contains the constraint "elasticsearch/elasticsearch": "^7.17"
  • There is no longer a module magento/module-elasticsearch-8 getting installed by default
  • The metapackage magento/product-community-edition contains the constraint "elasticsearch/elasticsearch": "~7.17.0 || ~8.5.0"
  • The module magento/module-elasticsearch-8 is still available to be installed and contains the constraint "elasticsearch/elasticsearch": "~8.5.0" and (this is important) also a replace section: "magento/module-elasticsearch-7": "*"

So, after some quick testing, you can switch from ES7 to ES8 by:

$ composer require --no-update magento/module-elasticsearch-8 100.4.0-beta8
./composer.json has been updated

$ composer update magento/module-elasticsearch-7 magento/module-elasticsearch-8 elasticsearch/elasticsearch
Loading composer repositories with package information
Updating dependencies
Lock file operations: 5 installs, 1 update, 1 removal
  - Removing magento/module-elasticsearch-7 (100.4.6-beta8)
  - Locking elastic/transport (v8.6.0)
  - Upgrading elasticsearch/elasticsearch (v7.17.1 => v8.5.3)
  - Locking magento/module-elasticsearch-8 (100.4.0-beta8)
  - Locking php-http/discovery (1.15.2)
  - Locking php-http/httplug (2.3.0)
  - Locking php-http/promise (1.1.0)
Writing lock file
...

This seems like an ok solution to me.

These changes haven’t made it to github yet as far as I can see, so the Mage-OS people will probably still run into issues when trying to generate nightly builds.