OpenSearch version
2.5 (Amazon OpenSearch Service)
Java version
17
Problem description
When the Opensearch server is in an unhealthy state related to shards, the response of the _bulk endpoint can return an invalid response, where the attribute ShardFailure.shard is missing. As you can see from the stacktrace below, the Java client lib parses the response from the server, and while trying to construct a ShardFailure object, throws a MissingRequiredPropertyException.
I don't know whether the client is wrong here - should the property be required? Or perhaps the server is at fault - perhaps it's not returning the property as it should?
Request
POST /_bulk
Error message
org.opensearch.client.util.MissingRequiredPropertyException: Missing required property 'ShardFailure.shard'
at org.opensearch.client.util.ApiTypeHelper.requireNonNull(ApiTypeHelper.java:88)
at org.opensearch.client.opensearch._types.ShardFailure.<init>(ShardFailure.java:76)
at org.opensearch.client.opensearch._types.ShardFailure$Builder.build(ShardFailure.java:234)
at org.opensearch.client.opensearch._types.ShardFailure$Builder.build(ShardFailure.java:164)
at org.opensearch.client.json.ObjectBuilderDeserializer.deserialize(ObjectBuilderDeserializer.java:99)
at org.opensearch.client.json.DelegatingDeserializer$SameType.deserialize(DelegatingDeserializer.java:61)
at org.opensearch.client.json.JsonpDeserializerBase$ArrayDeserializer.deserialize(JsonpDeserializerBase.java:353)
at org.opensearch.client.json.JsonpDeserializerBase$ArrayDeserializer.deserialize(JsonpDeserializerBase.java:322)
at org.opensearch.client.json.JsonpDeserializer.deserialize(JsonpDeserializer.java:88)
at org.opensearch.client.json.ObjectDeserializer$FieldObjectDeserializer.deserialize(ObjectDeserializer.java:85)
at org.opensearch.client.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:189)
at org.opensearch.client.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:150)
at org.opensearch.client.json.JsonpDeserializer.deserialize(JsonpDeserializer.java:88)
at org.opensearch.client.json.ObjectBuilderDeserializer.deserialize(ObjectBuilderDeserializer.java:92)
at org.opensearch.client.json.DelegatingDeserializer$SameType.deserialize(DelegatingDeserializer.java:56)
at org.opensearch.client.json.ObjectDeserializer$FieldObjectDeserializer.deserialize(ObjectDeserializer.java:85)
at org.opensearch.client.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:189)
at org.opensearch.client.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:150)
at org.opensearch.client.json.ObjectBuilderDeserializer.deserialize(ObjectBuilderDeserializer.java:98)
at org.opensearch.client.json.DelegatingDeserializer$SameType.deserialize(DelegatingDeserializer.java:61)
at org.opensearch.client.json.JsonpDeserializerBase$ArrayDeserializer.deserialize(JsonpDeserializerBase.java:353)
at org.opensearch.client.json.JsonpDeserializerBase$ArrayDeserializer.deserialize(JsonpDeserializerBase.java:322)
at org.opensearch.client.json.JsonpDeserializer.deserialize(JsonpDeserializer.java:88)
at org.opensearch.client.json.ObjectDeserializer$FieldObjectDeserializer.deserialize(ObjectDeserializer.java:85)
at org.opensearch.client.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:189)
at org.opensearch.client.json.ObjectDeserializer.deserialize(ObjectDeserializer.java:150)
at org.opensearch.client.json.JsonpDeserializer.deserialize(JsonpDeserializer.java:88)
at org.opensearch.client.json.ObjectBuilderDeserializer.deserialize(ObjectBuilderDeserializer.java:92)
at org.opensearch.client.json.DelegatingDeserializer$SameType.deserialize(DelegatingDeserializer.java:56)
at org.opensearch.client.transport.aws.AwsSdk2Transport.parseResponse(AwsSdk2Transport.java:516)
at org.opensearch.client.transport.aws.AwsSdk2Transport.executeSync(AwsSdk2Transport.java:393)
at org.opensearch.client.transport.aws.AwsSdk2Transport.performRequestAsync(AwsSdk2Transport.java:227)
at org.opensearch.client.opensearch.OpenSearchAsyncClient.bulk(OpenSearchAsyncClient.java:213)
...
opensearch-java client version 2.4.0
OpenSearch version 2.5 (Amazon OpenSearch Service)
Java version 17
Problem description When the Opensearch server is in an unhealthy state related to shards, the response of the
_bulk
endpoint can return an invalid response, where the attributeShardFailure.shard
is missing. As you can see from the stacktrace below, the Java client lib parses the response from the server, and while trying to construct aShardFailure
object, throws a MissingRequiredPropertyException.I don't know whether the client is wrong here - should the property be required? Or perhaps the server is at fault - perhaps it's not returning the property as it should?
Request
POST /_bulk
Error message