# Shards are in ALLOCATION\_FAILED or CLUSTER\_RECOVERED

**URL:** https://discuss.elastic.co/t/shards-are-in-allocation-failed-or-cluster-recovered/339100
**Category:** Elasticsearch
**Tags:** elastic-stack-monitoring
**Created:** [July 24, 2023, 12:59pm UTC](https://discuss.elastic.co/t/shards-are-in-allocation-failed-or-cluster-recovered/339100 "2023-07-24T12:59:58Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Sathish22](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@Sathish22](https://discuss.elastic.co/u/Sathish22)
#### Post date: [July 24, 2023, 12:59pm UTC](https://discuss.elastic.co/t/shards-are-in-allocation-failed-or-cluster-recovered/339100/1 "2023-07-24T12:59:59Z")

</div>

Hi All,

we have a 5 master and 41 node cluster, due to some storage hardware issue, Elasticsearch cluster was affected and after resolving hardware issue, some of the shards are showing as ALLOCATION\_FAILED or CLUSTER\_RECOVERED in the cluster settings it is showing as

> CLUSTER\_RECOVERED: "cannot allocate because all found copies of the shard are either stale or corrupt"  
> ALLOCATION\_FAILED: "cannot allocate because allocation is not permitted to any of the nodes that hold an in-sync shard copy"

can anyone please help us what action we need to take to gets this shards to assigned state

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [July 24, 2023, 1:17pm UTC](https://discuss.elastic.co/t/shards-are-in-allocation-failed-or-cluster-recovered/339100/2 "2023-07-24T13:17:24Z")

</div>

It sounds like you will need to restore the affected indices from a recent snapshot in order not to lise any data. How many primary shards are unassigned if you check the \_cat/shards API?

---

<div class="post-metadata">

### Author: ![Sathish22](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@Sathish22](https://discuss.elastic.co/u/Sathish22)
#### Post date: [July 24, 2023, 2:01pm UTC](https://discuss.elastic.co/t/shards-are-in-allocation-failed-or-cluster-recovered/339100/3 "2023-07-24T14:01:22Z")

</div>

Hi Christian,

we don't have any snapshot configured in our system and there is no replicas configured and there are around 20 unassigned shards with either CLUSTER\_RECOVERED/ALLOCATION\_FAILED as unassigned.reason

is there any possibility to get them assigned/recovered ?

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [July 24, 2023, 2:05pm UTC](https://discuss.elastic.co/t/shards-are-in-allocation-failed-or-cluster-recovered/339100/4 "2023-07-24T14:05:30Z")

</div>

You can force allocation of the unassigned shards [as oulined in the docs](https://www.elastic.co/guide/en/elasticsearch/reference/8.6/red-yellow-cluster-status.html) but that is likely to lead to data loss. If you run without replica shards and snapshots you are running the risk of data loss in cases like this.

---

<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: [August 21, 2023, 2:06pm UTC](https://discuss.elastic.co/t/shards-are-in-allocation-failed-or-cluster-recovered/339100/5 "2023-08-21T14:06:14Z")

</div>

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