# 404 on successful delete

**URL:** <https://discuss.elastic.co/t/404-on-successful-delete/148201>\
**Category:** Elasticsearch\
**Created:** [September 11, 2018, 6:47pm UTC](https://discuss.elastic.co/t/404-on-successful-delete/148201 "2018-09-11T18:47:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![skatenerd](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@skatenerd](https://discuss.elastic.co/u/skatenerd)\
**Post date:** [September 11, 2018, 6:47pm UTC](https://discuss.elastic.co/t/404-on-successful-delete/148201/1 "2018-09-11T18:47:04Z")

</div>

**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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 9, 2018, 6:47pm UTC](https://discuss.elastic.co/t/404-on-successful-delete/148201/2 "2018-10-09T18:47:05Z")

</div>

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