# Too\_many\_buckets\_exception after patching to 7.x

**URL:** <https://discuss.elastic.co/t/too-many-buckets-exception-after-patching-to-7-x/204409>\
**Category:** Elasticsearch\
**Created:** [October 21, 2019, 7:57am UTC](https://discuss.elastic.co/t/too-many-buckets-exception-after-patching-to-7-x/204409 "2019-10-21T07:57:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefws](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stefws/32/6442_2.png) [@stefws](https://discuss.elastic.co/u/stefws)\
**Post date:** [October 21, 2019, 7:57am UTC](https://discuss.elastic.co/t/too-many-buckets-exception-after-patching-to-7-x/204409/1 "2019-10-21T07:57:22Z")

</div>

I'm getting this error in our some of our Grafana panels now after updating to 7.4 from 6.8:

```
type:"too_many_buckets_exception"

reason:"Trying to create too many buckets. Must be less than or equal to: [10000] but was [10001]. This limit can be set by changing the [search.max_buckets] cluster level setting."

```

Elastic ref says:

`The maximum number of buckets allowed in a single response is limited by a dynamic cluster setting named`search.max\_buckets`. It defaults to 10,000, requests that try to return more than the limit will fail with an exception`

Seeing [this issue](https://discuss.elastic.co/t/search-max-buckets-limit-error-on-7-0-1/179989) also after updating to 7.x, mentioning: 'So be careful about making the limit too high'

What might be considered too high, when nodes trips over with OOM or...?

---

<div class="post-metadata">

**Author:** ![Denis\_Lamanov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/denis_lamanov/32/13111_2.png) [@Denis\_Lamanov](https://discuss.elastic.co/u/Denis_Lamanov)\
**Post date:** [October 21, 2019, 10:37am UTC](https://discuss.elastic.co/t/too-many-buckets-exception-after-patching-to-7-x/204409/2 "2019-10-21T10:37:32Z")

</div>

You should decrease time period or increase group interval for charts in order to decrease buckets count. Also Grafana should use composite aggregator or scroll API

> <https://github.com/grafana/grafana/issues/17327>

---

<div class="post-metadata">

**Author:** ![stefws](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stefws/32/6442_2.png) [@stefws](https://discuss.elastic.co/u/stefws)\
**Post date:** [October 21, 2019, 11:08am UTC](https://discuss.elastic.co/t/too-many-buckets-exception-after-patching-to-7-x/204409/3 "2019-10-21T11:08:33Z")

</div>

time period is hard to decrease as grafana users can select a 'large' time periods to view many data points.

Something most have changed in 7.x vs. previous version as these specific grafana panels have always worked with default search.max\_buckets in version 2.x, 5.x and 6.x.

Now I've increased search.max\_buckets to \> 35000 then panels seems to work again also showing larger time periods.

---

<div class="post-metadata">

**Author:** ![Denis\_Lamanov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/denis_lamanov/32/13111_2.png) [@Denis\_Lamanov](https://discuss.elastic.co/u/Denis_Lamanov)\
**Post date:** [October 21, 2019, 11:14am UTC](https://discuss.elastic.co/t/too-many-buckets-exception-after-patching-to-7-x/204409/4 "2019-10-21T11:14:46Z")

</div>

According to breaking 7.0 changes  
[https://www.elastic.co/guide/en/elasticsearch/reference/7.0/breaking-changes-7.0.html#search-max-buckets-cluster-setting](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/breaking-changes-7.0.html#search-max-buckets-cluster-setting)

---

<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:** [November 18, 2019, 11:14am UTC](https://discuss.elastic.co/t/too-many-buckets-exception-after-patching-to-7-x/204409/5 "2019-11-18T11:14:50Z")

</div>

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