Update using Elasticsearch restlevel client 7.5.1 is failing on Elasticsearch 6.8 AWS cluster

Hi Team,

 We do own 2 AWS Elasticsearch clusters, out of which one got upgraded to 7.1 version while the latter is still on 6.8 version. We did scala code changes to accommodate this upgradation(as our existing jobs were failing with unsupported version error with the new 7.x cluster). Post the code change, we were planning the code built using new maven dependency against the cluster running with 6.8 version. But the update jobs on index failed with the **"{"error":{"root_cause":[{"type":"invalid_type_name_exception","reason":"Document mapping type name can't start with '_', found: [_update]"}],"type":"invalid_type_name_exception","reason":"Document mapping type name can't start with '_', found: [_update]"},"status":400}"**

Maven Dependency
org.elasticsearch.client
elasticsearch-rest-high-level-client
7.5.1

The error is obvious as the POST calls made using 7.5.1 and 6.8 versions are quite different as follows:
W.r.t ES 7.5.1 => POST test/_update/1

W.r.t ES 6.8 => POST test/_doc/1/_update

ES 6.8 cluster is expecting _doc keyword in the URL which is not supported in 7.5.1. Is there any way we can reuse the code by switching the api version while making the call?

Welcome !

What I'm doing in such a case is to provide 2 versions of the same project. One is embedding the 7.x client and one is using the 6.x client.

You can't use a 7.x client on a 6.x cluster.

Hello David,

Thanks for the quick turnaround. When I was looking through the documentation, I did see that the upgrade from 6.x to 7.x will not break any existing modules and the API calls supported by 6.8 will be supported in 7.x as well with few exceptions. Is this limitation because of using java-rest client instead of native client? Or did I misunderstood something

The problem is also with the old deprecated native client.

Some notes about compatibility here: https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-compatibility.html

TBC a 6.x client should work against a 7.x cluster, but not the other way round. 7.x clusters support the 6.x-style POST /i/_doc/1/_update form of update.

1 Like

There were issues when we tried to run a job written with 6.8.3 elasticsearch-rest-high-level-client dependency against 7.1.1 AWS managed ES cluster(it got autoupgraded from 6.8.3). The jobs failed with unknown elasticsearch version which is why we switched the library

Can you be more precise about how these jobs failed? Do you have logs or stack traces of the problem?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.