Skip to content

shouldStoreResult is not set correctly #46350

@mrshwah

Description

@mrshwah

Elasticsearch version (bin/elasticsearch --version): 6.5.3

Plugins installed: []

JVM version: 1.8

OS version (uname -a if on a Unix-like system): Darwin Kernel Version 18.6.0

Description of the problem including expected versus actual behavior:

When trying to make an updateByQuery call with the Java RestHighLevelClient, shouldStoreResult is always false, even if you explicitly set the request object to true. The updateByQuery tasks are not stored when they have finished or failed and when you try to retrieve them, and exception is thrown.

Steps to reproduce:

  1. Create an UpdateByQueryRequest and set shouldStoreResult:
UpdateByQueryRequest request = UpdateByQueryRequest("index").setShouldStoreResult(true).setScript(new Script(ScriptType.STORED, null, scriptId, params));
  1. Call updateByQueryAsync:
restClient.updateByQueryAsync(request, RequestOptions.DEFAULT, listener);
  1. Get the list of tasks, and then try to retrieve the task by id in Kibana:
ListTasksRequest request = new ListTasksRequest().setActions("*byquery").setDetailed(true);
ListTasksResponse response = esRestClient.tasks().list(request, RequestOptions.DEFAULT);
// kibana
GET _tasks/:taskId

Provide logs (if relevant):
Kibana error when you try to fetch

{
  "error" : {
    "root_cause" : [
      {
        "type" : "resource_not_found_exception",
        "reason" : "task [24XlcEQtRfa1FI5rkpioGw:65213] isn't running and hasn't stored its results"
      }
    ],
    "type" : "resource_not_found_exception",
    "reason" : "task [24XlcEQtRfa1FI5rkpioGw:65213] isn't running and hasn't stored its results"
  },
  "status" : 404
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions