# ElasticsearchClient.healthReport() give cluster status as yellow even though cluster is green

**URL:** <https://discuss.elastic.co/t/elasticsearchclient-healthreport-give-cluster-status-as-yellow-even-though-cluster-is-green/370695>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [November 18, 2024, 1:56pm UTC](https://discuss.elastic.co/t/elasticsearchclient-healthreport-give-cluster-status-as-yellow-even-though-cluster-is-green/370695 "2024-11-18T13:56:01Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sibasish.palo](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@sibasish.palo](https://discuss.elastic.co/u/sibasish.palo)\
**Post date:** [November 18, 2024, 1:56pm UTC](https://discuss.elastic.co/t/elasticsearchclient-healthreport-give-cluster-status-as-yellow-even-though-cluster-is-green/370695/1 "2024-11-18T13:56:01Z")

</div>

Hi

Noticing one weird issue where `ElasticsearchClient.healthReport()` gives status as `Yellow` even though the cluster status is `green`

`/_cluster/health`

```auto
{
  "cluster_name": "es_cluster",
  "status": "green",
  "timed_out": false,
  "number_of_nodes": 18,
  "number_of_data_nodes": 6,
  "active_primary_shards": 567,
  "active_shards": 1098,
  "relocating_shards": 0,
  "initializing_shards": 0,
  "unassigned_shards": 0,
  "delayed_unassigned_shards": 0,
  "number_of_pending_tasks": 0,
  "number_of_in_flight_fetch": 0,
  "task_max_waiting_in_queue_millis": 0,
  "active_shards_percent_as_number": 100.0
}

```

code snippet used to get the report

```auto
ApiTypeHelper.DANGEROUS_disableRequiredPropertiesCheck(true);
HealthReportResponse report = client.healthReport();
ApiTypeHelper.DANGEROUS_disableRequiredPropertiesCheck(false);

```

`ElasticsearchClient.healthReport()` call debug response

 ![Screenshot 2024-11-18 at 6.57.00 PM](https://us1.discourse-cdn.com/elastic/original/3X/4/7/477b4d1eb833816daac1d0a8790456bf5ebffef0.png)

Please let me know if any other information will help

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [November 18, 2024, 2:06pm UTC](https://discuss.elastic.co/t/elasticsearchclient-healthreport-give-cluster-status-as-yellow-even-though-cluster-is-green/370695/2 "2024-11-18T14:06:59Z")

</div>

Which version of Elasticsearch are you using?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 18, 2024, 2:09pm UTC](https://discuss.elastic.co/t/elasticsearchclient-healthreport-give-cluster-status-as-yellow-even-though-cluster-is-green/370695/3 "2024-11-18T14:09:32Z")

</div>

The cluster name does seem to be the same.

Are you sure you are talking to the same cluster?

---

<div class="post-metadata">

**Author:** ![sibasish.palo](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@sibasish.palo](https://discuss.elastic.co/u/sibasish.palo)\
**Post date:** [November 18, 2024, 2:18pm UTC](https://discuss.elastic.co/t/elasticsearchclient-healthreport-give-cluster-status-as-yellow-even-though-cluster-is-green/370695/4 "2024-11-18T14:18:58Z")

</div>

i am using version `8.12.2`

---

<div class="post-metadata">

**Author:** ![sibasish.palo](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@sibasish.palo](https://discuss.elastic.co/u/sibasish.palo)\
**Post date:** [November 18, 2024, 2:19pm UTC](https://discuss.elastic.co/t/elasticsearchclient-healthreport-give-cluster-status-as-yellow-even-though-cluster-is-green/370695/5 "2024-11-18T14:19:50Z")

</div>

yes just modified the name in the question to avoid exposing the name

---

<div class="post-metadata">

**Author:** ![ltrotta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ltrotta/32/124003_2.png) [@ltrotta](https://discuss.elastic.co/u/ltrotta)\
**Post date:** [November 18, 2024, 2:31pm UTC](https://discuss.elastic.co/t/elasticsearchclient-healthreport-give-cluster-status-as-yellow-even-though-cluster-is-green/370695/6 "2024-11-18T14:31:30Z")

</div>

Hello! I see you're disabling the required properties check, likely because otherwise the call won't work. We have recently fixed the client so that `cluster().health()` can now be called without exception, so could you try using a version of the java client \> 8.15.0?

I have tested this myself, the status `green` is returned correctly:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/b/bb0bef48e4485f871984d83635c8343c8849b675.png)

---

<div class="post-metadata">

**Author:** ![sibasish.palo](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@sibasish.palo](https://discuss.elastic.co/u/sibasish.palo)\
**Post date:** [November 19, 2024, 4:42am UTC](https://discuss.elastic.co/t/elasticsearchclient-healthreport-give-cluster-status-as-yellow-even-though-cluster-is-green/370695/7 "2024-11-19T04:42:51Z")

</div>

@ltrotta Thank you for the quick response. the solution works with the current version i am using `8.12.2`. is there any optimisation or bug fixes present in version \>`8.15.0` or i can go ahead with the current version.

---

<div class="post-metadata">

**Author:** ![ltrotta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ltrotta/32/124003_2.png) [@ltrotta](https://discuss.elastic.co/u/ltrotta)\
**Post date:** [November 19, 2024, 10:08am UTC](https://discuss.elastic.co/t/elasticsearchclient-healthreport-give-cluster-status-as-yellow-even-though-cluster-is-green/370695/8 "2024-11-19T10:08:34Z")

</div>

@sibasish.palo there are many bugfixes on the client side, but ideally I recommend using a version of the client closest to the version of the server, so that there's no discrepancy between the API definitions.

---

<div class="post-metadata">

**Author:** ![Keith\_Massey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/keith_massey/32/83666_2.png) [@Keith\_Massey](https://discuss.elastic.co/u/Keith_Massey)\
**Post date:** [November 19, 2024, 2:51pm UTC](https://discuss.elastic.co/t/elasticsearchclient-healthreport-give-cluster-status-as-yellow-even-though-cluster-is-green/370695/9 "2024-11-19T14:51:18Z")

</div>

One other thing that I'm not sure was clear here -- `/cluster/health` and `/_health_report` are two very different things, despite having misleadingly similar names and response colors. `/_cluster/health` only gives information about whether shards are allocated. `/_health_report` checks a lot of things throughout the cluster (including shard allocation). So it would not be unusual for `/_cluster/health` to report green (all shards are allocated) but `/_health_report` to report yellow (for any of a wide variety of reasons)

---

<div class="post-metadata">

**Author:** ![sibasish.palo](https://avatars.discourse-cdn.com/v4/letter/s/ea666f/32.png) [@sibasish.palo](https://discuss.elastic.co/u/sibasish.palo)\
**Post date:** [November 21, 2024, 6:36am UTC](https://discuss.elastic.co/t/elasticsearchclient-healthreport-give-cluster-status-as-yellow-even-though-cluster-is-green/370695/10 "2024-11-21T06:36:44Z")

</div>

Thank you for the details, found the issue why the cluster is showing Yellow status
