matchish / laravel-scout-elasticsearch

Search among multiple models with ElasticSearch and Laravel Scout
MIT License
705 stars 113 forks source link

[BUG]Elastic\Transport\Exception\NoAsyncClientException: I did not find any HTTP library with HttpAsyncClient interface. #225

Open HoudaAbdellaoui1 opened 1 year ago

HoudaAbdellaoui1 commented 1 year ago

Describe the bug Unable to connect to ElasticSearch after deployment to Azure :

Elastic\Transport\Exception\NoAsyncClientException: I did not find any HTTP library with HttpAsyncClient interface. Make sure to install a package providing "php-http/async-client-implementation". You can also set a specific async library using Elastic\Transport\Transport::setAsyncClient() in file /var/www/petalens/vendor/elastic/transport/src/Transport.php

- The app is working locally and successfully connects to Elasticsearch and gets indexed data , but one it's deployed on Azure it produces the error above .

Version Versions of Laravel, Scout, and the package. "matchish/laravel-scout-elasticsearch": "v6.0.0", "laravel/scout": "^9.4", "php": "^8.0.2",

hkulekci commented 1 year ago

Elasticsearch client expecting an implementation of php-http/async-client-implementation. For example, one of them is php-http/guzzle7-adapter. For example, I am using this library in my projects. But some others can use another implementation. So, this is a selection for the developer for their projects. I don't know if we can force the users to use one of the implementations we select. BTW, the error is coming directly from elasticsearch official clients.