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

_field_stats call on geo_point field broken after upgrading from 2.4.4 -> 5.3.1 #24275

Closed
n0othing opened this issue Apr 23, 2017 · 8 comments
Closed
Labels
>bug :Data Management/Indices APIs APIs to create and manage indices and templates

Comments

@n0othing
Copy link
Member

Elasticsearch version: 2.4.4/5.3.1

A _field_stats call on a type geo_point field throws an exception for an index that was created in 2.4.4 and upgraded to 5.3.1. I also reproduced this on going from 2.3.3 -> 5.3.0.

This causes Kibana to not properly grab the index mappings when defining an index pattern rendering all fields as neither searchable nor aggregatable.

Steps to reproduce:

  1. Create an index mapping with a geo_point field
PUT index
{
  "mappings": {
    "type": {
      "properties": {
        "geo_field": {
          "type": "geo_point"
        }
      }
    }
  }
}
  1. Add a sample document
PUT index/type/1
{
  "geo_field": "33.8957, -112.0577"
}
  1. Upgrade to 5.3.1 (I simply copied the data directory over)

  2. Attempt a _field_stats call on the geo_field

GET index/_field_stats?fields=geo_field

The response

{
  "_shards": {
    "total": 5,
    "successful": 4,
    "failed": 1,
    "failures": [
      {
        "shard": 3,
        "index": "index",
        "status": "INTERNAL_SERVER_ERROR",
        "reason": {
          "type": "exception",
          "reason": "java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: 5",
          "caused_by": {
            "type": "execution_exception",
            "reason": "java.lang.ArrayIndexOutOfBoundsException: 5",
            "caused_by": {
              "type": "array_index_out_of_bounds_exception",
              "reason": "5"
            }
          }
        }
      }
    ]
  },
  "indices": {
    "_all": {
      "fields": {}
    }
  }
}
@jimczi
Copy link
Contributor

jimczi commented Apr 23, 2017

This seems to be a deserialization error with geo_point encoding in 2.x. @nknize can you take a look ?

@clintongormley
Copy link
Contributor

@n0othing also note that field stats is deprecated in favour of the new field caps API (5.4)

@Bargs
Copy link

Bargs commented Apr 25, 2017

We've had a couple reports of this affecting Kibana users already. Because we use field stats to figure out the searchable/aggregatable status of fields this effectively breaks Kibana for any index patterns containing a geo_point field after upgrading to 5.3.1 from 2.x

elastic/kibana#11379
elastic/kibana#11377
elastic/kibana#9571 (comment)

@nknize
Copy link
Contributor

nknize commented May 6, 2017

PR opened.... #24534

@ppf2
Copy link
Member

ppf2 commented Jun 5, 2017

Per the PR, this is fixed in 5.3.3 and 5.4.1, should we close?

@kobelb
Copy link
Contributor

kobelb commented Jun 13, 2017

I'm still seeing this behavior when upgrading from 2.x to 5.4.1 and 5.3.3

@nknize
Copy link
Contributor

nknize commented Jun 14, 2017

There was a reversed ternary logic bug that wasn't caught by the munged test. Opened fix at #25211 for 5.4.2 release /cc @jimczi @clintongormley

@nknize
Copy link
Contributor

nknize commented Jun 14, 2017

fix is merged in #25211

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Data Management/Indices APIs APIs to create and manage indices and templates
Projects
None yet
Development

No branches or pull requests

7 participants