# Way to list reason shard is unassigned or unallocated?

**URL:** https://discuss.elastic.co/t/way-to-list-reason-shard-is-unassigned-or-unallocated/50368
**Category:** Elasticsearch
**Created:** [May 18, 2016, 7:16pm UTC](https://discuss.elastic.co/t/way-to-list-reason-shard-is-unassigned-or-unallocated/50368 "2016-05-18T19:16:05Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![erikstephens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/erikstephens/32/5430_2.png) [@erikstephens](https://discuss.elastic.co/u/erikstephens)
#### Post date: [May 18, 2016, 7:16pm UTC](https://discuss.elastic.co/t/way-to-list-reason-shard-is-unassigned-or-unallocated/50368/1 "2016-05-18T19:16:05Z")

</div>

I can't find a way to enumerate the reason(s) why a shard can't be assigned or allocated other than attempting a reroute:

```auto
$ curl -X POST https://$HOSTNAME/es/_cluster/reroute?pretty -d '{"commands":[{"allocate":{"index":"logstash-2016.01","shard":0,"node":"data-6","allow_primary":1}}]}'
{
  "error" : {
    "root_cause" : [ {
      "type" : "remote_transport_exception",
      "reason" : "[master-8][1.2.3.4:9300][cluster:admin/reroute]"
    } ],
    "type" : "illegal_argument_exception",
    "reason" : "[allocate] allocation of [logstash-2016.01][0] on node {data-6}{oAPyE7RQSfyA8aX8GsfiPw}{1.2.3.6}{1.2.3.6:9300}{temp=hot, master=false} is not allowed, reason: [YES(below primary recovery limit of [4])][YES(allocation disabling is ignored)][YES(shard count under index limit [3] and node limit [-1] of total shards per node)][NO(node does not match index required filters [temp:\"warm\"])][YES(no allocation awareness enabled)][YES(primary shard can be allocated anywhere)][YES(no snapshots are currently running)][YES(allocation disabling is ignored)][YES(shard is primary)][YES(shard is not allocated to same node or host)][YES(enough disk for shard on node, free: [822.4gb])]"
  },
  "status" : 400
}

```

I was hoping to see it via the /\_cat/shards api but it's empty:

```auto
$ curl https://$HOSTNAME/es/_cat/shards/logstash-2016.01?v\&h=index,shard,state,unassigned.reason,unassigned.details
index shard state unassigned.reason unassigned.details
abuse-2016.01 1 UNASSIGNED INDEX_REOPENED
abuse-2016.01 2 UNASSIGNED INDEX_REOPENED
abuse-2016.01 0 UNASSIGNED INDEX_REOPENED

```

Anyone know of an api that will expose the reason as detailed via the reroute response? Thanks!

---

<div class="post-metadata">

### Author: ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)
#### Post date: [May 18, 2016, 7:30pm UTC](https://discuss.elastic.co/t/way-to-list-reason-shard-is-unassigned-or-unallocated/50368/2 "2016-05-18T19:30:03Z")

</div>

It is available in 5.0.0-alpha1:

> <https://github.com/elastic/elasticsearch/pull/17305>

---

<div class="post-metadata">

### Author: ![erikstephens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/erikstephens/32/5430_2.png) [@erikstephens](https://discuss.elastic.co/u/erikstephens)
#### Post date: [May 18, 2016, 7:33pm UTC](https://discuss.elastic.co/t/way-to-list-reason-shard-is-unassigned-or-unallocated/50368/3 "2016-05-18T19:33:30Z")

</div>

It just occurred to me that the reason is a function of a particular node which explains why /\_cat/shards won't know. Thanks for the link. That feature will be much appreciated.

---

<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, 10:50pm UTC](https://discuss.elastic.co/t/way-to-list-reason-shard-is-unassigned-or-unallocated/50368/4 "2017-07-05T22:50:33Z")

</div>


