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

[BUG] Caused by: jakarta.json.stream.JsonParsingException: Jackson exception: Numeric value (8567051952) out of range of int (-2147483648 - 2147483647) #959

Closed
oksanay opened this issue Apr 27, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@oksanay
Copy link
Contributor

oksanay commented Apr 27, 2024

What is the bug?

The same problem as it was described in the issue #299 and #184 and #875. We are using stats API and there is serialization problem with Exception. You have data structure QueryCacheStats, it has data types defined as int. Last time, fix #875 you changed only one data type for memorySizeInBytes to be long. We deployed the fix and it worked in integration, but now we are having production issue with another datatypes of this class.
They should be defined as longs as well. We are going to escalate this issue with AWS support team as well. We cannot wait for the fix 2 more month, as it was for our previous opened bug.

How can one reproduce the bug?

get stats for really large index. For example, this is the output of the stats query on a really large index where we are adding half a billion records per day:
"query_cache" : {
"memory_size_in_bytes" : 892496036,
"total_count" : 8757938874,
"hit_count" : 347443703,
"miss_count" : 8410495171,
"cache_size" : 18507,
"cache_count" : 169300,
"evictions" : 150793
},

So if you can see total_count, hit count, miss count should be defined in the data structure as longs.
This is some other stats for the index:
"_all" : {
"primaries" : {
"docs" : {
"count" : 426402088,
"deleted" : 182227227
},
"store" : {
"size_in_bytes" : 808861196868,
"reserved_in_bytes" : 0
},
"indexing" : {
"index_total" : 3499959692,
"index_time_in_millis" : 1625871835,
"index_current" : 0,
"index_failed" : 42374208,
"delete_total" : 3465272227,
"delete_time_in_millis" : 201070850,
"delete_current" : 0,
"noop_update_total" : 0,
"is_throttled" : false,
"throttle_time_in_millis" : 0
},

What is the expected behavior?

A clear and concise description of what you expected to happen.
Please change data types of all int in QueryCacheStats object to be longs, instead of an int

What is your host/environment?

Operating system, version.
aws/ OpenSearch. java client v 2.9.1 (2.10.1 has the same problem, we checked)

Do you have any screenshots?

Stack trace:
Caused by: jakarta.json.stream.JsonParsingException: Jackson exception: Numeric value (8567051952) out of range of int (-2147483648 - 2147483647)
at [Source: (GZIPInputStream); line: 1, column: 1571]
at org.opensearch.client.json.jackson.JacksonJsonpParser.convertException(JacksonJsonpParser.java:101)
at org.opensearch.client.json.jackson.JacksonJsonpParser.getInt(JacksonJsonpParser.java:172)
at org.opensearch.client.json.JsonpDeserializerBase$2.deserialize(JsonpDeserializerBase.java:126)
at org.opensearch.client.json.JsonpDeserializerBase$2.deserialize(JsonpDeserializerBase.java:120)
at org.opensearch.client.json.JsonpDeserializer.deserialize(JsonpDeserializer.java:87)
at org.opensearch.client.json.ObjectDeserializer$FieldObjectDeserializer.deserialize(ObjectDeserializer.java:81)
at org.opensearch.client.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:185)
at org.opensearch.client.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:146)
at org.opensearch.client.json.JsonpDeserializer.deserialize(JsonpDeserializer.java:87)
at org.opensearch.client.json.ObjectBuilderDeserializer.deserialize(ObjectBuilderDeserializer.java:91)
at org.opensearch.client.json.DelegatingDeserializer$SameType.deserialize(DelegatingDeserializer.java:55)
at org.opensearch.client.json.ObjectDeserializer$FieldObjectDeserializer.deserialize(ObjectDeserializer.java:81)
at org.opensearch.client.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:185)
at org.opensearch.client.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:146)
at org.opensearch.client.json.JsonpDeserializer.deserialize(JsonpDeserializer.java:87)
at org.opensearch.client.json.ObjectBuilderDeserializer.deserialize(ObjectBuilderDeserializer.java:91)
at org.opensearch.client.json.DelegatingDeserializer$SameType.deserialize(DelegatingDeserializer.java:55)
at org.opensearch.client.json.ObjectDeserializer$FieldObjectDeserializer.deserialize(ObjectDeserializer.java:81)
at org.opensearch.client.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:185)
at org.opensearch.client.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:146)
at org.opensearch.client.json.JsonpDeserializer.deserialize(JsonpDeserializer.java:87)
at org.opensearch.client.json.ObjectBuilderDeserializer.deserialize(ObjectBuilderDeserializer.java:91)
at org.opensearch.client.json.DelegatingDeserializer$SameType.deserialize(DelegatingDeserializer.java:55)
at org.opensearch.client.json.ObjectDeserializer$FieldObjectDeserializer.deserialize(ObjectDeserializer.java:81)
at org.opensearch.client.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:185)
at org.opensearch.client.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:146)
at org.opensearch.client.json.JsonpDeserializer.deserialize(JsonpDeserializer.java:87)
at org.opensearch.client.json.ObjectBuilderDeserializer.deserialize(ObjectBuilderDeserializer.java:91)
at org.opensearch.client.json.DelegatingDeserializer$SameType.deserialize(DelegatingDeserializer.java:55)
at org.opensearch.client.transport.aws.AwsSdk2Transport.parseResponse(AwsSdk2Transport.java:518)
at org.opensearch.client.transport.aws.AwsSdk2Transport.executeSync(AwsSdk2Transport.java:396)
at org.opensearch.client.transport.aws.AwsSdk2Transport.performRequest(AwsSdk2Transport.java:193)
at org.opensearch.client.opensearch.indices.OpenSearchIndicesClient.stats(OpenSearchIndicesClient.java:1682)
at org.opensearch.client.opensearch.indices.OpenSearchIndicesClient.stats(OpenSearchIndicesClient.java:1696)
at com.cloudcruiser.bravo.platform.analytics.datamanagement.client.opensearch.impl.OpenSearchJavaClient.lambda$getIndexStats$44(OpenSearchJavaClient.java:673)
at com.cloudcruiser.bravo.platform.analytics.datamanagement.client.opensearch.impl.OpenSearchJavaClient.run(OpenSearchJavaClient.java:820)
... 13 common frames omitted
Caused by: com.fasterxml.jackson.core.exc.InputCoercionException: Numeric value (8567051952) out of range of int (-2147483648 - 2147483647)
at [Source: (GZIPInputStream); line: 1, column: 1571]
at com.fasterxml.jackson.core.base.ParserMinimalBase._reportInputCoercion(ParserMinimalBase.java:638)
at com.fasterxml.jackson.core.base.ParserMinimalBase.reportOverflowInt(ParserMinimalBase.java:607)
at com.fasterxml.jackson.core.base.ParserBase.convertNumberToInt(ParserBase.java:1036)
at com.fasterxml.jackson.core.base.ParserBase._parseIntValue(ParserBase.java:960)
at com.fasterxml.jackson.core.base.ParserBase.getIntValue(ParserBase.java:766)
at org.opensearch.client.json.jackson.JacksonJsonpParser.getInt(JacksonJsonpParser.java:170)
... 47 common frames omitted
1:40

Do you have any additional context?

Add any other context about the problem.
The bug was reported before version 2.5.x and marked as fixed, then it was fixed in 2.9.1 and we are still having the same issue.
Somehow we need the fix asap, since now it is a production issue
Please note: There is the same issue in opensearch-rest client which is deprecated

@oksanay oksanay added bug Something isn't working untriaged labels Apr 27, 2024
@dblock
Copy link
Member

dblock commented Apr 27, 2024

@oksanay Can you help and contribute this fix with a test? We can release it quickly.

@oksanay
Copy link
Contributor Author

oksanay commented Apr 30, 2024

@dblock I have a pr, but there are failures. I am not sure they are related to my changes. Would you please help me?
#960

@VachaShah
Copy link
Collaborator

The fix was released in 2.10.2.

@oksanay
Copy link
Contributor Author

oksanay commented May 16, 2024

Thank you , @VachaShah we picked it up already. I found another bug, I'll submit it shortly

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

No branches or pull requests

4 participants