# Shards stuck in Initializing mode

**URL:** <https://discuss.elastic.co/t/shards-stuck-in-initializing-mode/31856>\
**Category:** Elasticsearch\
**Created:** [October 8, 2015, 2:42pm UTC](https://discuss.elastic.co/t/shards-stuck-in-initializing-mode/31856 "2015-10-08T14:42:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jerome\_David](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jerome_david/32/5182_2.png) [@Jerome\_David](https://discuss.elastic.co/u/Jerome_David)\
**Post date:** [October 8, 2015, 2:42pm UTC](https://discuss.elastic.co/t/shards-stuck-in-initializing-mode/31856/1 "2015-10-08T14:42:20Z")

</div>

We've had a crash and had to restart our server.  
Our cluster has 5 nodes and we use 1 replica.  
Since then, every time we try to open an index, the replica for the shard 3 (always 3!) gets stuck in initializing mode.  
It even gets stuck when we create a new index (with zero document).  
After that, ES tries to move it from one node to the other but it never succeeds.

We managed to fix it in a few cases by doing the following:

1. Close the index
2. ssh to the node holding the replica for shard 3 (the one that is stuck) and remove it from disk.
3. copy the primary for shard 3 from one of the other nodes to the node currently holding the replica for shard 3.

This got us back to a working index, but every time a shard gets relocated, we get the same problem. We also can create any new index without going through all these steps.

We are using ES v1.4.2.

Is this a known problem?  
Would upgrading to 1.7.2 be any help?

---

<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:** [October 8, 2015, 9:50pm UTC](https://discuss.elastic.co/t/shards-stuck-in-initializing-mode/31856/2 "2015-10-08T21:50:39Z")

</div>

Why not just drop the replica and add it back?

You could increase logging to see what is happening, something like;

```auto
PUT /_cluster/settings
{
  "transient": {
    "logger._root": "DEBUG"
  }
}

```

---

<div class="post-metadata">

**Author:** ![Jerome\_David](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jerome_david/32/5182_2.png) [@Jerome\_David](https://discuss.elastic.co/u/Jerome_David)\
**Post date:** [October 11, 2015, 10:16am UTC](https://discuss.elastic.co/t/shards-stuck-in-initializing-mode/31856/3 "2015-10-11T10:16:28Z")

</div>

Yes, we tried setting the number of replicas to zero and then setting it  
back to 1 or 2. But every time, the node 3 of the last replica gets stuck.  
We've set up a new cluster with 1.7.2. So far it seems to behave better,  
but we still need to do more testing.

---

<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:45pm UTC](https://discuss.elastic.co/t/shards-stuck-in-initializing-mode/31856/4 "2017-07-05T23:45:28Z")

</div>


