# Error NOT\_FOUND(404) during delete

**URL:** <https://discuss.elastic.co/t/error-not-found-404-during-delete/118194>\
**Category:** Elasticsearch\
**Created:** [February 2, 2018, 9:28am UTC](https://discuss.elastic.co/t/error-not-found-404-during-delete/118194 "2018-02-02T09:28:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![r\_camaras](https://avatars.discourse-cdn.com/v4/letter/r/e19adc/32.png) [@r\_camaras](https://discuss.elastic.co/u/r_camaras)\
**Post date:** [February 2, 2018, 9:28am UTC](https://discuss.elastic.co/t/error-not-found-404-during-delete/118194/1 "2018-02-02T09:28:22Z")

</div>

Hello,

I have following python script where delete call sometimes crashes with error 404 (NOT FOUND), while the entry really exists and it is deleted in the next delete call.

What can I do to solve this?

query\_body = {  
"sort" : [  
{ "\_uid" : { "order" : "asc" } }  
]  
}  
r = es.search(index="my\_index", body=query\_body, size=1)

the\_id = r['hits']['hits'][0]['\_id']

d = es.delete(index="my\_index", doc\_type="my\_doc\_type", id=the\_id, params={ } )

Regards,  
Raul

---

<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:** [March 2, 2018, 9:29am UTC](https://discuss.elastic.co/t/error-not-found-404-during-delete/118194/2 "2018-03-02T09:29:04Z")

</div>

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