# Aggregations stop working silently on elasticsearch 1.4.4

**URL:** <https://discuss.elastic.co/t/aggregations-stop-working-silently-on-elasticsearch-1-4-4/28480>\
**Category:** Elasticsearch\
**Created:** [September 2, 2015, 3:04am UTC](https://discuss.elastic.co/t/aggregations-stop-working-silently-on-elasticsearch-1-4-4/28480 "2015-09-02T03:04:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anton\_Bogdanovich](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anton_bogdanovich/32/44922_2.png) [@Anton\_Bogdanovich](https://discuss.elastic.co/u/Anton_Bogdanovich)\
**Post date:** [September 2, 2015, 3:04am UTC](https://discuss.elastic.co/t/aggregations-stop-working-silently-on-elasticsearch-1-4-4/28480/1 "2015-09-02T03:04:32Z")

</div>

The following aggregation starts returning empty buckets while it returns the actual rows.  
{ "aggs": { "contact\_ids": { "terms": { "field": "contact\_id" } }}}

It starts returning the buckets properly after clearing the cache this way.  
curl -XPOST '[http://cluster.host:9200/\_cache/clear](http://cluster.host:9200/_cache/clear)' -d '{ "fielddata": "true" }'

But all this happens again after a while. Why does it fail silently? How to fix that?  
We have 6 nodes with 32Gb of memory each (16Gb for ES), 6 indexes with 5 shards each  
and around 200 million documents.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 2, 2015, 7:26am UTC](https://discuss.elastic.co/t/aggregations-stop-working-silently-on-elasticsearch-1-4-4/28480/2 "2015-09-02T07:26:44Z")

</div>

Check your logs, you may see something about circuit breaker there.

---

<div class="post-metadata">

**Author:** ![Anton\_Bogdanovich](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anton_bogdanovich/32/44922_2.png) [@Anton\_Bogdanovich](https://discuss.elastic.co/u/Anton_Bogdanovich)\
**Post date:** [September 2, 2015, 6:35pm UTC](https://discuss.elastic.co/t/aggregations-stop-working-silently-on-elasticsearch-1-4-4/28480/3 "2015-09-02T18:35:40Z")

</div>

We don't have any exceptions in our logs.

Could this mapping be an issue?  
One contact\_id has doc\_type: true, the other one does not.  
if contact\_id does have one fielddata fields for both types  
how then elasticsearch will decide if it need to use doc\_values?

```
           contact: {
              properties: {
                contact_id: { type: 'long', index: 'not_analyzed'}
              }
            },
            event: {
              _parent: { type: :contact },
              properties: {
                user_id: { type: 'long', index: 'not_analyzed' },
                contact_id: { type: 'long', index: 'not_analyzed', doc_values: true },
                data: { type: 'object', index: 'not_analyzed' },
              }
            }
```

---

<div class="post-metadata">

**Author:** ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)\
**Post date:** [September 3, 2015, 7:52am UTC](https://discuss.elastic.co/t/aggregations-stop-working-silently-on-elasticsearch-1-4-4/28480/4 "2015-09-03T07:52:58Z")

</div>

Could you show us what the response you get looks like?

---

<div class="post-metadata">

**Author:** ![Anton\_Bogdanovich](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anton_bogdanovich/32/44922_2.png) [@Anton\_Bogdanovich](https://discuss.elastic.co/u/Anton_Bogdanovich)\
**Post date:** [September 3, 2015, 5:21pm UTC](https://discuss.elastic.co/t/aggregations-stop-working-silently-on-elasticsearch-1-4-4/28480/5 "2015-09-03T17:21:48Z")

</div>

Query:

```
POST events_production_2015_04/contact/_search
{
    "query": {
        "filtered": {
            "filter": {
                "bool": {
                    "must": []
                }
            }
        }
    },
    "aggs": {
        "contact_ids": {
            "terms": { "field": "contact_id" }
        }
    }
}

```

Response:

```
{
   "took": 240,
   "timed_out": false,
   "_shards": {
      "total": 5,
      "successful": 5,
      "failed": 0
   },
   "hits": {
      "total": 3614637,
      "max_score": 1,
      "hits": [
         {
            "_index": "events_production_2015_04",
            "_type": "contact",
            "_id": "12094631113617",
            "_score": 1,
            "_source": {
               "contact_id": 12094631113617
            }
         },
         ...
         {
            "_index": "events_production_2015_04",
            "_type": "contact",
            "_id": "12094629244489",
            "_score": 1,
            "_source": {
               "contact_id": 12094629244489
            }
         }
      ]
   },
   "aggregations": {
      "contact_ids": {
         "doc_count_error_upper_bound": 0,
         "sum_other_doc_count": 0,
         "buckets": []
      }
   }
}

```

Then I do:

```
curl -XPOST 'http://cluster.host:9200/_cache/clear' -d '{ "fielddata": "true" }'

```

And just after that I do the same query and get the following result:

```
{
   "took": 2776,
   "timed_out": false,
   "_shards": {
      "total": 5,
      "successful": 5,
      "failed": 0
   },
   "hits": {
      "total": 3614639,
      "max_score": 1,
      "hits": [
         {
            "_index": "events_production_2015_04",
            "_type": "contact",
            "_id": "12094631113617",
            "_score": 1,
            "_source": {
               "contact_id": 12094631113617
            }
         },
         ...
         {
            "_index": "events_production_2015_04",
            "_type": "contact",
            "_id": "12094629244489",
            "_score": 1,
            "_source": {
               "contact_id": 12094629244489
            }
         }
      ]
   },
   "aggregations": {
      "contact_ids": {
         "doc_count_error_upper_bound": 5,
         "sum_other_doc_count": 3614629,
         "buckets": [
            {
               "key": 5497558141098,
               "doc_count": 1
            },
            ...
            {
               "key": 5497558191959,
               "doc_count": 1
            }
         ]
      }
   }
}

```

I don't get any CircuitBreakingException exceptions at all. I checked all the nodes log files, and query response does not return any exceptions as well.

---

<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, 11:52pm UTC](https://discuss.elastic.co/t/aggregations-stop-working-silently-on-elasticsearch-1-4-4/28480/6 "2017-07-05T23:52:12Z")

</div>


