Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[es/snapshot.restore] Missing required property 'RestoreResponse.snapshot' with wait_for_completion=false

Open
#201 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java, typescript

Research direction

Start with the snapshot restore response definition at the linked SnapshotRestoreResponse.ts line and compare it with the server response shown here. Review the similar specification PR, then trace the generated RestoreResponse and CreateSnapshotResponse classes; done means asynchronous restore and snapshot creation responses deserialize without requiring an absent snapshot property.

Written by the indexing model from the issue text.

Description

Area: Specification
Java API client version

7.16.2 and 7.17.1

Java version

java 11.0.14 2022-01-18 LTS

Elasticsearch Version

7.16.2

Problem description

Running snapshot restore with wait_for_completion=false does not work with the Java client.

Call:

            client
                    .snapshot()
                    .restore(r -> r
                                    .repository(snapshotRepositoryName)
                                    .snapshot(snapshotName)
                                    .indices(globPatterns)
                                    .renamePattern(renamePattern.getSearchRegex())
                                    .renameReplacement(renamePattern.getReplacementRegex())
                                    .includeAliases(false)
                                    .waitForCompletion(false)

Results in URI:

/_snapshot/myRepoName/cloud-snapshot-2022.02.23-asdf/_restore?wait_for_completion=false

Error:

co.elastic.clients.util.MissingRequiredPropertyException: Missing required property 'RestoreResponse.snapshot'

	at co.elastic.clients.util.ApiTypeHelper.requireNonNull(ApiTypeHelper.java:76)
	at co.elastic.clients.elasticsearch.snapshot.RestoreResponse.<init>(RestoreResponse.java:57)
	at co.elastic.clients.elasticsearch.snapshot.RestoreResponse.<init>(RestoreResponse.java:50)
	at co.elastic.clients.elasticsearch.snapshot.RestoreResponse$Builder.build(RestoreResponse.java:121)
	at co.elastic.clients.elasticsearch.snapshot.RestoreResponse$Builder.build(RestoreResponse.java:94)
	at co.elastic.clients.json.ObjectBuilderDeserializer.deserialize(ObjectBuilderDeserializer.java:80)
	at co.elastic.clients.json.DelegatingDeserializer$SameType.deserialize(DelegatingDeserializer.java:43)
	at co.elastic.clients.transport.rest_client.RestClientTransport.decodeResponse(RestClientTransport.java:325)
	at co.elastic.clients.transport.rest_client.RestClientTransport.getHighLevelResponse(RestClientTransport.java:291)
	at co.elastic.clients.transport.rest_client.RestClientTransport.performRequest(RestClientTransport.java:144)
	at co.elastic.clients.elasticsearch.snapshot.ElasticsearchSnapshotClient.restore(ElasticsearchSnapshotClient.java:361)
	at co.elastic.clients.elasticsearch.snapshot.ElasticsearchSnapshotClient.restore(ElasticsearchSnapshotClient.java:377)

The same problem also happens with es/snapshot.restore:

co.elastic.clients.util.MissingRequiredPropertyException: Missing required property 'CreateSnapshotResponse.snapshot'

	at co.elastic.clients.util.ApiTypeHelper.requireNonNull(ApiTypeHelper.java:76)
	at co.elastic.clients.elasticsearch.snapshot.CreateSnapshotResponse.<init>(CreateSnapshotResponse.java:61)
	at co.elastic.clients.elasticsearch.snapshot.CreateSnapshotResponse.<init>(CreateSnapshotResponse.java:50)
Notes

From what I understand, the server responds with {"acknowledged":true} but in the spec the "snapshot" is mandatory.
https://github.com/elastic/elasticsearch-specification/blob/d19af7a3ccd53459593246fbc2fffe0c33d86712/specification/snapshot/restore/SnapshotRestoreResponse.ts#L24

See similar PR: https://github.com/elastic/elasticsearch-specification/pull/1326/files

Dominant language
Java
Stars
524
Forks
299
Avg merge
16m
Merged PRs (30d)
13

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from elastic/elasticsearch-java

All issues in elastic/elasticsearch-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.