Skip to content
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

ElasticsearchAsyncSearchClient: Error Responses can't be deserialized #674

Open
str8y opened this issue Sep 15, 2023 · 2 comments
Open

ElasticsearchAsyncSearchClient: Error Responses can't be deserialized #674

str8y opened this issue Sep 15, 2023 · 2 comments
Labels
Category: Bug Something isn't working

Comments

@str8y
Copy link

str8y commented Sep 15, 2023

Java API client version

8.7.1

Java version

17

Elasticsearch Version

8.7.1

Problem description

The ElasticsearchAsyncSearchClient expects ErrorResponse in case of an issue.
ErrorResponse has status as a required property but the Elasticsearch error response for asyncSearch requests doesn't have a status -> ErrorResponse can't be deserialized. Instead the Endpoint's ResponseType is returned (if this can be deserialized) and the actual issue is suppressed.

@l-trotta
Copy link
Contributor

Hello, thanks for reporting this! I tried to reproduce this, but I'm getting the same errors both with the synchronous client and the asynchronous client. If this is still an issue, could you provide an example of this behaviour? Thank you.

@l-trotta l-trotta added the Category: Bug Something isn't working label Apr 23, 2024
@str8y
Copy link
Author

str8y commented Apr 25, 2024

Which version did you test? I still see issues (different ones, as for 8.7.1) with version 8.12.2.
The response from es contains more than just error or status, which could be read by co.elastic.clients.transport.endpoints.EndpointBase#errorDeserializer

{ "is_partial": true, "is_running": false, "start_time_in_millis": 1714037648836, "expiration_time_in_millis": 1714037707836, "completion_time_in_millis": 1714037648838, "response": { "took": 2, "timed_out": false, "terminated_early": false, "num_reduce_phases": 0, "_shards": { "total": 3, "successful": 0, "skipped": 0, "failed": 0 }, "hits": { "total": { "value": 0, "relation": "gte" }, "max_score": null, "hits": [] } }, "error": { "type": "status_exception", "reason": "error while executing search", "caused_by": { "type": "search_phase_execution_exception", "reason": "", "phase": "fetch", "grouped": true, "failed_shards": [], "caused_by": { "type": "too_many_buckets_exception", "reason": "Trying to create too many buckets. Must be less than or equal to: [5] but this number of buckets was exceeded. This limit can be set by changing the [search.max_buckets] cluster level setting.", "max_buckets": 5 } } } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants