# Unexpected error while indexing monitoring document org.elasticsearch.xpack.monitoring

**URL:** https://discuss.elastic.co/t/unexpected-error-while-indexing-monitoring-document-org-elasticsearch-xpack-monitoring/120750
**Category:** Elasticsearch
**Created:** [February 21, 2018, 1:49am UTC](https://discuss.elastic.co/t/unexpected-error-while-indexing-monitoring-document-org-elasticsearch-xpack-monitoring/120750 "2018-02-21T01:49:46Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [February 21, 2018, 1:49am UTC](https://discuss.elastic.co/t/unexpected-error-while-indexing-monitoring-document-org-elasticsearch-xpack-monitoring/120750/1 "2018-02-21T01:49:47Z")

</div>

Hello,

I updated from 5.6.2 to 6.2.1 on Sunday and today I started to get this error, which stopped all the indexing on my nodes whic made some data to be lost since I have tcp and udp inputs comingo from logstash that are lost if not indexed.

```auto
[2018-02-20T21:01:10,064][WARN][o.e.x.m.e.l.LocalExporter] unexpected error while indexing monitoring document
org.elasticsearch.xpack.monitoring.exporter.ExportException: UnavailableShardsException[[.monitoring-es-6-2018.02.21][0] primary shard is not active Timeout: [1m], request: [BulkShardRequest [[.monitoring-es-6-2018.02.21][0]] containing [233] requests]]
        at org.elasticsearch.xpack.monitoring.exporter.local.LocalBulk.lambda$throwExportException$2(LocalBulk.java:140) ~[?:?]
        at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_161]
        at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) ~[?:1.8.0_161]
        at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) ~[?:1.8.0_161]
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[?:1.8.0_161]
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[?:1.8.0_161]
        at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:1.8.0_161]
        at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:1.8.0_161]
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_161]
        at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) ~[?:1.8.0_161]
        at org.elasticsearch.xpack.monitoring.exporter.local.LocalBulk.throwExportException(LocalBulk.java:141) ~[?:?]
        at org.elasticsearch.xpack.monitoring.exporter.local.LocalBulk.lambda$doFlush$0(LocalBulk.java:123) ~[?:?]
        at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:60) ~[elasticsearch-6.2.1.jar:6.2.1]
(a lot more of lines like this)

```

The error started at 21:00, local time, which corresponds to 00:00 UTC, when the new index are created and this error was getting repeated and only stopped after I restarted the elastic service on the nodes.

What should I do to avoid getting this problem again?

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [February 21, 2018, 7:48pm UTC](https://discuss.elastic.co/t/unexpected-error-while-indexing-monitoring-document-org-elasticsearch-xpack-monitoring/120750/2 "2018-02-21T19:48:46Z")

</div>

I think that I found the problem, it seems that I mistakenly had leave the `cluster.routing.allocation.enable` set to `none` instead of `all`, when I restarted the nodes I set it to `all`.

---

<div class="post-metadata">

### Author: ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)
#### Post date: [February 22, 2018, 9:30pm UTC](https://discuss.elastic.co/t/unexpected-error-while-indexing-monitoring-document-org-elasticsearch-xpack-monitoring/120750/3 "2018-02-22T21:30:51Z")

</div>

Thanks for posting your solution!

---

<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 22, 2018, 9:36pm UTC](https://discuss.elastic.co/t/unexpected-error-while-indexing-monitoring-document-org-elasticsearch-xpack-monitoring/120750/4 "2018-03-22T21:36:14Z")

</div>

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