Skip to content

Issue with HealthResponse After Upgrading Elasticsearch Java Client to 8.17 #919

Closed
@rawnak35

Description

@rawnak35

Java API client version

8.17

Java version

11

Elasticsearch Version

8.12

Problem description

After upgrading the Elasticsearch Java client from version 8.12 to 8.17 (server version still 8.12), the call to client.cluster().health() is failing with the following exception:

Caused by: co.elastic.clients.util.MissingRequiredPropertyException: Missing required property 'HealthResponse.unassignedPrimaryShards'
    at co.elastic.clients.util.ApiTypeHelper.requireNonNull(ApiTypeHelper.java:76)

I attempted to use the workaround suggested in the documentation for handling missing required properties (ApiTypeHelper.DANGEROUS_disableRequiredPropertiesCheck(true);). However, it resulted in a NullPointerException:

Caused by: java.lang.NullPointerException
    at co.elastic.clients.elasticsearch.cluster.health.HealthResponseBody.<init>(HealthResponseBody.java:132)
    at co.elastic.clients.elasticsearch.cluster.HealthResponse.<init>(HealthResponse.java:59)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: SpecificationRelated to the API spec used to generate client code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions