You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Declaration of Elastic\Elasticsearch\Response\Elasticsearch::withStatus(int $code, string $reasonPhrase = ''): Psr\Http\Message\ResponseInterface must be compatible with PsrExt\Http\Message\ResponseInterface::withStatus($code, $reasonPhrase = <default>)
#1327
Closed
ccc-nghia-le opened this issue
Jun 29, 2023
· 6 comments
I created a deployment in elasticloud, and set up the connection. Then I performed a search using $client->search() surrounded it with a try catch code block,
via debugging I could it failed with http code 401 Unauthorised, I believe there is something wrong with my elasticloud setup, that's fine. I expected it would hit my catch() block but it never did. Instead there was an error thrown:
Declaration of Elastic\Elasticsearch\Response\Elasticsearch::withStatus(int $code, string $reasonPhrase = ''): Psr\Http\Message\ResponseInterface must be compatible with PsrExt\Http\Message\ResponseInterface::withStatus($code, $reasonPhrase = <default>)
I got this too.
Had to do composer require elasticsearch/elasticsearch:8.8.0 to get it working, something about allowing psr/http-message: ^2 is causing issues from 8.8.1
I got this too. Had to do composer require elasticsearch/elasticsearch:8.8.0 to get it working, something about allowing psr/http-message: ^2 is causing issues from 8.8.1
Downgrading to 8.8.0 did actually help. Thank you very much !
I hope they will fix this soon in a future release.
Summary of problem or feature request
I created a deployment in elasticloud, and set up the connection. Then I performed a search using $client->search() surrounded it with a try catch code block,
via debugging I could it failed with http code 401 Unauthorised, I believe there is something wrong with my elasticloud setup, that's fine. I expected it would hit my catch() block but it never did. Instead there was an error thrown:
Code snippet of problem
$client = Elastic\Elasticsearch\ClientBuilder::create()
->setElasticCloudId('')
->setApiKey('')
->build();
try {
$result = $client->search($params);
} catch (\Exception $e) {
dd(' It should hit here but it did not');
}
System details
The text was updated successfully, but these errors were encountered: