# Elasticsearch cluster state yellow and have unassigned shards

**URL:** https://discuss.elastic.co/t/elasticsearch-cluster-state-yellow-and-have-unassigned-shards/155174
**Category:** Elasticsearch
**Created:** [November 2, 2018, 1:19pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-state-yellow-and-have-unassigned-shards/155174 "2018-11-02T13:19:53Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![vnallamothu](https://avatars.discourse-cdn.com/v4/letter/v/35a633/32.png) [@vnallamothu](https://discuss.elastic.co/u/vnallamothu)
#### Post date: [November 2, 2018, 1:19pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-state-yellow-and-have-unassigned-shards/155174/1 "2018-11-02T13:19:53Z")

</div>

Hi,

I have installed Elasticsearch 5.5.4, Kibana 5.5.4 on the same node (1 node cluster). My elasticsearch cluster state turned to "yellow" and I'm having 14 unassigned shards. Can you please let me know how to work on them?

Also, I found following in my log file. Can you please let me know what is happening?

```
[2018-10-31T14:03:54,384][DEBUG][o.e.a.s.TransportSearchAction] [es-node01] [bit bucket-search][2], node[Qqi2yfxRQ-S5rwANaNWfwA], [P], s[STARTED], a[id=KsBf54j0Q -icZvKUvHb5KQ]: Failed to execute [SearchRequest{searchType=QUERY_THEN_FETCH, in dices=[bitbucket-search], indicesOptions=IndicesOptions[id=38, ignore_unavailabl e=false, allow_no_indices=true, expand_wildcards_open=true, expand_wildcards_clo sed=false, allow_alisases_to_multiple_indices=true, forbid_closed_indices=true], types=[repository], routing='null', preference='null', requestCache=null, scrol l=null, source={
  "from" : 0,
  "size" : 25,
  "query" : {
    "bool" : {
      "must" : [
        {
          "bool" : {
            "disable_coord" : false,
            "adjust_pure_negative" : true,
            "boost" : 1.0
          }
        }
      ],
      "filter" : [
        {
          "term" : {
            "originId" : {
              "value" : 32,
              "boost" : 1.0
            }
          }
        }
      ],
      "should" : [
        {
          "constant_score" : {
            "filter" : {
              "term" : {
                "projectId" : {
                  "value" : 103,
                  "boost" : 1.0
                }
              }
            },
            "boost" : 10.0
          }
        }
      ],
      "disable_coord" : false,
      "adjust_pure_negative" : true,
      "boost" : 1.0
    }
  },
  "sort" : [
    {
      "_score" : {
        "order" : "desc"
      }
    },
    {
      "quickSearchProjectName.raw" : {
        "order" : "asc"
      }
    },
    {
      "quickSearchRepositoryName.raw" : {
        "order" : "asc"
      }
    }
  ]
}}] lastShard [true]
org.elasticsearch.transport.RemoteTransportException: [es-node01][10.X.X.X:930 0][indices:data/read/search[phase/query]]
Caused by: org.elasticsearch.index.query.QueryShardException: No mapping found f or [quickSearchProjectName.raw] in order to sort on
        at org.elasticsearch.search.sort.FieldSortBuilder.build(FieldSortBuilder .java:262) ~[elasticsearch-5.5.3.jar:5.5.3]
        at org.elasticsearch.search.sort.SortBuilder.buildSort(SortBuilder.java: 156) ~[elasticsearch-5.5.3.jar:5.5.3]
        at org.elasticsearch.search.SearchService.parseSource(SearchService.java :630) ~[elasticsearch-5.5.3.jar:5.5.3]
        at org.elasticsearch.search.SearchService.createContext(SearchService.ja va:481) ~[elasticsearch-5.5.3.jar:5.5.3]
        at org.elasticsearch.search.SearchService.createAndPutContext(SearchServ ice.java:457) ~[elasticsearch-5.5.3.jar:5.5.3]
        at org.elasticsearch.search.SearchService.executeQueryPhase(SearchServic e.java:253) ~[elasticsearch-5.5.3.jar:5.5.3]
        at org.elasticsearch.action.search.SearchTransportService$6.messageRecei ved(SearchTransportService.java:330) ~[elasticsearch-5.5.3.jar:5.5.3]
        at org.elasticsearch.action.search.SearchTransportService$6.messageRecei ved(SearchTransportService.java:327) ~[elasticsearch-5.5.3.jar:5.5.3]
        at org.elasticsearch.transport.RequestHandlerRegistry.processMessageRece ived(RequestHandlerRegistry.java:69) ~[elasticsearch-5.5.3.jar:5.5.3]
        at org.elasticsearch.transport.TransportService$7.doRun(TransportService .java:644) [elasticsearch-5.5.3.jar:5.5.3]
```

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [November 2, 2018, 3:57pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-state-yellow-and-have-unassigned-shards/155174/2 "2018-11-02T15:57:32Z")

</div>

> [@vnallamothu](#):
>
> Can you please let me know how to work on them?

The [allocation explain API](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/cluster-allocation-explain.html) will tell you why unassigned shards are unassigned. Since you have a single node cluster, I think this means that you have some indices with `number_of_replicas` set to a value greater than zero (by default it's 1). The difference between yellow and green doesn't really matter in a single-node cluster, both of them mean that all the primary shards are assigned and that's the best you can do with just one node.

---

<div class="post-metadata">

### Author: ![vnallamothu](https://avatars.discourse-cdn.com/v4/letter/v/35a633/32.png) [@vnallamothu](https://discuss.elastic.co/u/vnallamothu)
#### Post date: [November 2, 2018, 4:27pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-state-yellow-and-have-unassigned-shards/155174/3 "2018-11-02T16:27:05Z")

</div>

Thank you! I have system indices which have unassigned shards as I'm not having another node. I turned number\_of\_replicas to 0 for my actual index. But, can you please explain about the above stacktrace?

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [November 2, 2018, 4:39pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-state-yellow-and-have-unassigned-shards/155174/4 "2018-11-02T16:39:31Z")

</div>

The log seems quite mangled - it has a lot of extra spaces in it for some reason. Still, this line gives a clue:

```auto
Caused by: org.elasticsearch.index.query.QueryShardException: No mapping found for [quickSearchProjectName.raw] in order to sort on

```

Without a mapping for this field, Elasticsearch doesn't know how to sort on it as requested by the quoted query:

```auto
    {
      "quickSearchProjectName.raw" : {
        "order" : "asc"
      }
    },

```

---

<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: [November 30, 2018, 4:53pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-state-yellow-and-have-unassigned-shards/155174/5 "2018-11-30T16:53:49Z")

</div>

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