# Illegal\_state\_exception with reason unexpected byte \[0xff\]

**URL:** <https://discuss.elastic.co/t/illegal-state-exception-with-reason-unexpected-byte-0xff/118310>\
**Category:** Elasticsearch\
**Created:** [February 3, 2018, 11:27am UTC](https://discuss.elastic.co/t/illegal-state-exception-with-reason-unexpected-byte-0xff/118310 "2018-02-03T11:27:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![iam.Carrot](https://avatars.discourse-cdn.com/v4/letter/i/a9adbd/32.png) [@iam.Carrot](https://discuss.elastic.co/u/iam.Carrot)\
**Post date:** [February 3, 2018, 11:27am UTC](https://discuss.elastic.co/t/illegal-state-exception-with-reason-unexpected-byte-0xff/118310/1 "2018-02-03T11:27:02Z")

</div>

Hi I am using elasticsearch to search through data. I get the below response:

```
{
   "error": {
       "root_cause": [
          {
           "type": "illegal_state_exception",
           "reason": "unexpected byte [0xff]"
          }
       ],
       "type": "search_phase_execution_exception",
       "reason": "all shards failed",
       "phase": "query",
       "grouped": true,
       "failed_shards": [
          {
             "shard": 0,
             "index": "locationdb_160",
             "node": "31mUy4upTjqVgE6mPZo9Zg",
             "reason": 
             {
                 "type": "illegal_state_exception",
                 "reason": "unexpected byte [0xff]"
             }
          }
       ]
     },
     "status": 500
}

```

below is my query:

```
{
"query": {
"bool": {
  "must": [
    {
      "query_string": {
        "query": "location",
        "fields": [
          "pop_nme^1.0",
          "c_keywords^1.0",
          "poi_nme^1.0",
          "poplr_nme^1.0",
          "sb_nme^1.0"
        ],
        "use_dis_max": false,
        "tie_breaker": 0,
        "default_operator": "and",
        "auto_generate_phrase_queries": false,
        "max_determinized_states": 10000,
        "enable_position_increments": true,
        "fuzziness": "0",
        "fuzzy_prefix_length": 0,
        "fuzzy_max_expansions": 50,
        "phrase_slop": 0,
        "analyze_wildcard": true,
        "escape": false,
        "split_on_whitespace": true,
        "boost": 1
      }
    }
  ],
  "filter": [
    {
      "geo_distance": {
        "dist_loc": [
          77.217423,
          28.63146
        ],
        "distance": 10000,
        "distance_type": "arc",
        "validation_method": "STRICT",
        "ignore_unmapped": false,
        "boost": 1
      }
    }
  ],
  "disable_coord": false,
  "adjust_pure_negative": true,
  "boost": 1
}
}
}

```

What I am I doing wrong?

I had recently migrated to elasticsearch 6.1.3 it used to work quite well on elasticsearch 5.6

I've narrowed it down to the filter section, when I use a `geo_bounding_box` filter it works just fine: for example:

when I swap the filter with the below code it just works.

```
"filter": [
    {
      "geo_bounding_box": {
        "dist_loc": {
          "top_left": [
            77.21002578735352,
            28.506712182731704
          ],
          "bottom_right": [
            76.93536758422852,
            28.44937385955666
          ]
        },
        "validation_method": "STRICT",
        "type": "MEMORY",
        "ignore_unmapped": false,
        "boost": 1
      }
    }
  ]
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 3, 2018, 11:27am UTC](https://discuss.elastic.co/t/illegal-state-exception-with-reason-unexpected-byte-0xff/118310/2 "2018-03-03T11:27:09Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
