# Delete document throws VersionConflictEngineException when using version\_type=external

**URL:** <https://discuss.elastic.co/t/delete-document-throws-versionconflictengineexception-when-using-version-type-external/8790>\
**Category:** Elasticsearch\
**Created:** [August 20, 2012, 2:56pm UTC](https://discuss.elastic.co/t/delete-document-throws-versionconflictengineexception-when-using-version-type-external/8790 "2012-08-20T14:56:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vlagorce](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vlagorce/32/2764_2.png) [@vlagorce](https://discuss.elastic.co/u/vlagorce)\
**Post date:** [August 20, 2012, 2:56pm UTC](https://discuss.elastic.co/t/delete-document-throws-versionconflictengineexception-when-using-version-type-external/8790/1 "2012-08-20T14:56:03Z")

</div>

Hello,

I try to use the versioning but I face a strange behaviour (strange to me).

I index one document id[1] version[1].

If I try to delete this document by giving the same Id and version I get a  
VersionConflictEngineException.

If I increase the version number the delete is executed.

===  
The exception is thrown by RobinEnging.class line 650 "if (currentVersion

> = delete.version())"

Why is it a problem to have the same version number ?

===  
As described in  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/index_.html)

> > Optionally, the version number can be supplemented with an external value  
> > (for example, if maintained in a database)  
> > It's my case. But this test implies to perform a save in my DB to increase  
> > the version number.

> > If no version is provided, then the operation is executed without any  
> > version.  
> > It might be a solution but the versioning test could be interesting in  
> > order to ensure that the user performing the delete use at least the last  
> > indexing document.

Regards,

--

---

<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, 3:15am UTC](https://discuss.elastic.co/t/delete-document-throws-versionconflictengineexception-when-using-version-type-external/8790/2 "2017-07-06T03:15:46Z")

</div>


