# Admin cluster health api - bug or am I doing something wrong?

**URL:** <https://discuss.elastic.co/t/admin-cluster-health-api-bug-or-am-i-doing-something-wrong/4101>\
**Category:** Elasticsearch\
**Created:** [March 15, 2011, 6:18pm UTC](https://discuss.elastic.co/t/admin-cluster-health-api-bug-or-am-i-doing-something-wrong/4101 "2011-03-15T18:18:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mooky](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@mooky](https://discuss.elastic.co/u/mooky)\
**Post date:** [March 15, 2011, 6:18pm UTC](https://discuss.elastic.co/t/admin-cluster-health-api-bug-or-am-i-doing-something-wrong/4101/1 "2011-03-15T18:18:09Z")

</div>

v0.15.2

Im doing the following to query the health of a particular index:

client.admin()  
.cluster()  
.health(  
clusterHealthRequest()  
.indices(new String[]{"complete-bollox"})  
.waitForGreenStatus()  
.timeout(timeValueMillis(10000))  
)  
.actionGet()

I always get GREEN status for an index that definitely does not exist.

-Nick

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 15, 2011, 7:26pm UTC](https://discuss.elastic.co/t/admin-cluster-health-api-bug-or-am-i-doing-something-wrong/4101/2 "2011-03-15T19:26:19Z")

</div>

If you check the timed out flag, then you will see its true. But, it should be RED as well, I opened an issue: [Cluster Health API: Asking for health on an index that does not exists should return RED status · Issue #781 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/781).  
On Tuesday, March 15, 2011 at 8:18 PM, Mooky wrote:

> v0.15.2
> 
> Im doing the following to query the health of a particular index:
> 
> client.admin()  
> .cluster()  
> .health(  
> clusterHealthRequest()  
> .indices(new String{"complete-bollox"})  
> .waitForGreenStatus()  
> .timeout(timeValueMillis(10000))  
> )  
> .actionGet()
> 
> I always get GREEN status for an index that definitely does not exist.
> 
> -Nick

---

<div class="post-metadata">

**Author:** ![mooky](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@mooky](https://discuss.elastic.co/u/mooky)\
**Post date:** [March 15, 2011, 11:39pm UTC](https://discuss.elastic.co/t/admin-cluster-health-api-bug-or-am-i-doing-something-wrong/4101/3 "2011-03-15T23:39:13Z")

</div>

Im pretty sure it wasnt timing out. Will have to check again - maybe  
as I was fiddling around I left the timeout very low.

Will update the issue accordingly.

Thanks,  
-Nick

On 15 March 2011 19:26, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:

> If you check the timed out flag, then you will see its true. But, it should  
> be RED as well, I opened an  
> issue: [Cluster Health API: Asking for health on an index that does not exists should return RED status · Issue #781 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/781).
> 
> On Tuesday, March 15, 2011 at 8:18 PM, Mooky wrote:
> 
> v0.15.2
> 
> Im doing the following to query the health of a particular index:
> 
> client.admin()  
> .cluster()  
> .health(  
> clusterHealthRequest()  
> .indices(new String{"complete-bollox"})  
> .waitForGreenStatus()  
> .timeout(timeValueMillis(10000))  
> )  
> .actionGet()
> 
> I always get GREEN status for an index that definitely does not exist.
> 
> -Nick

---

<div class="post-metadata">

**Author:** ![mooky](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@mooky](https://discuss.elastic.co/u/mooky)\
**Post date:** [March 15, 2011, 11:40pm UTC](https://discuss.elastic.co/t/admin-cluster-health-api-bug-or-am-i-doing-something-wrong/4101/4 "2011-03-15T23:40:47Z")

</div>

Oh, and being picky 😉 can we make the indices method a var-args?

clusterHealthRequest()  
.indices(new String{"complete-bollox"})

-Nick

On 15 March 2011 23:39, Nick Minutello [nick.minutello@gmail.com](mailto:nick.minutello@gmail.com) wrote:

> Im pretty sure it wasnt timing out. Will have to check again - maybe  
> as I was fiddling around I left the timeout very low.
> 
> Will update the issue accordingly.
> 
> Thanks,  
> -Nick
> 
> On 15 March 2011 19:26, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> 
> > If you check the timed out flag, then you will see its true. But, it should  
> > be RED as well, I opened an  
> > issue: [Cluster Health API: Asking for health on an index that does not exists should return RED status · Issue #781 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/781).
> > 
> > On Tuesday, March 15, 2011 at 8:18 PM, Mooky wrote:
> > 
> > v0.15.2
> > 
> > Im doing the following to query the health of a particular index:
> > 
> > client.admin()  
> > .cluster()  
> > .health(  
> > clusterHealthRequest()  
> > .indices(new String{"complete-bollox"})  
> > .waitForGreenStatus()  
> > .timeout(timeValueMillis(10000))  
> > )  
> > .actionGet()
> > 
> > I always get GREEN status for an index that definitely does not exist.
> > 
> > -Nick

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 15, 2011, 11:43pm UTC](https://discuss.elastic.co/t/admin-cluster-health-api-bug-or-am-i-doing-something-wrong/4101/5 "2011-03-15T23:43:05Z")

</div>

Its is "var agr'ed" in the constructor for the ClusterHealthRequest class, and in the prepareHealth(String... indices) API.  
On Wednesday, March 16, 2011 at 1:40 AM, Nick Minutello wrote:

> Oh, and being picky 😉 can we make the indices method a var-args?
> 
> clusterHealthRequest()  
> .indices(new String{"complete-bollox"})
> 
> -Nick
> 
> On 15 March 2011 23:39, Nick Minutello [nick.minutello@gmail.com](mailto:nick.minutello@gmail.com) wrote:
> 
> > Im pretty sure it wasnt timing out. Will have to check again - maybe  
> > as I was fiddling around I left the timeout very low.
> > 
> > Will update the issue accordingly.
> > 
> > Thanks,  
> > -Nick
> > 
> > On 15 March 2011 19:26, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> > 
> > > If you check the timed out flag, then you will see its true. But, it should  
> > > be RED as well, I opened an  
> > > issue: [Cluster Health API: Asking for health on an index that does not exists should return RED status · Issue #781 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/781).
> > > 
> > > On Tuesday, March 15, 2011 at 8:18 PM, Mooky wrote:
> > > 
> > > v0.15.2
> > > 
> > > Im doing the following to query the health of a particular index:
> > > 
> > > client.admin()  
> > > .cluster()  
> > > .health(  
> > > clusterHealthRequest()  
> > > .indices(new String{"complete-bollox"})  
> > > .waitForGreenStatus()  
> > > .timeout(timeValueMillis(10000))  
> > > )  
> > > .actionGet()
> > > 
> > > I always get GREEN status for an index that definitely does not exist.
> > > 
> > > -Nick

---

<div class="post-metadata">

**Author:** ![mooky](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@mooky](https://discuss.elastic.co/u/mooky)\
**Post date:** [March 16, 2011, 12:02am UTC](https://discuss.elastic.co/t/admin-cluster-health-api-bug-or-am-i-doing-something-wrong/4101/6 "2011-03-16T00:02:22Z")

</div>

Roger. Will use that instead. Chairs 🙂

On 15 March 2011 23:43, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:

> Its is "var agr'ed" in the constructor for the ClusterHealthRequest class,  
> and in the prepareHealth(String... indices) API.
> 
> On Wednesday, March 16, 2011 at 1:40 AM, Nick Minutello wrote:
> 
> Oh, and being picky 😉 can we make the indices method a var-args?
> 
> clusterHealthRequest()  
> .indices(new String{"complete-bollox"})
> 
> -Nick
> 
> On 15 March 2011 23:39, Nick Minutello [nick.minutello@gmail.com](mailto:nick.minutello@gmail.com) wrote:
> 
> Im pretty sure it wasnt timing out. Will have to check again - maybe  
> as I was fiddling around I left the timeout very low.
> 
> Will update the issue accordingly.
> 
> Thanks,  
> -Nick
> 
> On 15 March 2011 19:26, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> 
> If you check the timed out flag, then you will see its true. But, it should  
> be RED as well, I opened an  
> issue: [Cluster Health API: Asking for health on an index that does not exists should return RED status · Issue #781 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/781).
> 
> On Tuesday, March 15, 2011 at 8:18 PM, Mooky wrote:
> 
> v0.15.2
> 
> Im doing the following to query the health of a particular index:
> 
> client.admin()  
> .cluster()  
> .health(  
> clusterHealthRequest()  
> .indices(new String{"complete-bollox"})  
> .waitForGreenStatus()  
> .timeout(timeValueMillis(10000))  
> )  
> .actionGet()
> 
> I always get GREEN status for an index that definitely does not exist.
> 
> -Nick

---

<div class="post-metadata">

**Author:** ![zohar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zohar/32/3245_2.png) [@zohar](https://discuss.elastic.co/u/zohar)\
**Post date:** [March 17, 2011, 3:08pm UTC](https://discuss.elastic.co/t/admin-cluster-health-api-bug-or-am-i-doing-something-wrong/4101/7 "2011-03-17T15:08:16Z")

</div>

Confirmed it does time out - just status is wrong.  
-Nick

---

<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 6, 2017, 4:09am UTC](https://discuss.elastic.co/t/admin-cluster-health-api-bug-or-am-i-doing-something-wrong/4101/8 "2017-07-06T04:09:47Z")

</div>


