# Error: using Java API calling ElasticsearchClient method healthReport()

**URL:** <https://discuss.elastic.co/t/error-using-java-api-calling-elasticsearchclient-method-healthreport/361478>\
**Category:** Elasticsearch\
**Tags:** docker, language-clients\
**Created:** [June 14, 2024, 9:08am UTC](https://discuss.elastic.co/t/error-using-java-api-calling-elasticsearchclient-method-healthreport/361478 "2024-06-14T09:08:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![p4paul](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/p4paul/32/65034_2.png) [@p4paul](https://discuss.elastic.co/u/p4paul)\
**Post date:** [June 14, 2024, 9:08am UTC](https://discuss.elastic.co/t/error-using-java-api-calling-elasticsearchclient-method-healthreport/361478/1 "2024-06-14T09:08:48Z")

</div>

I'm using `co.elastic.clients:elasticsearch-java:8.13.4` and get a deserilizing error calling the healthReport() method:

```auto
HealthReportResponse health = myEsClient.healthReport();

```

Error:

```auto
co.elastic.clients.json.JsonpMappingException: 
Error deserializing co.elastic.clients.elasticsearch.core.health_report.SlmIndicator:
 co.elastic.clients.util.MissingRequiredPropertyException:
 Missing required property 'SlmIndicatorDetails.unhealthyPolicies' (JSON path: indicators.slm.details) (line no=1, column no=1294, offset=-1)

```

Debugging **ElasticsearchTransportBase** shows the response 'resp':

```auto
requestLine: GET /_health_report HTTP/1.1

```

is OK (`HTTP/1.1 200 OK`) I can also call this over REST and get some JSON, however your deceriliser breaks...

The value of **content** at line `ElasticsearchTransportBase:396`

```auto
{"status":"green","cluster_name":"docker-cluster","indicators":{"master_is_stable":{"status":"green","symptom":"The cluster has a stable master node","details":{"current_master":{"node_id":"uPJ5mfP4RP-UMnMU6C5ugQ","name":"es"},"recent_masters":[{"node_id":"uPJ5mfP4RP-UMnMU6C5ugQ","name":"es"}]}},"repository_integrity":{"status":"green","symptom":"No snapshot repositories configured."},"shards_availability":{"status":"green","symptom":"This cluster has all shards available.","details":{"creating_primaries":0,"unassigned_replicas":0,"restarting_primaries":0,"restarting_replicas":0,"initializing_primaries":0,"started_replicas":0,"initializing_replicas":0,"unassigned_primaries":0,"started_primaries":0}},"disk":{"status":"green","symptom":"The cluster has enough available disk space.","details":{"indices_with_readonly_block":0,"nodes_with_enough_disk_space":1,"nodes_with_unknown_disk_status":0,"nodes_over_high_watermark":0,"nodes_over_flood_stage_watermark":0}},"shards_capacity":{"status":"green","symptom":"The cluster has enough room to add new shards.","details":{"data":{"max_shards_in_cluster":1000},"frozen":{"max_shards_in_cluster":3000}}},"slm":{"status":"green","symptom":"No Snapshot Lifecycle Management policies configured","details":{"slm_status":"RUNNING","policies":0}},"ilm":{"status":"green","symptom":"Index Lifecycle Management is running","details":{"policies":20,"stagnating_indices":0,"ilm_status":"RUNNING"}}}}

```

---

<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:** [June 17, 2024, 7:57am UTC](https://discuss.elastic.co/t/error-using-java-api-calling-elasticsearchclient-method-healthreport/361478/2 "2024-06-17T07:57:27Z")

</div>

Hello, thanks for reporting this! It's a problem with the [API specification](https://github.com/elastic/elasticsearch-specification) used to produce the client code, the property `unhealthy_policies` is set as "required", but it shouldn't be. If you want you can create a new issue in the [java client repo](https://github.com/elastic/elasticsearch-java).

---

<div class="post-metadata">

**Author:** ![p4paul](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/p4paul/32/65034_2.png) [@p4paul](https://discuss.elastic.co/u/p4paul)\
**Post date:** [June 20, 2024, 8:34am UTC](https://discuss.elastic.co/t/error-using-java-api-calling-elasticsearchclient-method-healthreport/361478/4 "2024-06-20T08:34:14Z")

</div>

Raised issue [Deserilizing error calling the healthReport() method. · Issue #834 · elastic/elasticsearch-java · GitHub](https://github.com/elastic/elasticsearch-java/issues/834)
