Skip to content

[es/snapshot.restore] Failed to decode Response. Missing required property 'RestoreResponse.snapshot' #891

Open

Description

Java API client version

8.14.3

Java version

11

Elasticsearch Version

8.15

Problem description

Logs:
co.elastic.clients.transport.TransportException: node: https://************:9200/, status: 200, [es/snapshot.restore] Failed to decode response

Java code which creates the snapshot:

        RestoreRequest.Builder restoreRequestBuilder = new RestoreRequest.Builder();
        restoreRequestBuilder.repository(repoName);
        restoreRequestBuilder.snapshot(snapshot);
        restoreRequestBuilder.indices(indices);
        
        elasticsearchClient.snapshot().restore(restoreRequestBuilder.build());

The snapshot is successfully created on Elasticsearch, but the code fails to parse the response from the server, which simply returns:

        {
          "accepted": true
        }

But the sdk requires a non-null snapshot:

        private RestoreResponse(Builder builder) {
              this.snapshot = (SnapshotRestore) ApiTypeHelper.requireNonNull(builder.snapshot, this, "snapshot");
          }

Can someone help me with this please? Am i doing something wrong here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Area: SpecificationRelated to the API spec used to generate client codeCategory: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions