elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.79k stars 8.19k forks source link

Geopoint bound boxes create illegal searches to elastic #7300

Closed mut3 closed 8 years ago

mut3 commented 8 years ago

I was creating a heatmap visualization today and wanted to set a bounding box on it, but my kibana flashed up an error when I tried to draw a bounding box.

Kibana 4.5.0 Elastic 2.3.0

When I drew the box, kibana applies this filter:

 {
  "geo_bounding_box": {
    "geoip.location": {
      "top_left": {
        "lat": 62.34960927573045,
        "lon": -183.8671875
      },
      "bottom_right": {
        "lat": 10.660607953624762,
        "lon": -50.71289062499999
      }
    }
  }
}

And then returns this error from elastic

Error: Request to Elasticsearch failed: {"error":{"root_cause":[{"type":"query_parsing_exception","reason":"illegal longitude value [-183.8671875] for [geo_bbox]","index":"logstash-2016.05.26","line":1,"col":283}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"logstash-2016.05.26","node":"[redacted]","reason":{"type":"query_parsing_exception","reason":"illegal longitude value [-183.8671875] for [geo_bbox]","index":"logstash-2016.05.26","line":1,"col":283}}]}}
    at http://[redacted]/bundles/kibana.bundle.js?v=9889:88693:39
    at Function.Promise.try (http://[redacted]/bundles/commons.bundle.js?v=9889:64556:23)
    at http://[redacted]/bundles/commons.bundle.js?v=9889:64525:31
    at Array.map (native)
    at Function.Promise.map (http://[redacted]/bundles/commons.bundle.js?v=9889:64524:31)
    at callResponseHandlers (http://[redacted]/bundles/kibana.bundle.js?v=9889:88665:23)
    at http://[redacted]/bundles/kibana.bundle.js?v=9889:88170:17
    at processQueue (http://[redacted]/bundles/commons.bundle.js?v=9889:41836:29)
    at http://[redacted]/bundles/commons.bundle.js?v=9889:41852:28
    at Scope.$eval (http://[redacted]/bundles/commons.bundle.js?v=9889:43080:29)

I found this elastic discuss which identified the problem, lat/long have bounds 0-90. https://discuss.elastic.co/t/elasticsearch-not-accepting-data-for-geoip-location-where-the-latitude-is-above-90-0/40058

I manually adjusted the filter to be

{
  "geo_bounding_box": {
    "geoip.location": {
      "top_left": {
        "lat": 62.34960927573045,
        "lon": 3.8671875
      },
      "bottom_right": {
        "lat": 10.660607953624762,
        "lon": -50.71289062499999
      }
    }
  }
}

I noticed that this was triggered when my box crossed the date line west of Alaska, crossing -180 degrees.

Which did not cause an error.

This may only apply to bound boxes crossing the IDL.

Why doesn't kibana automagically fix the lon value when the bounding box gives back illegal values?

thomasneirynck commented 8 years ago

I verified this and could no longer reproduce this on Kibana 5.0. I appears to have been fixed for the 5.0 release of Kibana. (https://github.com/elastic/kibana/pull/7068)