-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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 - Date field used as sort option can crash ES with BigInteger error #48074
Comments
Pinging @elastic/es-search (:Search/Search) |
It seems that your library rewrites the json response since the raw response should contain |
Can you please explain? Doing the above causes Elasticsearch service to terminate. Sending bad data should not terminate the ES service with a fatal exception. This is not an issue with a client as i can reproduce it using curl. Furthermore this was not an issue on 6.x, and only seems to be an issue after we updated to 7.x. Doing this:
Should not lead to this:
|
I read the issue too quickly, sorry. We accept BigInteger now in xcontent but this code was not updated. This is indeed a bug, hence reopening. |
The support for BigInteger and BigDecimal was added for XContent in elastic#32888. However the SearchAfterBuilder xcontent parser doesn't expect them to be present so it throws an AssertionError. This change fixes this discrepancy by changing the AssertionError into an IllegalArgumentException that will not cause the node to die when thrown. Closes elastic#48074
Thank you @jimczi ! |
* Do not throw errors on unknown types in SearchAfterBuilder The support for BigInteger and BigDecimal was added for XContent in #32888. However the SearchAfterBuilder xcontent parser doesn't expect them to be present so it throws an AssertionError. This change fixes this discrepancy by changing the AssertionError into an IllegalArgumentException that will not cause the node to die when thrown. Closes #48074
* Do not throw errors on unknown types in SearchAfterBuilder The support for BigInteger and BigDecimal was added for XContent in #32888. However the SearchAfterBuilder xcontent parser doesn't expect them to be present so it throws an AssertionError. This change fixes this discrepancy by changing the AssertionError into an IllegalArgumentException that will not cause the node to die when thrown. Closes #48074
* Do not throw errors on unknown types in SearchAfterBuilder The support for BigInteger and BigDecimal was added for XContent in #32888. However the SearchAfterBuilder xcontent parser doesn't expect them to be present so it throws an AssertionError. This change fixes this discrepancy by changing the AssertionError into an IllegalArgumentException that will not cause the node to die when thrown. Closes #48074
Elasticsearch version (
bin/elasticsearch --version
): 7.3.1Plugins installed: [discovery-ec2, repository-s3]
JVM version (
java -version
):java version "11.0.4" 2019-07-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.4+10-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.4+10-LTS, mixed mode)
OS version (
uname -a
if on a Unix-like system):Linux XXXXXXXXX 4.15.0-1051-aws #53-Ubuntu SMP Wed Sep 18 13:35:53 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Description of the problem including expected versus actual behavior:
The date value returned in the
sort
field returned in a document from_search
had a value that was invalid. When this was passed back in to thesearch_after
field, this caused the request to fail with ajava.lang.AssertionError: Unknown number type []BIG_INTEGER
error. With enough errors, this ended up crashing ES. We were seeing this take down an entire cluster with only a couple requests.The values returned from the
sort
field of a document from_search
are expected to be valid and are expected to not cause crashes in the ES application.Steps to reproduce:
Good example:
Bad example:
sort
search_after
field.Stack Trace
The text was updated successfully, but these errors were encountered: