# Unable to find any unassigned shards to explain

**URL:** <https://discuss.elastic.co/t/unable-to-find-any-unassigned-shards-to-explain/256733>\
**Category:** Elasticsearch\
**Created:** [November 26, 2020, 7:54am UTC](https://discuss.elastic.co/t/unable-to-find-any-unassigned-shards-to-explain/256733 "2020-11-26T07:54:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![devdatta\_mulgund](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/devdatta_mulgund/32/79287_2.png) [@devdatta\_mulgund](https://discuss.elastic.co/u/devdatta_mulgund)\
**Post date:** [November 26, 2020, 7:54am UTC](https://discuss.elastic.co/t/unable-to-find-any-unassigned-shards-to-explain/256733/1 "2020-11-26T07:54:16Z")

</div>

I am facing this error in Elasticsearch. Can someone help with this?

Below is the output for Elasticsearch APIs:  
curl localhost:9200/\_cluster/health

```
output:

{"cluster_name":"docker-cluster","status":"green","timed_out":false,"number_of_nodes":1,"number_of_data_nodes":1,"active_primary_shards":30,"active_shards":30,"relocating_shards":0,"initializing_shards":0,"unassigned_shards":0,"delayed_unassigned_shards":0,"number_of_pending_tasks":0,"number_of_in_flight_fetch":0,"task_max_waiting_in_queue_millis":0,"active_shards_percent_as_number":100.0}

curl localhost:9200/_cat/shards?v

output:

index shard prirep state docs store ip node
.watcher-history-11-2020.11.22 0 p STARTED 172.29.0.2 03d0b7363967
.monitoring-es-7-2020.11.15 0 p STARTED 68 463.2kb 172.29.0.2 03d0b7363967
.watcher-history-11-2020.11.25 0 p STARTED 172.29.0.2 03d0b7363967
testelastic 0 p STARTED 0 208b 172.29.0.2 03d0b7363967
.watcher-history-11-2020.11.21 0 p STARTED 172.29.0.2 03d0b7363967
.monitoring-es-7-2020.11.25 0 p STARTED 127277 62.5mb 172.29.0.2 03d0b7363967
.monitoring-logstash-7-2020.11.21 0 p STARTED 475746 71.1mb 172.29.0.2 03d0b7363967
.watcher-history-11-2020.11.23 0 p STARTED 172.29.0.2 03d0b7363967
.monitoring-es-7-2020.11.24 0 p STARTED 114223 64.3mb 172.29.0.2 03d0b7363967
.monitoring-es-7-2020.11.22 0 p STARTED 17956 10mb 172.29.0.2 03d0b7363967
.watcher-history-11-2020.11.24 0 p STARTED 172.29.0.2 03d0b7363967
.monitoring-alerts-7 0 p STARTED 98 83.1kb 172.29.0.2 03d0b7363967
.monitoring-es-7-2020.11.17 0 p STARTED 18052 8.6mb 172.29.0.2 03d0b7363967
.watches 0 p STARTED 6 3.4mb 172.29.0.2 03d0b7363967
.watcher-history-11-2020.11.19 0 p STARTED 172.29.0.2 03d0b7363967
logstash-2020.11.17-000001 0 p STARTED 0 208b 172.29.0.2 03d0b7363967
.monitoring-logstash-7-2020.11.20 0 p STARTED 185437 28.3mb 172.29.0.2 03d0b7363967
.watcher-history-11-2020.11.17 0 p STARTED 172.29.0.2 03d0b7363967
.monitoring-es-7-2020.11.26 0 p STARTED 21229 12.5mb 172.29.0.2 03d0b7363967
.watcher-history-11-2020.11.26 0 p STARTED 172.29.0.2 03d0b7363967
.watcher-history-11-2020.11.20 0 p STARTED 172.29.0.2 03d0b7363967
ilm-history-2-000001 0 p STARTED 172.29.0.2 03d0b7363967
.monitoring-es-7-2020.11.19 0 p STARTED 56117 20.3mb 172.29.0.2 03d0b7363967
.triggered_watches 0 p STARTED 22 781kb 172.29.0.2 03d0b7363967
.monitoring-es-7-2020.11.21 0 p STARTED 48756 23.8mb 172.29.0.2 03d0b7363967
.monitoring-es-7-2020.11.20 0 p STARTED 45360 20.9mb 172.29.0.2 03d0b7363967
.monitoring-es-7-2020.11.18 0 p STARTED 63266 24.7mb 172.29.0.2 03d0b7363967
.monitoring-logstash-7-2020.11.22 0 p STARTED 65242 8.6mb 172.29.0.2 03d0b7363967
.monitoring-es-7-2020.11.23 0 p STARTED 99448 48.3mb 172.29.0.2 03d0b7363967
.monitoring-logstash-7-2020.11.17 0 p STARTED 161 106.6kb 172.29.0.2 03d0b7363967

curl localhost:9200/_cluster/allocation/explain?pretty

output:

{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "unable to find any unassigned shards to explain [ClusterAllocationExplainRequest[useAnyUnassignedShard=true,includeYesDecisions?=false]"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "unable to find any unassigned shards to explain [ClusterAllocationExplainRequest[useAnyUnassignedShard=true,includeYesDecisions?=false]"
  },
  "status" : 400
}
```

---

<div class="post-metadata">

**Author:** ![Wolfram\_Haussig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfram_haussig/32/70528_2.png) [@Wolfram\_Haussig](https://discuss.elastic.co/u/Wolfram_Haussig)\
**Post date:** [November 26, 2020, 8:01am UTC](https://discuss.elastic.co/t/unable-to-find-any-unassigned-shards-to-explain/256733/2 "2020-11-26T08:01:34Z")

</div>

Hi,

According to the docs:

> You can also have Elasticsearch explain the allocation of the first unassigned shard that it finds by sending an empty body for the request.

So, if you send an empty request body it tries to find an unallocated shard and fails. If you want to show allocation details for a specific shard you have to provide a body like this:

```auto
GET _cluster/allocation/explain?pretty
{
  "index": "heartbeat-7.6.0-2020.06.19-000005",
  "shard": 0,
  "primary": true
}

```

Best regards  
Wolfram

---

<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:** [December 24, 2020, 8:01am UTC](https://discuss.elastic.co/t/unable-to-find-any-unassigned-shards-to-explain/256733/3 "2020-12-24T08:01:48Z")

</div>

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