# New Unassigned shards getting created

**URL:** <https://discuss.elastic.co/t/new-unassigned-shards-getting-created/246392>\
**Category:** APM\
**Created:** [August 26, 2020, 6:15am UTC](https://discuss.elastic.co/t/new-unassigned-shards-getting-created/246392 "2020-08-26T06:15:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![manohar\_deepu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manohar_deepu/32/72797_2.png) [@manohar\_deepu](https://discuss.elastic.co/u/manohar_deepu)\
**Post date:** [August 26, 2020, 6:15am UTC](https://discuss.elastic.co/t/new-unassigned-shards-getting-created/246392/1 "2020-08-26T06:15:14Z")

</div>

Hi,

I have 1 data node, 2 masters/1 cordinators/2 ingestor/2 apm server/1 kibana machine in my production setup.

On start of the cluster and after ingestion of apm data, my cluster health is yellow because I am seeing unassigned shards.

I ran  
/\_cat/shards on cordinator

Got this  
apm-7.6.2-span-2020.08.26 0 p STARTED 12 18.9kb \<data\_node\_1\>  
apm-7.6.2-span-2020.08.26 0 r UNASSIGNED  
apm-7.6.2-span-2020.08.26 0 r UNASSIGNED  
.kibana\_1 0 p STARTED 29 109.7kb \<data\_node\_1\>  
.monitoring-beats-7-2020.08.26 0 p STARTED 9664 6.5mb \<data\_node\_1\>  
apm-7.6.2-metric-2020.08.26 0 p STARTED 369 303.4kb \<data\_node\_1\>  
apm-7.6.2-metric-2020.08.26 0 r UNASSIGNED  
apm-7.6.2-metric-2020.08.26 0 r UNASSIGNED  
.monitoring-kibana-7-2020.08.26 0 p STARTED 2163 515.1kb \<data\_node\_1\>  
.monitoring-beats-7-2020.08.25 0 p STARTED 2185 1.6mb \<data\_node\_1\>  
.monitoring-es-7-2020.08.26 0 p STARTED 55635 36.9mb \<data\_node\_1\>  
apm-7.6.2-error-2020.08.26 0 p STARTED 7 27.2kb \<data\_node\_1\>  
apm-7.6.2-error-2020.08.26 0 r UNASSIGNED  
apm-7.6.2-error-2020.08.26 0 r UNASSIGNED  
.kibana\_task\_manager\_1 0 p STARTED 2 29.5kb \<data\_node\_1\>  
.monitoring-es-7-2020.08.25 0 p STARTED 71850 43.3mb \<data\_node\_1\>  
apm-7.6.2-transaction-2020.08.26 0 p STARTED 4 26.9kb \<data\_node\_1\>  
apm-7.6.2-transaction-2020.08.26 0 r UNASSIGNED  
apm-7.6.2-transaction-2020.08.26 0 r UNASSIGNED  
.monitoring-kibana-7-2020.08.25 0 p STARTED 3080 719.1kb \<data\_node\_1\>  
.apm-agent-configuration 0 p STARTED 2 16.2kb \<data\_node\_1\>

ran /\_cluster/allocation/explain

{"index":"apm-7.6.2-error-2020.08.26","shard":0,"primary":false,"current\_state":"unassigned","unassigned\_info":{"reason":"INDEX\_CREATED","at":"2020-08-26T05:08:19.439Z","last\_allocation\_status":"no\_attempt"},"can\_allocate":"no","allocate\_explanation":"cannot allocate because allocation is not permitted to any of the nodes","node\_allocation\_decisions":[{"node\_id":"-\_Cvr4vhRGCrUuUyTtDhcQ","node\_name":"data-node-1","transport\_address":":9300","node\_attributes":{"xpack.installed":"true"},"node\_decision":"no","weight\_ranking":1,"deciders":[{"decider":"same\_shard","decision":"NO","explanation":"the shard cannot be allocated to the same node on which a copy of the shard already exists [[apm-7.6.2-error-2020.08.26][0], node[-\_Cvr4vhRGCrUuUyTtDhcQ], [P], s[STARTED], a[id=PjyRtvelTp-bJQDu-cfd6g]]"}]}]}

As a fix I tried this  
curl -XPOST '/\_cluster/reroute?pretty' -H 'Content-Type: application/json' -d'  
{  
"commands" : [  
{  
"allocate\_stale\_primary" : {  
"index" : "apm-7.6.2-transaction-2020.08.26", "shard" : 1,  
"node" : "data-node-1",  
"accept\_data\_loss" : true  
}  
}  
]  
}  
'

But got error -

{  
"error" : {  
"root\_cause" : [  
{  
"type" : "illegal\_argument\_exception",  
"reason" : "No data for shard [1] of index [apm-7.6.2-transaction-2020.08.26] found on any node"  
}  
],  
"type" : "illegal\_argument\_exception",  
"reason" : "No data for shard [1] of index [apm-7.6.2-transaction-2020.08.26] found on any node"  
},  
"status" : 400  
}

Any idea how to fix unassigned shards.

---

<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:** [September 16, 2020, 2:15am UTC](https://discuss.elastic.co/t/new-unassigned-shards-getting-created/246392/2 "2020-09-16T02:15:16Z")

</div>

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