Open ddolcimascolo opened 3 years ago
For the sake of completeness: I just reproduced the same exception using the same Kibana script with Elasticsearch 7.13.2
Pinging @elastic/es-search (Team:Search)
@ddolcimascolo thanks for the report and the reproduction, I can confirm this. I don't know if retrieving ip_range
by docvalue_fields
should work but even if not the exception should be different then I think. As a workaround you can retrieve the ip_range values by using the fields
option I think.
Thx for confirming @cbuescher I can't currently use fields
because we're still on 7.9
For the record, fetching this via docvalue_fields
doesn't seem to have been supported previously, on 6.8 and on 7.2 I get
"reason": {
"type": "illegal_argument_exception",
"reason": "Fielddata is not supported on field [network] of type [ip_range]"
}
So this issue is probably more about making the exception nicer if possible, so I'm marking it as an enhancement, but a bug, unless you can point me to previous behaviour where this was possible?
@ddolcimascolo please note that we usually don't backport any enhancements or fixes to earlier minors, so updating is still advised if you really need this.
Actually, re-reading the issue I think because this now returns a 500
error code we should treat it as a bug and try to return a nicer error as before.
Yeah, I really opened the issue because of the 500 error. Getting a nice error message about the unsupported operation you're trying to do is so much better :)
And yes, switching to fields
is on my pipe already.
Thanks, David
I checked this reproduction on 7.17 again and fwiw there's still an AIOOB exception causing an error but we get a 400 response overall:
On our current main branch we don't get the AIOOB anymore but still some exception from the RAW docvalue formatter. I think generally range fields store doc values, but I think the ip range field in particular isn't decoding this back correctly atm. I need to do a bit of digging how other range types implement this and if its feasible to add for ip_range or not. The workaround of using the "fields" API would still be the preferred option here I think.
None of the range types (just checked "integer_range" and "date_range") seem to really work well with "docvalue_fields". "date_range" gives me an unsupported_operation_exception
while "integer_range" returns some weird control characters. This seems to never have been supported really in the past. I'm not sure we want to add support for this now with wider adoption of the "fields" API that works okay for both cases. Maybe we should think about giving clearer errors in all range type cases.
Pinging @elastic/es-search-foundations (Team:Search Foundations)
Elasticsearch version (
bin/elasticsearch --version
): 7.9.3Plugins installed: []
JVM version (
java -version
): Bundled JDK (JDK 11)OS version (
uname -a
if on a Unix-like system): Ubuntu 18.04Description of the problem including expected versus actual behavior:
Elasticsearch throws an AIOOBE when using
docvalue_fields
on aip_range
field. Maybe that's unsupported but it should not blow up with a HTTP 500 error code. Is it actually supported ?Steps to reproduce:
This Kibana script can be run in Dev Tools to reproduce
Provide logs (if relevant):
Cheers, David