404 on successful delete


#1

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

Plugins installed: None

JVM version (java -version): Unknown (AWS-hosted Elasticsearch)

OS version (uname -a if on a Unix-like system): Unknown (AWS-hosted Elasticsearch)

Description of the problem including expected versus actual behavior: Issuing a DELETE request on an existing record results in a 404 return code, and successfully deletes the record.

The ES cluster responds with:
[404] {"_index":"my_index","_type":"doc","_id":"record_name","_version":4,"result":"not_found","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":73,"_primary_term":2}

The expected behavior is: a 200 response

Steps to reproduce:

Create a single document in an arbitrary index with arbitrary contents, whose ID is 'record_name'.

Confirm that the document exists by opening a browser and visiting:
http://{{my_url}}/{{my_index_name}}/doc/{{record_name}}

Delete the record via a DELETE request using the ruby API:
Elasticsearch::Client.new(url: my_url).delete(index: my_index_name, id: record_name, type: 'doc')

The response will come back Very Slowly. The record will disappear from ES, but the response will be a 404.

I wish I could be more specific about the reproduction steps, because clearly this won't work on every cluster. I'm debugging this on an existing aws-hosted server and I don't know what happened to its internal state that made it start failing in this way.

IMO, the server should never respond with 404 while succeeding at the requested behavior.


(system) #2

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