# Version Conflict while using delete\_by\_query

**URL:** <https://discuss.elastic.co/t/version-conflict-while-using-delete-by-query/104831>\
**Category:** Elasticsearch\
**Created:** [October 23, 2017, 3:45am UTC](https://discuss.elastic.co/t/version-conflict-while-using-delete-by-query/104831 "2017-10-23T03:45:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ayra\_Faceless](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@Ayra\_Faceless](https://discuss.elastic.co/u/Ayra_Faceless)\
**Post date:** [October 23, 2017, 3:45am UTC](https://discuss.elastic.co/t/version-conflict-while-using-delete-by-query/104831/1 "2017-10-23T03:45:28Z")

</div>

I'm using logstash to insert huge data to my elasticsearch,but sometimes the grok plugin fails and insert a message with tags =\_grokparsefailure.

Now i'm going to remove all data contains this tag with the request below ,but i reports a version conflict.

> POST logstash-163/mail163/\_delete\_by\_query?timeout=5m  
> {  
> "query": {  
> "match" : {  
> "tags" : "\_grokparsefailure"  
> }  
> }  
> }

And the result is

> {  
> "took": 676,  
> "timed\_out": false,  
> "total": 285008161,  
> "deleted": 0,  
> "batches": 1,  
> "version\_conflicts": 1000,  
> "noops": 0,  
> "retries": {  
> "bulk": 0,  
> "search": 0  
> },  
> "throttled\_millis": 0,  
> "requests\_per\_second": -1,  
> "throttled\_until\_millis": 0,  
> "failures": [  
> {  
> "index": "logstash-163",  
> "type": "mail163",  
> "id": "AV89E\_COisCbJs1cSr60",  
> "cause": {  
> "type": "version\_conflict\_engine\_exception",  
> "reason": "[mail163][AV89E\_COisCbJs1cSr60]: version conflict, current version [2] is different than the one provided [1]",  
> "index\_uuid": "GBUx80OtTrWFSlYlZiTiCA",  
> "shard": "2",  
> "index": "logstash-163"  
> },  
> "status": 409  
> },  
> {  
> "index": "logstash-163",  
> "type": "mail163",  
> "id": "AV89E\_COisCbJs1cSsBF",  
> "cause": {  
> "type": "version\_conflict\_engine\_exception",  
> "reason": "[mail163][AV89E\_COisCbJs1cSsBF]: version conflict, current version [2] is different than the one provided [1]",  
> "index\_uuid": "GBUx80OtTrWFSlYlZiTiCA",  
> "shard": "2",  
> "index": "logstash-163"  
> },  
> "status": 409  
> },  
> {  
> "index": "logstash-163",  
> "type": "mail163",  
> "id": "AV89E\_COisCbJs1cSsAk",  
> "cause": {  
> "type": "version\_conflict\_engine\_exception",  
> "reason": "[mail163][AV89E\_COisCbJs1cSsAk]: version conflict, current version [2] is different than the one provided [1]",  
> "index\_uuid": "GBUx80OtTrWFSlYlZiTiCA",  
> "shard": "2",  
> "index": "logstash-163"  
> },  
> "status": 409  
> },  
> ......... and some stuff likes above

Is there a solution for this? thanks 😭

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [October 23, 2017, 8:21am UTC](https://discuss.elastic.co/t/version-conflict-while-using-delete-by-query/104831/2 "2017-10-23T08:21:08Z")

</div>

this means, that those documents were written while the delete by query operation ran. So some external tool tried to overwrite that document.

You could just run the same command again and make sure those get deleted.

Deleting 285 million documents is quite a long running operation, so it is likely that there was another indexing operation in between.

--Alex

---

<div class="post-metadata">

**Author:** ![Ayra\_Faceless](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@Ayra\_Faceless](https://discuss.elastic.co/u/Ayra_Faceless)\
**Post date:** [October 24, 2017, 12:38am UTC](https://discuss.elastic.co/t/version-conflict-while-using-delete-by-query/104831/3 "2017-10-24T00:38:18Z")

</div>

Thanks for your reply, but the same problem occurs again while i had restarted all and post the request .

I'm quite sure that NOTHING is trying to update or insert data into my elasticsearch .

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [October 24, 2017, 10:09am UTC](https://discuss.elastic.co/t/version-conflict-while-using-delete-by-query/104831/4 "2017-10-24T10:09:39Z")

</div>

which ES version is this?

---

<div class="post-metadata">

**Author:** ![Ayra\_Faceless](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@Ayra\_Faceless](https://discuss.elastic.co/u/Ayra_Faceless)\
**Post date:** [October 25, 2017, 1:09am UTC](https://discuss.elastic.co/t/version-conflict-while-using-delete-by-query/104831/5 "2017-10-25T01:09:20Z")

</div>

The newest version. 5.6.3 maybe.

And there is another problem in logstash, newest version has a bug that cannot insert data into elasticsearch properly, By downgrading to 5.6.2 problems solved.

Also if my system hangs while running logstash, after force reboot u have to remove logstash completely and install it again ,or u will never be able to using it.

---

<div class="post-metadata">

**Author:** ![Ayra\_Faceless](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@Ayra\_Faceless](https://discuss.elastic.co/u/Ayra_Faceless)\
**Post date:** [October 25, 2017, 1:11am UTC](https://discuss.elastic.co/t/version-conflict-while-using-delete-by-query/104831/6 "2017-10-25T01:11:26Z")

</div>

Oh, the problem in this thread was solved with parameter conflicts=proceed added to request.

It takes a while to delete the whole data.

---

<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:** [November 22, 2017, 1:11am UTC](https://discuss.elastic.co/t/version-conflict-while-using-delete-by-query/104831/7 "2017-11-22T01:11:47Z")

</div>

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