elasticsearch-java icon indicating copy to clipboard operation
elasticsearch-java copied to clipboard

IndicesStatsRequest throws json error when encountering large values

Open nsn opened this issue 8 months ago • 1 comments

Java API client version

8.9.1

Java version

openJDK 17.0.8.1

Elasticsearch Version

7.17.6

Problem description

The Java Rest Client will throw a

co.elastic.clients.transport.TransportException : node: <redacted>, status: 200, [es/indices.stats] Failed to decode response caused by co.elastic.clients.json.JsonpMappingException: Error deserializing co.elastic.clients.elasticsearch._types.QueryCacheStats: jakarta.json.stream.JsonParsingException: Jackson exception: Numeric value (38167167154) out of range of int (-2147483648 - 2147483647)

when encountering large numbers. In my specific case this caused the problem:

cat status.json| jq '._all.primaries.query_cache.total_count' 38167167154

Edit: attached the status response JSON in a comment below

nsn avatar Oct 09 '23 21:10 nsn

status.json.txt

nsn avatar Oct 09 '23 21:10 nsn

Hello! This was recently fixed in the API specification used to produce the Java code with this PR. Updating the client to a more recent version should solve the problem.

l-trotta avatar Apr 24 '24 10:04 l-trotta