# RetryOnPrimaryException in ES node

**URL:** <https://discuss.elastic.co/t/retryonprimaryexception-in-es-node/62809>\
**Category:** Elasticsearch\
**Created:** [October 12, 2016, 1:29pm UTC](https://discuss.elastic.co/t/retryonprimaryexception-in-es-node/62809 "2016-10-12T13:29:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dipathak](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@dipathak](https://discuss.elastic.co/u/dipathak)\
**Post date:** [October 12, 2016, 1:29pm UTC](https://discuss.elastic.co/t/retryonprimaryexception-in-es-node/62809/1 "2016-10-12T13:29:33Z")

</div>

Hi, we are using ES 2.0 on a 16 node cluster. There are 2 indexes. One index has 5 shards with RF 2. This is giving RetryOnPrimaryException while trying to index a document. This error is happening on only one of the nodes and writes are getting timed out (timeout value = 1min). ES process is not crashing on the nodes though.  
We create index only once and never delete it. The other index is not having any issues.  
Cluster health is green and all the shards are in STARTED state. What does this error mean? Shall I increase timeout value?  
Please let me know what information can I look into or provide here to debug this.

Thanks.

[2016-10-12 04:22:07,867][INFO][rest.suppressed] objindex/obj/BFJlY1U Params: {index=objindex, id=BFJlY1U, type=obj, timeout=60s}  
[objindex][[objindex][4]] RetryOnPrimaryException[Dynamics mappings are not available on the node that holds the primary yet]  
at org.elasticsearch.action.support.replication.TransportReplicationAction.executeIndexRequestOnPrimary(TransportReplicationAction.java:1069)  
at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:170)  
at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryPhase.performOnPrimary(TransportReplicationAction.java:579)  
at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryPhase$1.doRun(TransportReplicationAction.java:452)  
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)  
at java.lang.Thread.run(Thread.java:745)  
[2016-10-12 04:22:08,331][INFO][rest.suppressed] objindex/obj/BFNOd0M Params: {index=objindex, id=BFNOd0M, type=obj, timeout=60s}  
[objindex][[objindex][4]] RetryOnPrimaryException[Dynamics mappings are not available on the node that holds the primary yet]  
at org.elasticsearch.action.support.replication.TransportReplicationAction.executeIndexRequestOnPrimary(TransportReplicationAction.java:1069)  
at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:170)  
at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryPhase.performOnPrimary(TransportReplicationAction.java:579)  
at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryPhase$1.doRun(TransportReplicationAction.java:452)  
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)  
at java.lang.Thread.run(Thread.java:745)

---

<div class="post-metadata">

**Author:** ![ywelsch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ywelsch/32/7751_2.png) [@ywelsch](https://discuss.elastic.co/u/ywelsch)\
**Post date:** [October 12, 2016, 2:15pm UTC](https://discuss.elastic.co/t/retryonprimaryexception-in-es-node/62809/2 "2016-10-12T14:15:07Z")

</div>

It sounds like there is a problem updating the cluster state on the node holding that shard. Can you share the output of running the following command both on master node and on the node throwing the exception:

```auto
curl -XGET 'http://localhost:9200/_cluster/state?local&pretty'

```

Probably the easiest way to fix this is to just restart the node.

---

<div class="post-metadata">

**Author:** ![dipathak](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@dipathak](https://discuss.elastic.co/u/dipathak)\
**Post date:** [October 12, 2016, 5:54pm UTC](https://discuss.elastic.co/t/retryonprimaryexception-in-es-node/62809/3 "2016-10-12T17:54:04Z")

</div>

Hi Yannick, thanks for the response. The output is around 20k characters and upload allows only image files. Can you please tell me how to provide the output of this command here. Thanks !

---

<div class="post-metadata">

**Author:** ![ywelsch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ywelsch/32/7751_2.png) [@ywelsch](https://discuss.elastic.co/u/ywelsch)\
**Post date:** [October 12, 2016, 8:33pm UTC](https://discuss.elastic.co/t/retryonprimaryexception-in-es-node/62809/4 "2016-10-12T20:33:42Z")

</div>

Please use [http://pastebin.com](http://pastebin.com) or a similar (free) service. If the cluster state contains private / confidential information, you can also make the paste exposure "unlisted" and send me the link in a private message here.

---

<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:12pm UTC](https://discuss.elastic.co/t/retryonprimaryexception-in-es-node/62809/5 "2017-07-05T22:12:54Z")

</div>


