# An assigned shards -- max retries exceeded

**URL:** https://discuss.elastic.co/t/an-assigned-shards-max-retries-exceeded/264779
**Category:** Elasticsearch
**Created:** [February 19, 2021, 3:01am UTC](https://discuss.elastic.co/t/an-assigned-shards-max-retries-exceeded/264779 "2021-02-19T03:01:54Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Russell\_Fulton](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/russell_fulton/32/62888_2.png) [@Russell\_Fulton](https://discuss.elastic.co/u/Russell_Fulton)
#### Post date: [February 19, 2021, 3:01am UTC](https://discuss.elastic.co/t/an-assigned-shards-max-retries-exceeded/264779/1 "2021-02-19T03:01:54Z")

</div>

Running on 7.10

I have several indexes which have unassigned replica shards (although) the primaries are OK. For example:

```auto
{
  "index" : "authm-000005",
  "shard" : 1,
  "primary" : false,
  "current_state" : "unassigned",
  "unassigned_info" : {
    "reason" : "ALLOCATION_FAILED",
    "at" : "2021-02-15T09:19:47.045Z",
    "failed_allocation_attempts" : 5,
    "details" : "failed shard on node [6UDagJW2T3eWM-0PQJ0rMA]: failed to create shard, failure IOException[failed to obtain in-memory shard lock]; nested: ShardLockObtainFailedException[[authm-000005][1]: obtaining shard lock for [starting shard] timed out after [5000ms], lock already held for [closing shard] with age [955200ms]]; ",
    "last_allocation_status" : "no_attempt"
  },
  "can_allocate" : "no",
  "allocate_explanation" : "cannot allocate because allocation is not permitted to any of the nodes",

```

All nodes give the same reason for blocking allocation.

```auto
      "deciders" : [
        {
          "decider" : "max_retry",
          "decision" : "NO",
          "explanation" : "shard has exceeded the maximum number of retries [5] on failed allocation attempts - manually call [/_cluster/reroute?retry_failed=true] to retry, [unassigned_info[[reason=ALLOCATION_FAILED], at[2021-02-15T09:19:47.045Z], failed_attempts[5], failed_nodes[[6UDagJW2T3eWM-0PQJ0rMA]], delayed=false, details[failed shard on node [6UDagJW2T3eWM-0PQJ0rMA]: failed to create shard, failure IOException[failed to obtain in-memory shard lock]; nested: ShardLockObtainFailedException[[authm-000005][1]: obtaining shard lock for [starting shard] timed out after [5000ms], lock already held for [closing shard] with age [955200ms]]; ], allocation_status[no_attempt]]]"

```

I understand that some manual intervention is needed to break the deadlock but I can't figure out what I need to do. I have been trying various reroute commands but not getting anywhere.

---

<div class="post-metadata">

### Author: ![Russell\_Fulton](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/russell_fulton/32/62888_2.png) [@Russell\_Fulton](https://discuss.elastic.co/u/Russell_Fulton)
#### Post date: [February 19, 2021, 3:10am UTC](https://discuss.elastic.co/t/an-assigned-shards-max-retries-exceeded/264779/2 "2021-02-19T03:10:40Z")

</div>

Well by the time I had finished typing it I stumbled across the answer. I tried the "allocate\_replica" command of reroute and it helpfully told me I needed to do `_cluster/reroute?retry_failed=true` several hundreds of lines of output to the terminal (thank heavens I did not ask for pretty!) the cluster immediately started allocating shards again and 5 minutes later it turned GREEN

---

<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: [March 19, 2021, 3:11am UTC](https://discuss.elastic.co/t/an-assigned-shards-max-retries-exceeded/264779/3 "2021-03-19T03:11:36Z")

</div>

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