Smile-SA / elasticsuite

Smile ElasticSuite - Magento 2 merchandising and search engine built on ElasticSearch
https://elasticsuite.io
Open Software License 3.0
761 stars 341 forks source link

Problem after installing extension in Magento 2.4.6-p1 #3008

Closed predragstojiljkovic closed 1 year ago

predragstojiljkovic commented 1 year ago

Preconditions

Magento Version : 2.4.6-p1

ElasticSuite Version : 2.11

Elasticsearch version: 8.4.0

Environment : Production mode

Third party modules : Porto theme

Steps to reproduce

  1. Install the extension using composer require smile/elasticsuite ~2.11.0
  2. Try to perform bin/magento setup:upgrade
  3. Getting the following error: There are no commands defined in the "setup" namespace.
  4. Try to perform bin/magento setup:di:compile
  5. Getting the following error: There are no commands defined in the "setup:di" namespace.
  6. Perform bin/magento list
  7. Getting the following output: In ServiceManager.php line 649: Service with name "Magento\Setup\Console\Command\ConfigSetCommand" could not be created. Reason: Impossible to process constructor argument Parameter #0 [ Elasticsearch\ClientBuilder $clientBuilder ] of Smile\ElasticsuiteCore\Client\ClientBuilder class

In ClassReader.php line 57: Impossible to process constructor argument Parameter #0 [ Elasticsearch\ClientBuilder $clientBuilder ] of Smile\ElasticsuiteCore\Client\ClientBuilder class

In GetParameterClassTrait.php line 34: Class "Elasticsearch\ClientBuilder" does not exist

Expected result

  1. Install the extension using composer require smile/elasticsuite ~2.11.0
  2. Try to perform bin/magento setup:upgrade
  3. Upgrade succeeds

Actual result

  1. After installation of extension I was unable to perform setup:upgrade nor setup:di:compile
  2. After I removed the extension using composer remove smile/elasticsuite everything started working well again
romainruaud commented 1 year ago

Hi @predragstojiljkovic

did you do this command ? composer require magento/module-elasticsearch-8 --with-all-dependencies ?

This command is not needed to install Elasticsuite, and worst, it will enforce the installation of the Elasticsearch PHP Client in version 8, which is not compatible with Elasticsuite since they FQCN changed.

This will be solved by #2910 but it's unmerged actually.

For now, you can probably try to do :

composer remove magento/module-elasticsearch-8 composer require elasticsearch/elasticsearch ~7.17.0

Actually Magento allows both versions of the client : https://github.com/magento/magento2/blob/2.4.6-p1/composer.json#L45

predragstojiljkovic commented 1 year ago

Yes. I did composer require magento/module-elasticsearch-8 --with-all-dependencies. Will composer require elasticsearch/elasticsearch ~7.17.0 work with Elasticsearch 8.4.0 (since we can not change the version of Elasticsearch itself on that server and not allowed to install a different one)?

romainruaud commented 1 year ago

Yes, the 7.x client works well with the v8.x of Elasticsearch

vahonc commented 1 year ago

@predragstojiljkovic,

Have you solved your problem?

BR, Vadym

predragstojiljkovic commented 1 year ago

No, not really. Removing magento/module-elasticsearch-8 and installing elasticsearch/elasticsearch ~7.17.0 and smile/elasticsuite ~2.11.0 caused many other problems. I tried fixing it one by one, but it took too long. So I reverted it all and gave up on installing smile/elasticsuite for now. I hope you will release a new version soon that will work with magento/module-elasticsearch-8 :) I'll be patient until then...

romainruaud commented 1 year ago

@predragstojiljkovic we've plenty of projects running with Magento 2.4.6 and Elasticsuite 2.11.x with the Elasticsearch 7.17 client.

That's also the stack we test on our CI jobs.

Can you please give us more details regarding the issues you've had after removing magento/module-elasticsearch-8 and downgrading the PHP client ?

Regards

github-actions[bot] commented 1 year ago

This issue was waiting update from the author for too long. Without any update, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away! Thanks for your contribution.