Closed
Description
Steps to reproduce (6.2, 6.x and master):
- create an index
curl -XPUT localhost:9200/index
- call cluster health with
wait_for_active_shards
set toall
curl 'localhost:9200/_cluster/health?wait_for_active_shards=all&pretty'
An IllegalStateException
is returned as part of the response, the status code is 500
:
{
"error" : {
"root_cause" : [
{
"type" : "illegal_state_exception",
"reason" : "not enough information to resolve to shard count"
}
],
"type" : "illegal_state_exception",
"reason" : "not enough information to resolve to shard count"
},
"status" : 500
}
The error comes from https://github.com/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/action/support/ActiveShardCount.java#L131 , reading from its javadocs "This method should only be invoked with ActiveShardCount objects created from from(int)
, or NONE
or ONE
". We are calling it though with ALL
.