Description
Elasticsearch version (bin/elasticsearch --version
): 7.16.2
Plugins installed: []
JVM version (java -version
):
openjdk version "11.0.13" 2021-10-19
OpenJDK Runtime Environment (build 11.0.13+8-Ubuntu-0ubuntu1.21.10)
OpenJDK 64-Bit Server VM (build 11.0.13+8-Ubuntu-0ubuntu1.21.10, mixed mode, sharing)
OS version (uname -a
if on a Unix-like system):
Linux pop-os 5.15.8-76051508-generic #202112141040
163950527821.10~0ede46a SMP Tue Dec 14 22:38:29 U x86_64 x86_64 x86_64 GNU/Linux
Description of the problem including expected versus actual behavior:
When performing a snapshot using the new Java client, it fails due to missing X-Elastic-Product
header sent by Elasticsearch.
Steps to reproduce:
Please include a minimal but complete recreation of the problem,
including (e.g.) index creation, mappings, settings, query etc. The easier
you make for us to reproduce it, the more likely that somebody will take the
time to look at it.
- Create an FS repository,
- Create a snapshot using the new java client:
final CreateSnapshotRequest request = new CreateSnapshotRequest
.Builder()
.repository(repository)
.snapshot(name)
.waitForCompletion(waitForCompletion)
.build();
client.create(request);
Client being used (maven dep):
<elasticsearch.version>7.16.2</elasticsearch.version>
...
<dependency>
<groupId>co.elastic.clients</groupId>
<artifactId>elasticsearch-java</artifactId>
<version>${elasticsearch.version}</version>
</dependency>
- The code throws an exception.
Provide logs (if relevant):
co.elastic.clients.transport.TransportException: [es/snapshot.create] Missing [X-Elastic-Product] header. Please check that you are connecting to an Elasticsearch instance, and that any networking filters are preserving that header.
at co.elastic.clients.transport.rest_client.RestClientTransport.checkProductHeader(RestClientTransport.java:340)
at co.elastic.clients.transport.rest_client.RestClientTransport.getHighLevelResponse(RestClientTransport.java:250)
at co.elastic.clients.transport.rest_client.RestClientTransport.performRequest(RestClientTransport.java:144)
at co.elastic.clients.elasticsearch.snapshot.ElasticsearchSnapshotClient.create(ElasticsearchSnapshotClient.java:142)