Version_conflict when trying to delete documents using _delete_by_query API

Hello,

I'm using Elasticsearch 8.6. I loaded many documents to an index day by day. I made a mistake when uploading the data for one day, so I want to delete all data from that specific day and load the correct information.

To delete the information I'm using (trying to) the _delete_by_query API. However, I'm getting an error "version_conflict_engine_exception". I run these commands on Kibana's Dev Tools.

I used the following query.

POST /index/_delete_by_query?timeout=2h
{
  "query":{
    "range":{
      "@timestamp":
      {
        "gte":"2023-02-23T06:00:00Z",
        "lt":"2023-02-24T06:00:00Z"
      }
    }
  }
}

I include an example of the error I'm getting.

  "failures": [
    {
      "index": "udp_index",
      "id": "5yAw7IYBA_-qkaEK9-u_",
      "cause": {
        "type": "version_conflict_engine_exception",
        "reason": "[5yAw7IYBA_-qkaEK9-u_]: version conflict, required seqNo [210075013], primary term [1]. but no document was found",
        "index_uuid": "2_zyM_OYSYa4B0Gi9zE_Fw",
        "shard": "0",
        "index": "udp_index"
      },
      "status": 409
    }

I checked this old post but I'm not sure about the given solution.

EDIT: My elasticsearch process shut down after executing the previously mentioned instruction. I restarted it and now the index is failing. The status in Kibana is blank and the health column is just a black dot.

Thanks in advance for any help.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.