elasticsearch-java
elasticsearch-java copied to clipboard
ExecutePolicyResponse has requireNonNull for 'status' but is not returned by ES when wait_for_completion=false
Java API client version
8.3.3
Java version
18
Elasticsearch Version
7.17, 8.3.3
Problem description
ExecutePolicyResponse describes status as a required field but if ?wait_for_completion=false is used it is not returned. Additionally task is returned and not taskId which means this is also not available even when ApiTypeHelper#DANGEROUS_disableRequiredPropertiesCheck(false) is used.
without wait for ?wait_for_completion=false
{
"status": {
"phase": "COMPLETE"
}
}
with ?wait_for_completion=false
{
"task": "XbmXqhlgRBqy_4Yx6xPKqw:1854616"
}
We can add Status.batches for tasks.get(..)
2022-08-12 02:56:06.889 TRACE 818141 --- [/O dispatcher 1] tracer : curl -iX GET 'https://cluster-on.elastic-cloud.com:443/_tasks/Nfzw0V75RUacPwYUi4G_-Q:1252797'
# HTTP/1.1 200 OK
# Content-Length: 420
# Content-Type: application/json; charset=UTF-8
# X-Cloud-Request-Id: bazz
# X-Elastic-Product: Elasticsearch
# X-Found-Handling-Cluster: foo
# X-Found-Handling-Instance: instance-0000000001
# Date: Fri, 12 Aug 2022 00:56:06 GMT
#
# {"completed":false,"task":{"node":"Nfzw0V75RUacPwYUi4G_-Q","id":1252797,"type":"enrich","action":"policy_execution","status":{"phase":"RUNNING","step":"CreateIndexRequest"},"description":"executing enrich policy [application_id-by-request_id]","start_time_in_millis":1660265766834,"running_time_in_nanos":44160119,"cancellable":true,"cancelled":false,"parent_task_id":"nRe5uM-zSpeIKPb3gV-1qw:5607727","headers":{}}}
2022-08-12 02:56:06.902 ERROR 818141 --- [qtp105393903-70] c.b.elastic.ApplicationController : Exception while running routines for 'update lookup indices'
co.elastic.clients.util.MissingRequiredPropertyException: Missing required property 'Status.batches'