# Errors on bulk delete of child

**URL:** <https://discuss.elastic.co/t/errors-on-bulk-delete-of-child/4016>\
**Category:** Elasticsearch\
**Created:** [March 2, 2011, 4:23pm UTC](https://discuss.elastic.co/t/errors-on-bulk-delete-of-child/4016 "2011-03-02T16:23:51Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Paul\_2](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@Matt\_Paul\_2](https://discuss.elastic.co/u/Matt_Paul_2)\
**Post date:** [March 2, 2011, 4:23pm UTC](https://discuss.elastic.co/t/errors-on-bulk-delete-of-child/4016/1 "2011-03-02T16:23:51Z")

</div>

Hi All,

I'm working with the latest build of ES (just downloaded yesterday  
morning from source) and I've come across an issue where when I  
attempt to do a bulk delete of a child document, I'm getting an error  
saying versions don't match (even through I don't specify a version,  
which I understood to mean use the latest). I put a curl example at

> <https://gist.github.com/anonymous/851188>

Any help would really be appreciated,

Matt

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [March 2, 2011, 4:34pm UTC](https://discuss.elastic.co/t/errors-on-bulk-delete-of-child/4016/2 "2011-03-02T16:34:57Z")

</div>

Hi Matt

> I'm working with the latest build of ES (just downloaded yesterday  
> morning from source) and I've come across an issue where when I  
> attempt to do a bulk delete of a child document, I'm getting an error  
> saying versions don't match (even through I don't specify a version,  
> which I understood to mean use the latest). I put a curl example at  
> [bulk delete child not working · GitHub](https://gist.github.com/851188)

I've tried your script both on 0.15.1 and the latest from master (from  
today).

I don't get any errors. All works fine.

But I wonder if adding a cluster\_health 'wait\_for\_status' pause after  
your refresh might help?

clint

---

<div class="post-metadata">

**Author:** ![Matt\_Paul\_2](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@Matt\_Paul\_2](https://discuss.elastic.co/u/Matt_Paul_2)\
**Post date:** [March 2, 2011, 4:55pm UTC](https://discuss.elastic.co/t/errors-on-bulk-delete-of-child/4016/3 "2011-03-02T16:55:08Z")

</div>

clint,

Thanks for the reply! I'm definitely getting an error on the final delete  
everytime I try it (all the other command succeed as expected):

{"took":9,"items":[{"delete":{"\_index":"err\_test\_real","\_type":"results","\_id":"8a08dfb3af854f07b72b04b977f27f2a:81","error":"VersionConflictEngineException[[err\_test\_real][4]  
[results][8a08dfb3af854f07b72b04b977f27f2a:81]:  
version conflict, current  
[-1], required [2]]"}}]}

I suppose I could try the cluster\_health check (I'll have to dig into how  
that's done), but I was under the impression that doing a refresh on the  
index waiting until everything was flushed out before it returns, which is  
why that call is there before the delete (or am I incorrect on the refresh  
use?)

On Mar 2, 2011 10:34am, Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk) wrote:

> Hi Matt

> > I'm working with the latest build of ES (just downloaded yesterday

> > morning from source) and I've come across an issue where when I

> > attempt to do a bulk delete of a child document, I'm getting an error

> > saying versions don't match (even through I don't specify a version,

> > which I understood to mean use the latest). I put a curl example at

> > [bulk delete child not working · GitHub](https://gist.github.com/851188)

> I've tried your script both on 0.15.1 and the latest from master (from

> today).

> I don't get any errors. All works fine.

> But I wonder if adding a cluster\_health 'wait\_for\_status' pause after

> your refresh might help?

> clint

---

<div class="post-metadata">

**Author:** ![Matt\_Paul\_2](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@Matt\_Paul\_2](https://discuss.elastic.co/u/Matt_Paul_2)\
**Post date:** [March 2, 2011, 5:00pm UTC](https://discuss.elastic.co/t/errors-on-bulk-delete-of-child/4016/4 "2011-03-02T17:00:43Z")

</div>

clint,

I just tried adding a curl  
-XGET '[http://localhost:9200/\_cluster/health?wait\_for\_status=yellow](http://localhost:9200/_cluster/health?wait_for_status=yellow)'  
(yellow because I only have 1 node in the test setup so no replicas) and  
still get the same error. I'm going to try pulling the latest and see if it  
still occurs with that version

Thanks for the help anyway!

Matt

On Mar 2, 2011 10:55am, [purplegherkin@gmail.com](mailto:purplegherkin@gmail.com) wrote:

> clint,

> Thanks for the reply! I'm definitely getting an error on the final delete  
> everytime I try it (all the other command succeed as expected):

> {"took":9,"items":[{"delete":{"\_index":"err\_test\_real","\_type":"results","\_id":"8a08dfb3af854f07b72b04b977f27f2a:81","error":"VersionConflictEngineException[[err\_test\_real][4]  
> [results][8a08dfb3af854f07b72b04b977f27f2a:81]:  
> version conflict, current  
> [-1], required [2]]"}}]}

> I suppose I could try the cluster\_health check (I'll have to dig into how  
> that's done), but I was under the impression that doing a refresh on the  
> index waiting until everything was flushed out before it returns, which  
> is why that call is there before the delete (or am I incorrect on the  
> refresh use?)

> On Mar 2, 2011 10:34am, Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)\> wrote:
> 
> > Hi Matt
> > 
> > > I'm working with the latest build of ES (just downloaded yesterday
> > 
> > > morning from source) and I've come across an issue where when I
> > 
> > > attempt to do a bulk delete of a child document, I'm getting an error
> > 
> > > saying versions don't match (even through I don't specify a version,
> > 
> > > which I understood to mean use the latest). I put a curl example at
> > 
> > > [bulk delete child not working · GitHub](https://gist.github.com/851188)
> > 
> > I've tried your script both on 0.15.1 and the latest from master (from
> > 
> > today).
> > 
> > I don't get any errors. All works fine.
> > 
> > But I wonder if adding a cluster\_health 'wait\_for\_status' pause after
> > 
> > your refresh might help?
> > 
> > clint

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [March 2, 2011, 5:01pm UTC](https://discuss.elastic.co/t/errors-on-bulk-delete-of-child/4016/5 "2011-03-02T17:01:44Z")

</div>

Hi Matt

> Thanks for the reply! I'm definitely getting an error on the final  
> delete everytime I try it (all the other command succeed as expected):
> 
> {"took":9,"items":[{"delete":{"\_index":"err\_test\_real","\_type":"results","\_id":"8a08dfb3af854f07b72b04b977f27f2a:81","error":"VersionConflictEngineException[[err\_test\_real][4] [results][8a08dfb3af854f07b72b04b977f27f2a:81]: version conflict, current [-1], required [2]]"}}]}

I retried with a cluster of 3 nodes, and it still works. I get this:  
{"took":3,"items":[{"delete":{"\_index":"err\_test\_real","\_type":"results","\_id":"8a08dfb3af854f07b72b04b977f27f2a:81","\_version":2,"ok":true}}]}

> I suppose I could try the cluster\_health check (I'll have to dig into  
> how that's done), but I was under the impression that doing a refresh  
> on the index waiting until everything was flushed out before it  
> returns, which is why that call is there before the delete (or am I  
> incorrect on the refresh use?)

I think it should, but I know there have been issues with it in the  
past.

Try upgrading to the latest master from today (kimchy moves at quite a  
speed, so yesterday's "latest" is today's old news)

And perhaps you have something non-default in your config?

clint

---

<div class="post-metadata">

**Author:** ![Matt\_Paul\_2](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@Matt\_Paul\_2](https://discuss.elastic.co/u/Matt_Paul_2)\
**Post date:** [March 2, 2011, 5:09pm UTC](https://discuss.elastic.co/t/errors-on-bulk-delete-of-child/4016/6 "2011-03-02T17:09:33Z")

</div>

Clint,

I just finished downloading the latest, building now

I have nothing that's non-default set in my config, using all the out of  
the box settings right now.

Matt

On Mar 2, 2011 11:01am, Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk) wrote:

> Hi Matt

> > Thanks for the reply! I'm definitely getting an error on the final

> > delete everytime I try it (all the other command succeed as expected):

> >

> > 
> 
> {"took":9,"items":[{"delete":{"\_index":"err\_test\_real","\_type":"results","\_id":"8a08dfb3af854f07b72b04b977f27f2a:81","error":"VersionConflictEngineException[[err\_test\_real][4]  
> [results][8a08dfb3af854f07b72b04b977f27f2a:81]: version conflict, current  
> [-1], required [2]]"}}]}

> >

> I retried with a cluster of 3 nodes, and it still works. I get this:

> {"took":3,"items":[{"delete":{"\_index":"err\_test\_real","\_type":"results","\_id":"8a08dfb3af854f07b72b04b977f27f2a:81","\_version":2,"ok":true}}]}

> > I suppose I could try the cluster\_health check (I'll have to dig into

> > how that's done), but I was under the impression that doing a refresh

> > on the index waiting until everything was flushed out before it

> > returns, which is why that call is there before the delete (or am I

> > incorrect on the refresh use?)

> I think it should, but I know there have been issues with it in the

> past.

> Try upgrading to the latest master from today (kimchy moves at quite a

> speed, so yesterday's "latest" is today's old news)

> And perhaps you have something non-default in your config?

> clint

---

<div class="post-metadata">

**Author:** ![Matt\_Paul\_2](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@Matt\_Paul\_2](https://discuss.elastic.co/u/Matt_Paul_2)\
**Post date:** [March 2, 2011, 5:36pm UTC](https://discuss.elastic.co/t/errors-on-bulk-delete-of-child/4016/7 "2011-03-02T17:36:12Z")

</div>

Clint,

Well, interesting results. It definitely still occurs with the latest from  
source, BUT it doesn't happen every time I run the script (dropping the  
index in between runs, refreshing and waiting for green status), I can  
typically get 1 execution of the script to work from a fresh install,  
usually the 1st or 2nd try succeeds, then I get the error

On Mar 2, 2011 11:09am, [purplegherkin@gmail.com](mailto:purplegherkin@gmail.com) wrote:

> Clint,

> I just finished downloading the latest, building now

> I have nothing that's non-default set in my config, using all the out of  
> the box settings right now.

> Matt

> On Mar 2, 2011 11:01am, Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)\> wrote:
> 
> > Hi Matt
> > 
> > > Thanks for the reply! I'm definitely getting an error on the final
> > 
> > > delete everytime I try it (all the other command succeed as expected):
> > 
> > > 
> > 
> > >
> 
> {"took":9,"items":[{"delete":{"\_index":"err\_test\_real","\_type":"results","\_id":"8a08dfb3af854f07b72b04b977f27f2a:81","error":"VersionConflictEngineException[[err\_test\_real][4]  
> [results][8a08dfb3af854f07b72b04b977f27f2a:81]: version conflict, current  
> [-1], required [2]]"}}]}
> 
> > > 
> > 
> > I retried with a cluster of 3 nodes, and it still works. I get this:
> 
> {"took":3,"items":[{"delete":{"\_index":"err\_test\_real","\_type":"results","\_id":"8a08dfb3af854f07b72b04b977f27f2a:81","\_version":2,"ok":true}}]}
> 
> > > I suppose I could try the cluster\_health check (I'll have to dig into
> > 
> > > how that's done), but I was under the impression that doing a refresh
> > 
> > > on the index waiting until everything was flushed out before it
> > 
> > > returns, which is why that call is there before the delete (or am I
> > 
> > > incorrect on the refresh use?)
> > 
> > I think it should, but I know there have been issues with it in the
> > 
> > past.
> > 
> > Try upgrading to the latest master from today (kimchy moves at quite a
> > 
> > speed, so yesterday's "latest" is today's old news)
> > 
> > And perhaps you have something non-default in your config?
> > 
> > clint

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [March 2, 2011, 5:43pm UTC](https://discuss.elastic.co/t/errors-on-bulk-delete-of-child/4016/8 "2011-03-02T17:43:24Z")

</div>

On Wed, 2011-03-02 at 17:36 +0000, [purplegherkin@gmail.com](mailto:purplegherkin@gmail.com) wrote:

> Clint,
> 
> Well, interesting results. It definitely still occurs with the latest  
> from source, BUT it doesn't happen every time I run the script  
> (dropping the index in between runs, refreshing and waiting for green  
> status), I can typically get 1 execution of the script to work from a  
> fresh install, usually the 1st or 2nd try succeeds, then I get the  
> error

matt - I'd open an issue on  
[Issues · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues) with a recreation.

clint

---

<div class="post-metadata">

**Author:** ![Matt\_Paul\_2](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@Matt\_Paul\_2](https://discuss.elastic.co/u/Matt_Paul_2)\
**Post date:** [March 2, 2011, 5:54pm UTC](https://discuss.elastic.co/t/errors-on-bulk-delete-of-child/4016/9 "2011-03-02T17:54:09Z")

</div>

Thanks Clint, I opened the issue with a link to the gist. Appreciate the  
help regardless!

On Mar 2, 2011 11:43am, Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk) wrote:

> On Wed, 2011-03-02 at 17:36 +0000, [purplegherkin@gmail.com](mailto:purplegherkin@gmail.com) wrote:

> > Clint,

> >

> > Well, interesting results. It definitely still occurs with the latest

> > from source, BUT it doesn't happen every time I run the script

> > (dropping the index in between runs, refreshing and waiting for green

> > status), I can typically get 1 execution of the script to work from a

> > fresh install, usually the 1st or 2nd try succeeds, then I get the

> > error

> matt - I'd open an issue on

> [Issues · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues) with a recreation.

> clint

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 2, 2011, 8:00pm UTC](https://discuss.elastic.co/t/errors-on-bulk-delete-of-child/4016/10 "2011-03-02T20:00:54Z")

</div>

Heya,

I think I know where the problem comes from. Basically, the delete API does not accept a parent parameter, just a routing parameter. So, the parent value should be set on the routing in case of delete. But, the delete API should support parent as well (which will simply automatically set the routing), here is the issue: [Delete API: Allow to set \_parent on it (will simply set the routing value) · Issue #742 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/742).

-shay.banon  
On Wednesday, March 2, 2011 at 7:54 PM, [purplegherkin@gmail.com](mailto:purplegherkin@gmail.com) wrote:

> Thanks Clint, I opened the issue with a link to the gist. Appreciate the help regardless!
> 
> On Mar 2, 2011 11:43am, Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk) wrote:
> 
> > On Wed, 2011-03-02 at 17:36 +0000, [purplegherkin@gmail.com](mailto:purplegherkin@gmail.com) wrote:
> > 
> > > Clint,
> > 
> > > 
> > 
> > > Well, interesting results. It definitely still occurs with the latest
> > 
> > > from source, BUT it doesn't happen every time I run the script
> > 
> > > (dropping the index in between runs, refreshing and waiting for green
> > 
> > > status), I can typically get 1 execution of the script to work from a
> > 
> > > fresh install, usually the 1st or 2nd try succeeds, then I get the
> > 
> > > error
> > 
> > matt - I'd open an issue on
> > 
> > [Issues · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues) with a recreation.
> > 
> > clint

---

<div class="post-metadata">

**Author:** ![Matt\_Paul\_2](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@Matt\_Paul\_2](https://discuss.elastic.co/u/Matt_Paul_2)\
**Post date:** [March 2, 2011, 8:57pm UTC](https://discuss.elastic.co/t/errors-on-bulk-delete-of-child/4016/11 "2011-03-02T20:57:18Z")

</div>

Shay,

I just saw the reply on the issue, I'll make the change to \_routing and let  
you know

Matt

On Mar 2, 2011 2:00pm, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:

> Heya,

> I think I know where the problem comes from. Basically, the delete API  
> does not accept a parent parameter, just a routing parameter. So, the  
> parent value should be set on the routing in case of delete. But, the  
> delete API should support parent as well (which will simply automatically  
> set the routing), here is the issue:  
> [Delete API: Allow to set \_parent on it (will simply set the routing value) · Issue #742 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/742).

> -shay.banon

> On Wednesday, March 2, 2011 at 7:54 PM, [purplegherkin@gmail.com](mailto:purplegherkin@gmail.com) wrote:

> Thanks Clint, I opened the issue with a link to the gist. Appreciate the  
> help regardless!

> On Mar 2, 2011 11:43am, Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)\> wrote:
> 
> > On Wed, 2011-03-02 at 17:36 +0000, [purplegherkin@gmail.com](mailto:purplegherkin@gmail.com) wrote:
> > 
> > > Clint,
> > 
> > > 
> > 
> > > Well, interesting results. It definitely still occurs with the latest
> > 
> > > from source, BUT it doesn't happen every time I run the script
> > 
> > > (dropping the index in between runs, refreshing and waiting for green
> > 
> > > status), I can typically get 1 execution of the script to work from a
> > 
> > > fresh install, usually the 1st or 2nd try succeeds, then I get the
> > 
> > > error
> > 
> > matt - I'd open an issue on
> > 
> > [Issues · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues) with a recreation.
> > 
> > clint

---

<div class="post-metadata">

**Author:** ![Matt\_Paul\_2](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@Matt\_Paul\_2](https://discuss.elastic.co/u/Matt_Paul_2)\
**Post date:** [March 2, 2011, 10:29pm UTC](https://discuss.elastic.co/t/errors-on-bulk-delete-of-child/4016/12 "2011-03-02T22:29:19Z")

</div>

Just finished testing, works great, thanks!

On Mar 2, 2011 2:57pm, [purplegherkin@gmail.com](mailto:purplegherkin@gmail.com) wrote:

> Shay,

> I just saw the reply on the issue, I'll make the change to \_routing and  
> let you know

> Matt

> On Mar 2, 2011 2:00pm, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)\> wrote:
> 
> > Heya,
> > 
> > I think I know where the problem comes from. Basically, the delete API  
> > does not accept a parent parameter, just a routing parameter. So, the  
> > parent value should be set on the routing in case of delete. But, the  
> > delete API should support parent as well (which will simply automatically  
> > set the routing), here is the issue:  
> > [Delete API: Allow to set \_parent on it (will simply set the routing value) · Issue #742 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/742).
> > 
> > -shay.banon
> > 
> > On Wednesday, March 2, 2011 at 7:54 PM, [purplegherkin@gmail.com](mailto:purplegherkin@gmail.com) wrote:
> > 
> > Thanks Clint, I opened the issue with a link to the gist. Appreciate  
> > the help regardless!
> > 
> > On Mar 2, 2011 11:43am, Clinton Gormley [clinton@iannounce.co.uk](mailto:clinton@iannounce.co.uk)\> wrote:
> > 
> > > On Wed, 2011-03-02 at 17:36 +0000, [purplegherkin@gmail.com](mailto:purplegherkin@gmail.com) wrote:
> > > 
> > > > Clint,
> > > 
> > > > 
> > > 
> > > > Well, interesting results. It definitely still occurs with the  
> > > > latest
> > > 
> > > > from source, BUT it doesn't happen every time I run the script
> > > 
> > > > (dropping the index in between runs, refreshing and waiting for  
> > > > green
> > > 
> > > > status), I can typically get 1 execution of the script to work from  
> > > > a
> > > 
> > > > fresh install, usually the 1st or 2nd try succeeds, then I get the
> > > 
> > > > error
> > > 
> > > matt - I'd open an issue on
> > > 
> > > [Issues · elastic/elasticsearch · GitHub](http://github.com/elasticsearch/elasticsearch/issues) with a  
> > > recreation.
> > > 
> > > clint

---

<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:** [July 6, 2017, 4:10am UTC](https://discuss.elastic.co/t/errors-on-bulk-delete-of-child/4016/13 "2017-07-06T04:10:58Z")

</div>


