# Version\_conflict\_engine\_exception errors with status 409

**URL:** <https://discuss.elastic.co/t/version-conflict-engine-exception-errors-with-status-409/328855>\
**Category:** Elasticsearch\
**Created:** [March 29, 2023, 6:44pm UTC](https://discuss.elastic.co/t/version-conflict-engine-exception-errors-with-status-409/328855 "2023-03-29T18:44:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fernando\_Oliveira](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fernando_oliveira/32/80628_2.png) [@Fernando\_Oliveira](https://discuss.elastic.co/u/Fernando_Oliveira)\
**Post date:** [March 29, 2023, 6:44pm UTC](https://discuss.elastic.co/t/version-conflict-engine-exception-errors-with-status-409/328855/1 "2023-03-29T18:44:18Z")

</div>

Hello, I clean my indexes in the elastic with the script below:

POST /aplicacao/\_delete\_by\_query  
{  
"query": {  
"range": {  
"timeLog": {  
"lte": "now-5M"  
}  
}  
}  
}

"aplicacao

 ![elastic-409](https://us1.discourse-cdn.com/elastic/original/3X/7/d/7d05ee5b90ab7a0534f0072adcebcc83a74cfcb9.jpeg)  
" is the name of the index, I leave only the last 5 months and delete the previous ones, but now version\_conflict\_engine\_exception errors with status 409 are appearing.

Is there any parameter that I can put in the script so that it can proceed with the delete?

I attached the printout of the error

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 30, 2023, 5:57am UTC](https://discuss.elastic.co/t/version-conflict-engine-exception-errors-with-status-409/328855/2 "2023-03-30T05:57:13Z")

</div>

See the `conflicts` parameter in the docs - [Delete by query API | Elasticsearch Guide [8.6] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/8.6/docs-delete-by-query.html)

Also you should really be using time based indices here (via [ILM](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-lifecycle-management.html)), rather than this approach.

---

<div class="post-metadata">

**Author:** ![Fernando\_Oliveira](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fernando_oliveira/32/80628_2.png) [@Fernando\_Oliveira](https://discuss.elastic.co/u/Fernando_Oliveira)\
**Post date:** [March 31, 2023, 12:13pm UTC](https://discuss.elastic.co/t/version-conflict-engine-exception-errors-with-status-409/328855/3 "2023-03-31T12:13:14Z")

</div>

Hello, thank you very much for the reply..

I took a look at the link that passed referring to Delete by query ...

Is there any parameter that I can insert in my delete query to delete it even if there is a conflict?

Remembering that I am deleting older data and leaving only the current 5 months, would there be any problem deleting even having conflicts?

Thanks !!

---

<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:** [April 28, 2023, 12:13pm UTC](https://discuss.elastic.co/t/version-conflict-engine-exception-errors-with-status-409/328855/4 "2023-04-28T12:13:26Z")

</div>

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