# IllegalIndexShardStateException: \[\_river\]\[0\] CurrentState\[RECOVERING\] Read operations only allowed when started/relocated

**URL:** <https://discuss.elastic.co/t/illegalindexshardstateexception--river-0-currentstate-recovering-read-operations-only-allowed-when-started-relocated/13396>\
**Category:** Elasticsearch\
**Created:** [August 29, 2013, 4:13pm UTC](https://discuss.elastic.co/t/illegalindexshardstateexception--river-0-currentstate-recovering-read-operations-only-allowed-when-started-relocated/13396 "2013-08-29T16:13:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karol\_Gwaj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/karol_gwaj/32/1324_2.png) [@Karol\_Gwaj](https://discuss.elastic.co/u/Karol_Gwaj)\
**Post date:** [August 29, 2013, 4:13pm UTC](https://discuss.elastic.co/t/illegalindexshardstateexception--river-0-currentstate-recovering-read-operations-only-allowed-when-started-relocated/13396/1 "2013-08-29T16:13:38Z")

</div>

Hi Guys,

im trying to create custom river plugin and im getting this error after  
starting cluster:

Aug 29, 2013 4:55:02 PM river.routing  
WARNING: [Grant, Greer] failed to get/parse \_meta for [cc\_river]  
org.elasticsearch.index.shard.IllegalIndexShardStateException: [\_river][0]  
CurrentState[RECOVERING] Read operations only allowed when started/relocated  
at  
org.elasticsearch.index.shard.service.InternalIndexShard.readAllowed(InternalIndexShard.java:686)  
at  
org.elasticsearch.index.shard.service.InternalIndexShard.get(InternalIndexShard.java:410)  
at  
org.elasticsearch.index.get.ShardGetService.innerGet(ShardGetService.java:194)  
at org.elasticsearch.index.get.ShardGetService.get(ShardGetService.java:105)  
at  
org.elasticsearch.action.get.TransportGetAction.shardOperation(TransportGetAction.java:102)  
at  
org.elasticsearch.action.get.TransportGetAction.shardOperation(TransportGetAction.java:42)  
at  
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction$1.run(TransportShardSingleOperationAction.java:160)  
at  
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
at java.lang.Thread.run(Thread.java:722)

looks like there is some racing condition between index recovering and  
reading river metadata  
(when i slow down my plugin initialization with thread.sleep im not getting  
this error)

any suggestion what i may be doing wrong there ?

my default index settings:  
index.number\_of\_shards: 1  
index.number\_of\_replicas: 0

Thx,

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![benmccann](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benmccann/32/420_2.png) [@benmccann](https://discuss.elastic.co/u/benmccann)\
**Post date:** [September 24, 2013, 3:35am UTC](https://discuss.elastic.co/t/illegalindexshardstateexception--river-0-currentstate-recovering-read-operations-only-allowed-when-started-relocated/13396/2 "2013-09-24T03:35:33Z")

</div>

+1 I've run into this issue as well and it appears a couple others have as  
well as I found an open bug for it:

> <https://github.com/elastic/elasticsearch/issues/3700>
>
> When a river \[1\] has been registered and ES is restarted.
> I keep getting the fol…lowing exception in the log:
> \[2013-09-10 10:22:55,066\]\[INFO \]\[node \] \[Box IV\] version\[0.90.3\], pid\[26144\], build\[5c38d60/2013-08-06T13:18:31Z\]
> \[2013-09-10 10:22:55,067\]\[INFO \]\[node \] \[Box IV\] initializing ...
> \[2013-09-10 10:22:55,115\]\[INFO \]\[plugins \] \[Box IV\] loaded \[mongodb-river, mapper-attachments, lang-groovy, lang-javascript\], sites \[river-mongodb, head\]
> \[2013-09-10 10:22:58,456\]\[INFO \]\[node \] \[Box IV\] initialized
> \[2013-09-10 10:22:58,456\]\[INFO \]\[node \] \[Box IV\] starting ...
> \[2013-09-10 10:22:59,639\]\[INFO \]\[transport \] \[Box IV\] bound\_address {inet\[/0:0:0:0:0:0:0:0:9300\]}, publish\_address {inet\[/192.168.1.117:9300\]}
> \[2013-09-10 10:23:03,145\]\[INFO \]\[cluster.service \] \[Box IV\] new\_master \[Box IV\]\[AllhKDYIScKfW8Ue1YcmQw\]\[inet\[/192.168.1.117:9300\]\], reason: zen-disco-join (elected\_as\_master)
> \[2013-09-10 10:23:03,169\]\[INFO \]\[discovery \] \[Box IV\] elasticsearch/AllhKDYIScKfW8Ue1YcmQw
> \[2013-09-10 10:23:03,216\]\[DEBUG\]\[action.get \] \[Box IV\] \[\_river\]\[0\]: failed to execute \[\[\_river\]\[river101\]\[\_meta\]: routing \[null\]\]
> org.elasticsearch.action.NoShardAvailableActionException: \[\_river\]\[0\] null
> at org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.start(TransportShardSingleOperationAction.java:123)
> at org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:72)
> at org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:47)
> at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:61)
> at org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:92)
> at org.elasticsearch.client.support.AbstractClient.get(AbstractClient.java:179)
> at org.elasticsearch.action.get.GetRequestBuilder.doExecute(GetRequestBuilder.java:112)
> at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:85)
> at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:59)
> at org.elasticsearch.river.routing.RiversRouter$1.execute(RiversRouter.java:109)
> at org.elasticsearch.river.cluster.RiverClusterService$1.run(RiverClusterService.java:103)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> at java.lang.Thread.run(Thread.java:722)
> \[2013-09-10 10:23:03,683\]\[INFO \]\[gateway \] \[Box IV\] recovered \[7\] indices into cluster\_state
> \[2013-09-10 10:23:03,702\]\[DEBUG\]\[action.get \] \[Box IV\] \[\_river\]\[0\]: failed to execute \[\[\_river\]\[river101\]\[\_meta\]: routing \[null\]\]
> org.elasticsearch.action.NoShardAvailableActionException: \[\_river\]\[0\] null
> at org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.start(TransportShardSingleOperationAction.java:123)
> at org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:72)
> at org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:47)
> at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:61)
> at org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:92)
> at org.elasticsearch.client.support.AbstractClient.get(AbstractClient.java:179)
> at org.elasticsearch.action.get.GetRequestBuilder.doExecute(GetRequestBuilder.java:112)
> at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:85)
> at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:59)
> at org.elasticsearch.river.routing.RiversRouter$1.execute(RiversRouter.java:109)
> at org.elasticsearch.river.cluster.RiverClusterService$1.run(RiverClusterService.java:103)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> at java.lang.Thread.run(Thread.java:722)
> \[2013-09-10 10:23:03,849\]\[DEBUG\]\[action.get \] \[Box IV\] \[\_river\]\[0\]: failed to execute \[\[\_river\]\[river101\]\[\_meta\]: routing \[null\]\]
> org.elasticsearch.action.NoShardAvailableActionException: \[\_river\]\[0\] null
> at org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.start(TransportShardSingleOperationAction.java:123)
> at org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:72)
> at org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:47)
> at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:61)
> at org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:92)
> at org.elasticsearch.client.support.AbstractClient.get(AbstractClient.java:179)
> at org.elasticsearch.action.get.GetRequestBuilder.doExecute(GetRequestBuilder.java:112)
> at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:85)
> at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:59)
> at org.elasticsearch.river.routing.RiversRouter$1.execute(RiversRouter.java:109)
> at org.elasticsearch.river.cluster.RiverClusterService$1.run(RiverClusterService.java:103)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> at java.lang.Thread.run(Thread.java:722)
> 
> The same plugin version works without this exception in ES 0.90.2. Even with the exception data are correctly imported in ES by the river.
> 
> \[1\] - https://github.com/richardwilly98/elasticsearch-river-mongodb

On Thursday, August 29, 2013 9:13:38 AM UTC-7, Karol Gwaj wrote:

> Hi Guys,
> 
> im trying to create custom river plugin and im getting this error after  
> starting cluster:
> 
> Aug 29, 2013 4:55:02 PM river.routing  
> WARNING: [Grant, Greer] failed to get/parse \_meta for [cc\_river]  
> org.elasticsearch.index.shard.IllegalIndexShardStateException: [\_river][0]  
> CurrentState[RECOVERING] Read operations only allowed when started/relocated  
> at  
> org.elasticsearch.index.shard.service.InternalIndexShard.readAllowed(InternalIndexShard.java:686)  
> at  
> org.elasticsearch.index.shard.service.InternalIndexShard.get(InternalIndexShard.java:410)  
> at  
> org.elasticsearch.index.get.ShardGetService.innerGet(ShardGetService.java:194)  
> at  
> org.elasticsearch.index.get.ShardGetService.get(ShardGetService.java:105)  
> at  
> org.elasticsearch.action.get.TransportGetAction.shardOperation(TransportGetAction.java:102)  
> at  
> org.elasticsearch.action.get.TransportGetAction.shardOperation(TransportGetAction.java:42)  
> at  
> org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction$1.run(TransportShardSingleOperationAction.java:160)  
> at  
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
> at  
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
> at java.lang.Thread.run(Thread.java:722)
> 
> looks like there is some racing condition between index recovering and  
> reading river metadata  
> (when i slow down my plugin initialization with thread.sleep im not  
> getting this error)
> 
> any suggestion what i may be doing wrong there ?
> 
> my default index settings:  
> index.number\_of\_shards: 1  
> index.number\_of\_replicas: 0
> 
> Thx,

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 2:14am UTC](https://discuss.elastic.co/t/illegalindexshardstateexception--river-0-currentstate-recovering-read-operations-only-allowed-when-started-relocated/13396/3 "2017-07-06T02:14:59Z")

</div>


