# ElasticSearch “Can't get text on a VALUE\_NULL at 1:60”

**URL:** <https://discuss.elastic.co/t/elasticsearch-cant-get-text-on-a-value-null-at-1-60/48021>\
**Category:** Elasticsearch\
**Created:** [April 21, 2016, 10:17am UTC](https://discuss.elastic.co/t/elasticsearch-cant-get-text-on-a-value-null-at-1-60/48021 "2016-04-21T10:17:59Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![srdealx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/srdealx/32/8111_2.png) [@srdealx](https://discuss.elastic.co/u/srdealx)\
**Post date:** [April 21, 2016, 10:17am UTC](https://discuss.elastic.co/t/elasticsearch-cant-get-text-on-a-value-null-at-1-60/48021/1 "2016-04-21T10:17:59Z")

</div>

When running queries on one of my indexes I get an error on Elastic.

```
{
  "error" : {
    "root_cause" : [ {
      "type" : "illegal_state_exception",
      "reason" : "Can't get text on a VALUE_NULL at 1:60"
    } ],
    "type" : "search_phase_execution_exception",
    "reason" : "all shards failed",
    "phase" : "query",
    "grouped" : true,
    "failed_shards" : [ {
      "shard" : 0,
      "index" : "someIndexName",
      "node" : "sfsfd5sdf",
      "reason" : {
        "type" : "illegal_state_exception",
        "reason" : "Can't get text on a VALUE_NULL at 1:60"
      }
    } ]
  },
  "status" : 500
}

```

My configuration:

```
{
  "cluster_name" : "clusterName",
  "status" : "green",
  "number_of_nodes" : 2,
  "number_of_data_nodes" : 2,
  "active_primary_shards" : 16,
  "active_shards" : 32,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 100.0
}

"version" : {
    "number" : "2.3.1",
    "build_hash" : "bd980929010aef404e7cb0843e61d0665269fc39",
    "build_timestamp" : "2016-04-04T12:25:05Z",
    "build_snapshot" : false,
    "lucene_version" : "5.5.0"
},

```

Offending query example:

```
{
   "fields": ["id", "coordsField",null],
   "query": {
   },
   "size": 0,
   "aggregations": {
       "zoom1": {
           "geohash_grid": {
               "field": "coordsField",
               "size": 5000,
               "precision": 7
           },
           "aggs": {
               "geohash": {
                   "top_hits": {
                       "sort": {
                           "id": {
                               "order": "desc",
                               "ignore_unmapped": true
                           }
                       },
                       "_source": false,
                       "fielddata_fields": ["id", "coordsField", null],
                       "size": 1
                   }
               }
           }
       }
   }

```

}

Googled but didn't find anything related. Where should I start searching to get an ideea for the cause ?

> <https://stackoverflow.com/questions/36765470/elasticsearch-cant-get-text-on-a-value-null-at-160>

## other data:

response for dev ( ES 2.2.1 + ES 2.3.0 )

```
{
  "took" : 4,
  "timed_out" : false,
  "_shards" : {
    "total" : 4,
    "successful" : 2,
    "failed" : 2,
    "failures" : [ {
      "shard" : 0,
      "index" : "locations",
      "node" : "IyfjTQqeQEuZVWDTX_p4qA",
      "reason" : {
        "type" : "illegal_state_exception",
        "reason" : "Can't get text on a VALUE_NULL at 3:35"
      }
    } ]
  },
  "hits" : {
    "total" : 0,
    "max_score" : 0.0,
    "hits" : []
  },
  "aggregations" : {
    "zoom1" : {
      "buckets" : []
    }
  }
}

```

response for ES 2.3.1

```
{
  "error" : {
    "root_cause" : [ {
      "type" : "illegal_state_exception",
      "reason" : "Can't get text on a VALUE_NULL at 3:35"
    } ],
    "type" : "search_phase_execution_exception",
    "reason" : "all shards failed",
    "phase" : "query",
    "grouped" : true,
    "failed_shards" : [ {
      "shard" : 0,
      "index" : "locations",
      "node" : "Dxztr9L1TiiNi5gU02MYGQ",
      "reason" : {
        "type" : "illegal_state_exception",
        "reason" : "Can't get text on a VALUE_NULL at 3:35"
      }
    } ]
  },
  "status" : 500
}
```

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [April 21, 2016, 11:35am UTC](https://discuss.elastic.co/t/elasticsearch-cant-get-text-on-a-value-null-at-1-60/48021/2 "2016-04-21T11:35:17Z")

</div>

Can you post the offending query?

---

<div class="post-metadata">

**Author:** ![srdealx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/srdealx/32/8111_2.png) [@srdealx](https://discuss.elastic.co/u/srdealx)\
**Post date:** [April 21, 2016, 12:06pm UTC](https://discuss.elastic.co/t/elasticsearch-cant-get-text-on-a-value-null-at-1-60/48021/3 "2016-04-21T12:06:29Z")

</div>

done, the queries works fine on my dev box, but on the staging cluster they fail.  
I'm suspecting either the data/indexing to be different or the Elastic version (have 2.2.1 on my 2 node dev cluster)

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [April 21, 2016, 12:58pm UTC](https://discuss.elastic.co/t/elasticsearch-cant-get-text-on-a-value-null-at-1-60/48021/4 "2016-04-21T12:58:36Z")

</div>

I suggest removing clauses from the example query until you can distill it down to the smallest example that reproduces the error.

---

<div class="post-metadata">

**Author:** ![srdealx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/srdealx/32/8111_2.png) [@srdealx](https://discuss.elastic.co/u/srdealx)\
**Post date:** [April 21, 2016, 12:59pm UTC](https://discuss.elastic.co/t/elasticsearch-cant-get-text-on-a-value-null-at-1-60/48021/5 "2016-04-21T12:59:34Z")

</div>

good idea, will come back with the results

---

<div class="post-metadata">

**Author:** ![srdealx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/srdealx/32/8111_2.png) [@srdealx](https://discuss.elastic.co/u/srdealx)\
**Post date:** [April 21, 2016, 1:49pm UTC](https://discuss.elastic.co/t/elasticsearch-cant-get-text-on-a-value-null-at-1-60/48021/6 "2016-04-21T13:49:17Z")

</div>

The problem was the null in the fields, in the old (2.2.1) version it didn't care about it I guess.

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [April 21, 2016, 2:25pm UTC](https://discuss.elastic.co/t/elasticsearch-cant-get-text-on-a-value-null-at-1-60/48021/7 "2016-04-21T14:25:58Z")

</div>

Do you have the final simplified query?  
It might be a behaviour change that justifies a bugfix so it would be good to get a reproducible example.

---

<div class="post-metadata">

**Author:** ![srdealx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/srdealx/32/8111_2.png) [@srdealx](https://discuss.elastic.co/u/srdealx)\
**Post date:** [April 21, 2016, 3:01pm UTC](https://discuss.elastic.co/t/elasticsearch-cant-get-text-on-a-value-null-at-1-60/48021/8 "2016-04-21T15:01:29Z")

</div>

updated and added the responses. In the 2.2.1 version it returned the aggregation results.  
Also seems thing are more complicated on the dev side as one of the nodes had 2.3.0 🙂

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [April 21, 2016, 4:10pm UTC](https://discuss.elastic.co/t/elasticsearch-cant-get-text-on-a-value-null-at-1-60/48021/9 "2016-04-21T16:10:25Z")

</div>

Many thanks for that.  
I hadn't appreciated you were passing "null" as a field name (minus the quotes).  
That's not a scenario I think we have anticipated but an error seems appropriate - possibly with a better error message thrown at query-parse-time rather than query-execute-time

---

<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:** [July 5, 2017, 10:57pm UTC](https://discuss.elastic.co/t/elasticsearch-cant-get-text-on-a-value-null-at-1-60/48021/10 "2017-07-05T22:57:13Z")

</div>


