Skip to content

UpdateByQuery issue #2226

@rtwent

Description

@rtwent

Given:
ES: 7.17
ruflin/elastica: 7.2.0 (but the issue is present on the dev version too)

Background: Due to architectural issues - we run updateByQuery in loop. Troubles in debugging had appeared.

By the ES documentation the response of UpdateByQuery request is documented. It seems, for now, is impossible to retrieve the message, why request was failed.

Response::HasError() will always return false, because of error property is not documented for _update_by_query. As a result error message will be empty:

Elastica/src/Response.php

Lines 134 to 139 in e2cb89b

public function hasError()
{
$response = $this->getData();
return isset($response['error']);
}

isOk is a way to identify the response status. But still, no error message will be provided.

Example of failed response from elastic:

{
  "took":2,
  "timed_out":false,
  "total":1,
  "updated":0,
  "deleted":0,
  "batches":1,
  "version_conflicts":1,
  "noops":0,
  "retries":{
    "bulk":0,
    "search":0
  },
  "throttled_millis":0,
  "requests_per_second":-1,
  "throttled_until_millis":0,
  "failures":[
    {
      "index":"xxxxx",
      "type":"_doc",
      "id":"xxxxxx",
      "cause":{
        "type":"version_conflict_engine_exception",
        "reason":"[xxxxxx]: version conflict, required seqNo [15668298], primary term [2]. current document has seqNo [15668306] and primary term [2]",
        "index_uuid":"wUFh0yvBRkavh7cCHAxWcg",
        "shard":"1",
        "index":"xxxxx"
      },
      "status":409
    }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions