# Index in red, UNASSIGNED PRIMARY\_FAILED

**URL:** <https://discuss.elastic.co/t/index-in-red-unassigned-primary-failed/89520>\
**Category:** Elasticsearch\
**Created:** [June 15, 2017, 7:53am UTC](https://discuss.elastic.co/t/index-in-red-unassigned-primary-failed/89520 "2017-06-15T07:53:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zeeshan\_Alam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zeeshan_alam/32/94298_2.png) [@Zeeshan\_Alam](https://discuss.elastic.co/u/Zeeshan_Alam)\
**Post date:** [June 15, 2017, 7:53am UTC](https://discuss.elastic.co/t/index-in-red-unassigned-primary-failed/89520/1 "2017-06-15T07:53:37Z")

</div>

I am using elasticsearch 5.4.0. One of my index is in red state and I have no idea how to fix it.

`_cat/shards/logstash-ngccapplogs-2017.06.08-1?v&h=index,shard,prirep,state,unassigned.reason`

```
index shard prirep state unassigned.reason
logstash-ngccapplogs-2017.06.08-1 8 p STARTED    
logstash-ngccapplogs-2017.06.08-1 8 r STARTED    
logstash-ngccapplogs-2017.06.08-1 6 p STARTED    
logstash-ngccapplogs-2017.06.08-1 6 r STARTED    
logstash-ngccapplogs-2017.06.08-1 1 p STARTED    
logstash-ngccapplogs-2017.06.08-1 1 r STARTED    
logstash-ngccapplogs-2017.06.08-1 9 p STARTED    
logstash-ngccapplogs-2017.06.08-1 9 r STARTED    
logstash-ngccapplogs-2017.06.08-1 10 r STARTED    
logstash-ngccapplogs-2017.06.08-1 10 p STARTED    
logstash-ngccapplogs-2017.06.08-1 7 p STARTED    
logstash-ngccapplogs-2017.06.08-1 7 r STARTED    
logstash-ngccapplogs-2017.06.08-1 11 p STARTED    
logstash-ngccapplogs-2017.06.08-1 11 r STARTED    
logstash-ngccapplogs-2017.06.08-1 3 p UNASSIGNED ALLOCATION_FAILED
logstash-ngccapplogs-2017.06.08-1 3 r UNASSIGNED PRIMARY_FAILED
logstash-ngccapplogs-2017.06.08-1 4 p STARTED    
logstash-ngccapplogs-2017.06.08-1 4 r STARTED    
logstash-ngccapplogs-2017.06.08-1 2 p STARTED    
logstash-ngccapplogs-2017.06.08-1 2 r STARTED    
logstash-ngccapplogs-2017.06.08-1 5 p STARTED    
logstash-ngccapplogs-2017.06.08-1 5 r STARTED    
logstash-ngccapplogs-2017.06.08-1 0 p STARTED    
logstash-ngccapplogs-2017.06.08-1 0 r STARTED
```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 18, 2017, 7:39am UTC](https://discuss.elastic.co/t/index-in-red-unassigned-primary-failed/89520/2 "2017-06-18T07:39:38Z")

</div>

Check your logs, it should mention something.  
Otherwise use the allocation API to see why it's not allocating.

Also unless you have massive indices, 600GB+, then having 12 shards is a little excessive.

---

<div class="post-metadata">

**Author:** ![Zeeshan\_Alam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zeeshan_alam/32/94298_2.png) [@Zeeshan\_Alam](https://discuss.elastic.co/u/Zeeshan_Alam)\
**Post date:** [June 19, 2017, 11:25am UTC](https://discuss.elastic.co/t/index-in-red-unassigned-primary-failed/89520/3 "2017-06-19T11:25:32Z")

</div>

Thanks for the reply Mark. My daily index is of size 1 to 1.4 TB and I am having 25 data notes 2TB each, so I used 12 shards per index. I used the cluster allocation explain API and found that:

```
GET /_cluster/allocation/explain
{
  "index": "logstash-ngccapplogs-2017.06.08-1",
  "shard": 3,
  "primary": true
}

"index": "logstash-ngccapplogs-2017.06.08-1",
  "shard": 3,
  "primary": true,
  "current_state": "unassigned",
  "unassigned_info": {
    "reason": "ALLOCATION_FAILED",
    "at": "2017-06-10T19:13:32.164Z",
    "failed_allocation_attempts": 5,
    "details": "failed to create shard, failure IOException[No space left on device]",
    "last_allocation_status": "no"
  }

```

That time disk got full and shard didn't got created. I suppose I can't recover from 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:** [July 17, 2017, 11:38am UTC](https://discuss.elastic.co/t/index-in-red-unassigned-primary-failed/89520/4 "2017-07-17T11:38:06Z")

</div>

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