-
Notifications
You must be signed in to change notification settings - Fork 969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Declaration of Elastic\Elasticsearch\Response\Elasticsearch::withStatus must be compatible #1342
Comments
This is similar to issue #1327. The randomness of this issue is very strange. Can you try to downgrade to 8.8.0 to check if the error still occurs? Let me know, thanks. |
@gjuric since we have issues due to the different interfaces of |
@gjuric I'm investigating and I discovered that we should require |
@gjuric I provided a fix in #1344. @cappadaan can you try this change and let me know if this fix the issue? Thanks! |
I finally reproduced the issue. This error occurs when you have |
This issue still exists in Release 8.9.0 |
@cappadaan if you run |
psr/http-message 2.0 Common interface for HTTP messages |
@cappadaan how did you install the new |
|
@cappadaan can you paste the |
elastic/transport v8.7.0 HTTP transport PHP library for Elastic products psr/cache 3.0.0 Common interface for caching libraries I cannot share everything, need a specific one? |
@cappadaan I was experiencing a similar error, I found the solution to use a different Http Client as mentioned at https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/http-client.html#http-client. I updated my code block as below,
Error message I was getting was
Hope this solution has something to do with your problem. |
@cappadaan I'm trying to reproduce the issue but I failed. Can you try to have a clean installation using "elasticsearch/elasticsearch": "^8.9.0" in
Let me know, thanks! |
thx, so far this solution seems to work. |
This fatal error occurred again using 8.9.0. I will for now downgrade to 8.8.0. |
I ran into the same issue on 8.8.0 now, but this is the first in a long time: PHP Fatal error: Declaration of Elastic\Elasticsearch\Response\Elasticsearch::getStatusCode() must be compatible with Psr\Http\Message\ResponseInterface::getStatusCode() |
Similar issue has occurred for us as well. We installed Elasticsearch version 8.10.0. I installed ES-PHP client 8.9.0. After that I downgraded to Elasticsearch version 8.8.0 and ES-PHP client 8.8.1 but the problem continues. Fatal error: 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 = NULL) |
"elasticsearch/elasticsearch" required "psr/http-message": "^1.0 || ^2.0" I tried to update psr/http-message:^1.1 to psr/http-message:^1.0.1 version, and the project returned to normal. |
Out of nowhere we suddenly get this fatal error popping up.
It looks random, after running the same script again, it works fine.
Declaration of Elastic\Elasticsearch\Response\Elasticsearch::withStatus(int $code, string $reasonPhrase = ''): Psr\Http\Message\ResponseInterface must be compatible with Psr\Http\Message\ResponseInterface::withStatus($code, $reasonPhrase = '')
We do not use this method (withStatus) in our code.
Any ideas how to debug this? Or where to start? Could this be a bug?
The text was updated successfully, but these errors were encountered: