# \[v1.5.1\] Replica shard stuck initializing and can't read stats for primary shard

**URL:** <https://discuss.elastic.co/t/v1-5-1-replica-shard-stuck-initializing-and-cant-read-stats-for-primary-shard/29456>\
**Category:** Elasticsearch\
**Created:** [September 17, 2015, 7:23am UTC](https://discuss.elastic.co/t/v1-5-1-replica-shard-stuck-initializing-and-cant-read-stats-for-primary-shard/29456 "2015-09-17T07:23:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick\_Pentreath](https://avatars.discourse-cdn.com/v4/letter/n/7ea924/32.png) [@Nick\_Pentreath](https://discuss.elastic.co/u/Nick_Pentreath)\
**Post date:** [September 17, 2015, 7:23am UTC](https://discuss.elastic.co/t/v1-5-1-replica-shard-stuck-initializing-and-cant-read-stats-for-primary-shard/29456/1 "2015-09-17T07:23:46Z")

</div>

Hi,

[Using Elasticsearch 1.5.1]

I currently have an issue where one of 5 primary shards in an index is stuck in `INITIALIZING` state (for well over 24 hrs now). The primary shard is marked as `STARTED` but I cannot retrieve stats for that shard.

Output of `cat health`:

```
epoch timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks
1442473639 07:07:19 BBB yellow 3 3 63 30 0 2 0 0

```

Output of `cat shards`:

```
index shard prirep state docs store ip node
AAA_1 1 p STARTED _____________ es-live-1
AAA_1 1 r INITIALIZING _____________ es-live-3
AAA_1 1 r INITIALIZING _____________ es-live-2

```

Output of another index which is fine - where I can see the shard stats

```
index shard prirep state docs store ip node
graphflow_1 4 p STARTED 5071499 1.9gb _____________ es-live-1
graphflow_1 4 r STARTED 5071499 1.9gb _____________ es-live-2
graphflow_1 0 p STARTED 4620643 1.6gb _____________ es-live-1
graphflow_1 0 r STARTED 4620643 1.6gb _____________ es-live-2
... 

```

I also get this:

```
[2015-09-17 07:17:53,082][DEBUG][action.admin.cluster.stats] [es-live-1] failed to execute on node [-gLPPrH_R4i5RFKYoeXO3w]
org.elasticsearch.index.engine.EngineClosedException: [AAA_1][1] CurrentState[CLOSED]

```

Originally I was getting a lot of timeouts and some GC errors on the node that held the PRIMARY of the relevant shard. The node was unresponsive and I had to restart it. Since then the cluster has been yellow with this issue.

Search & aggregations _seem_ to be working. But when I try to run a scan-scroll (using elasticsearch-hadoop for bulk analytics jobs), I get

```
SearchPhaseExecutionException[Failed to execute phase [init_scan], all shards failed]

```

Any help appreciated.

---

<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:** [September 19, 2015, 1:12am UTC](https://discuss.elastic.co/t/v1-5-1-replica-shard-stuck-initializing-and-cant-read-stats-for-primary-shard/29456/2 "2015-09-19T01:12:50Z")

</div>

Try dropping the replica and then adding it back.

---

<div class="post-metadata">

**Author:** ![Nick\_Pentreath](https://avatars.discourse-cdn.com/v4/letter/n/7ea924/32.png) [@Nick\_Pentreath](https://discuss.elastic.co/u/Nick_Pentreath)\
**Post date:** [September 20, 2015, 8:01am UTC](https://discuss.elastic.co/t/v1-5-1-replica-shard-stuck-initializing-and-cant-read-stats-for-primary-shard/29456/3 "2015-09-20T08:01:49Z")

</div>

Thanks - that worked. Any idea on the cause for this, and is it something  
fixed in later versions?

---

<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:** [September 20, 2015, 8:32am UTC](https://discuss.elastic.co/t/v1-5-1-replica-shard-stuck-initializing-and-cant-read-stats-for-primary-shard/29456/4 "2015-09-20T08:32:41Z")

</div>

Could have been a few things, turning up logging will give you a better idea of what the cause is if it happens again.

---

<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, 11:49pm UTC](https://discuss.elastic.co/t/v1-5-1-replica-shard-stuck-initializing-and-cant-read-stats-for-primary-shard/29456/5 "2017-07-05T23:49:15Z")

</div>


