Open a point in time API error after Elastic Client upgrade

tcsbears
Tue, 09 Dec 2025 19:16:46 +0000
Elasticsearch

We are upgrading our application from Java 11 → 17 and Spring boot 2.x.x → 3.5.6.

Before the upgrade, we used RestHighLevelClient 7.17 and Elasticsearch 7.17 on the server.

We replaced RestHighLevelClient with ElasticsearchClient (8.18 comes with Spring boot 3.5.6) and made all the necessary code changes. We are still using Elasticsearch 7.17 on the server.

After the upgrade, I am having an issue using the “open a point in time” API.

OpenPointInTimeRequest request = new OpenPointInTimeRequest.Builder()
        .index(indexName)
        .keepAlive(Time.of(t -> t.time(keepalive.toMinutes() + "m")))
        .build();

OpenPointInTimeResponse openPointInTimeResponse = client.openPointInTime(request);

After the last line is executed, I get below error:

failed co.elastic.clients.elasticsearch._types.ElasticsearchException: [es/open_point_in_time] failed: [illegal_argument_exception] request [POST /equity_symbols/_pit] does not support having a body
at co.elastic.clients.transport.ElasticsearchTransportBase.getApiResponse(ElasticsearchTransportBase.java:357)
at co.elastic.clients.transport.ElasticsearchTransportBase.performRequest(ElasticsearchTransportBase.java:141)
at co.elastic.clients.elasticsearch.ElasticsearchClient.openPointInTime(ElasticsearchClient.java:4169)

It worked fine prior to making any code change, and the code change for this particular API was minimal. Not sure why this is happening. Could there be a compatibility issue when ElasticsearchClient 8.18 tries to talk to Elasticsearch 7.17?

I would really appreciate any help/suggestion.

Regards,

Sang

3 posts - 3 participants