# Error: \[illegal\_state\_exception\] trying to merge the field stats of field

**URL:** <https://discuss.elastic.co/t/error-illegal-state-exception-trying-to-merge-the-field-stats-of-field/50749>\
**Category:** Elasticsearch\
**Created:** [May 23, 2016, 5:42pm UTC](https://discuss.elastic.co/t/error-illegal-state-exception-trying-to-merge-the-field-stats-of-field/50749 "2016-05-23T17:42:41Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Wurtz](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@Mike\_Wurtz](https://discuss.elastic.co/u/Mike_Wurtz)\
**Post date:** [May 23, 2016, 5:42pm UTC](https://discuss.elastic.co/t/error-illegal-state-exception-trying-to-merge-the-field-stats-of-field/50749/1 "2016-05-23T17:42:41Z")

</div>

After setting up a new Elasticsearch 5 Alpha 2 cluster, and redirecting our logstash pipe to send logs to this new cluster, I'm getting this error in Kibana:

`Error: [illegal_state_exception] trying to merge the field stats of field [@timestamp] from index [logstash-2016.05.22] but the field type is incompatible, try to set the 'level' option to 'indices' at respond (https://10.40.10.118/bundles/commons.bundle.js?v=12279:75:27112) at checkRespForFailure (https://10.40.10.118/bundles/commons.bundle.js?v=12279:75:26340) at https://10.40.10.118/bundles/commons.bundle.js?v=12279:75:5070 at processQueue (https://10.40.10.118/bundles/commons.bundle.js?v=12279:38:23627) at https://10.40.10.118/bundles/commons.bundle.js?v=12279:38:23894 at Scope.$eval (https://10.40.10.118/bundles/commons.bundle.js?v=12279:39:4619) at Scope.$digest (https://10.40.10.118/bundles/commons.bundle.js?v=12279:39:2359) at Scope.$apply (https://10.40.10.118/bundles/commons.bundle.js?v=12279:39:5037) at done (https://10.40.10.118/bundles/commons.bundle.js?v=12279:37:25027) at completeRequest (https://10.40.10.118/bundles/commons.bundle.js?v=12279:37:28702)`

This error shows up when I open the Discover tab in Kibana.

It looks like this is a known issue.. Is there a work around so my team can continue to use Kibana until the next release?

---

<div class="post-metadata">

**Author:** ![spalger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spalger/32/14092_2.png) [@spalger](https://discuss.elastic.co/u/spalger)\
**Post date:** [May 23, 2016, 6:27pm UTC](https://discuss.elastic.co/t/error-illegal-state-exception-trying-to-merge-the-field-stats-of-field/50749/2 "2016-05-23T18:27:17Z")

</div>

Best I can tell, this is an issue with the mappings in your indices not matching quite right. See [https://github.com/elastic/elasticsearch/issues/18135](https://github.com/elastic/elasticsearch/issues/18135)

---

<div class="post-metadata">

**Author:** ![Mike\_Wurtz](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@Mike\_Wurtz](https://discuss.elastic.co/u/Mike_Wurtz)\
**Post date:** [May 23, 2016, 7:09pm UTC](https://discuss.elastic.co/t/error-illegal-state-exception-trying-to-merge-the-field-stats-of-field/50749/3 "2016-05-23T19:09:22Z")

</div>

Meaning, mappings in some indices, differ from mappings in other indices? This shouldn't be the case, as there was no preexisting data before I started sending data in from logstash on the new cluster.

---

<div class="post-metadata">

**Author:** ![Mike\_Wurtz](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@Mike\_Wurtz](https://discuss.elastic.co/u/Mike_Wurtz)\
**Post date:** [May 23, 2016, 7:26pm UTC](https://discuss.elastic.co/t/error-illegal-state-exception-trying-to-merge-the-field-stats-of-field/50749/4 "2016-05-23T19:26:21Z")

</div>

I've gotten past the error, hopefully for good... This is how:

1. Stopped the Logstash pipeline
2. Deleted all logstash-\* indices, (2 days worth)
3. Deleted the logstash pattern in Kibana
4. Re-started logstash pipline
5. Re-created logstash index pattern

Now I'm able to explore in Kibana and I don't see the error.. I'll update this thread if the issue comes back.

In hindsight, it may be wise to just delete the index mentioned in the exception.

---

<div class="post-metadata">

**Author:** ![Mike\_Wurtz](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@Mike\_Wurtz](https://discuss.elastic.co/u/Mike_Wurtz)\
**Post date:** [May 24, 2016, 12:03am UTC](https://discuss.elastic.co/t/error-illegal-state-exception-trying-to-merge-the-field-stats-of-field/50749/5 "2016-05-24T00:03:35Z")

</div>

The error has come back:

`Error: [illegal_state_exception] trying to merge the field stats of field [@timestamp] from index [logstash-2016.05.23] but the field type is incompatible, try to set the 'level' option to 'indices' at respond (https://10.40.10.118/bundles/commons.bundle.js?v=12279:75:27112) at checkRespForFailure (https://10.40.10.118/bundles/commons.bundle.js?v=12279:75:26340) at https://10.40.10.118/bundles/commons.bundle.js?v=12279:75:5070 at processQueue (https://10.40.10.118/bundles/commons.bundle.js?v=12279:38:23627) at https://10.40.10.118/bundles/commons.bundle.js?v=12279:38:23894 at Scope.$eval (https://10.40.10.118/bundles/commons.bundle.js?v=12279:39:4619) at Scope.$digest (https://10.40.10.118/bundles/commons.bundle.js?v=12279:39:2359) at Scope.$apply (https://10.40.10.118/bundles/commons.bundle.js?v=12279:39:5037) at done (https://10.40.10.118/bundles/commons.bundle.js?v=12279:37:25027) at completeRequest (https://10.40.10.118/bundles/commons.bundle.js?v=12279:37:28702)`

It seems like if there is only one Logstash index, Kibana works fine, but as soon as logstash creates a new index, this error comes up on the explore tab and we're unable to use kibana.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/6/64c2cb7467fe1bb192b4e5ab54492faf04fdbd2d.png)

---

<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:** [May 24, 2016, 10:14am UTC](https://discuss.elastic.co/t/error-illegal-state-exception-trying-to-merge-the-field-stats-of-field/50749/6 "2016-05-24T10:14:33Z")

</div>

Have you checked the mappings for each index to see if they are consistent?

---

<div class="post-metadata">

**Author:** ![Mike\_Wurtz](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@Mike\_Wurtz](https://discuss.elastic.co/u/Mike_Wurtz)\
**Post date:** [May 24, 2016, 4:58pm UTC](https://discuss.elastic.co/t/error-illegal-state-exception-trying-to-merge-the-field-stats-of-field/50749/7 "2016-05-24T16:58:36Z")

</div>

What I've done to workaround this issue, is configured logstash to not create a new index everyday, but use the same index until this bug is fixed.

Since I only have one index now, there is not another index for me to compare mappings against. I believe this issue is the same issue addressed here: [https://github.com/elastic/elasticsearch/issues/18135](https://github.com/elastic/elasticsearch/issues/18135)

Also, this thread probably belongs under the Elasticsearch section, as this is caused by ES, and not Kibana.

---

<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:** [May 24, 2016, 7:37pm UTC](https://discuss.elastic.co/t/error-illegal-state-exception-trying-to-merge-the-field-stats-of-field/50749/8 "2016-05-24T19:37:53Z")

</div>

You can move topics by clicking the edit button beside the topic title 🙂

---

<div class="post-metadata">

**Author:** ![Mike\_Wurtz](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@Mike\_Wurtz](https://discuss.elastic.co/u/Mike_Wurtz)\
**Post date:** [May 24, 2016, 9:05pm UTC](https://discuss.elastic.co/t/error-illegal-state-exception-trying-to-merge-the-field-stats-of-field/50749/9 "2016-05-24T21:05:42Z")

</div>

And the error is back.. Workarounds have not worked.. The cluster is basically unusable after a day.

`Error: [illegal_state_exception] trying to merge the field stats of field [@timestamp] from index [logstash-2016] but the field type is incompatible, try to set the 'level' option to 'indices' at respond (https://10.40.10.118/bundles/commons.bundle.js?v=12279:75:27112) at checkRespForFailure (https://10.40.10.118/bundles/commons.bundle.js?v=12279:75:26340) at https://10.40.10.118/bundles/commons.bundle.js?v=12279:75:5070 at processQueue (https://10.40.10.118/bundles/commons.bundle.js?v=12279:38:23627) at https://10.40.10.118/bundles/commons.bundle.js?v=12279:38:23894 at Scope.$eval (https://10.40.10.118/bundles/commons.bundle.js?v=12279:39:4619) at Scope.$digest (https://10.40.10.118/bundles/commons.bundle.js?v=12279:39:2359) at Scope.$apply (https://10.40.10.118/bundles/commons.bundle.js?v=12279:39:5037) at done (https://10.40.10.118/bundles/commons.bundle.js?v=12279:37:25027) at completeRequest (https://10.40.10.118/bundles/commons.bundle.js?v=12279:37:28702)`

Does anyone have any clue when the fix for this might be released?

 ![](https://us1.discourse-cdn.com/elastic/original/2X/2/23fc082dc2864b6e09df05df0f7043cb2d6d749f.png)  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/5/568b762d2b6f1c24104df8c26e0e54764299ae5a.png)

---

<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:** [May 24, 2016, 9:07pm UTC](https://discuss.elastic.co/t/error-illegal-state-exception-trying-to-merge-the-field-stats-of-field/50749/10 "2016-05-24T21:07:56Z")

</div>

Probably in the next alpha, not sure when that is scheduled though sorry.

---

<div class="post-metadata">

**Author:** ![Mike\_Wurtz](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@Mike\_Wurtz](https://discuss.elastic.co/u/Mike_Wurtz)\
**Post date:** [June 2, 2016, 5:46pm UTC](https://discuss.elastic.co/t/error-illegal-state-exception-trying-to-merge-the-field-stats-of-field/50749/11 "2016-06-02T17:46:25Z")

</div>

Upgrading to Alpha 3 appears to have resolved this issue.

Thanks.

---

<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:46pm UTC](https://discuss.elastic.co/t/error-illegal-state-exception-trying-to-merge-the-field-stats-of-field/50749/12 "2017-07-05T22:46:47Z")

</div>


