# Error on parallel index calls with the same id "Unable to save document"

**URL:** <https://discuss.elastic.co/t/error-on-parallel-index-calls-with-the-same-id-unable-to-save-document/221826>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [March 3, 2020, 7:52am UTC](https://discuss.elastic.co/t/error-on-parallel-index-calls-with-the-same-id-unable-to-save-document/221826 "2020-03-03T07:52:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexp0205](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexp0205/32/14855_2.png) [@alexp0205](https://discuss.elastic.co/u/alexp0205)\
**Post date:** [March 3, 2020, 7:52am UTC](https://discuss.elastic.co/t/error-on-parallel-index-calls-with-the-same-id-unable-to-save-document/221826/1 "2020-03-03T07:52:41Z")

</div>

URL - `/api/as/v1/engines/{engine-name}/documents`  
Method - POST  
Client - elastic-app-search==7.6.0 (Python)

I am making 4 index document calls with the same document body (with id). On these first 2-3 calls are failing and the final 1-2 succeeds.  
In case of failure, the API returns 200 response, but the response body is

```auto
[
  {
    "id": "144",
    "errors": [
      "Unable to save document"
    ]
  }
]

```

Why could this be happening?

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [March 12, 2020, 11:50am UTC](https://discuss.elastic.co/t/error-on-parallel-index-calls-with-the-same-id-unable-to-save-document/221826/2 "2020-03-12T11:50:47Z")

</div>

How often does this happen? Does this happen consistently?

Do all of these documents have the same id? Are you actually able to save multiple documents with the same id? Those **should** be unique.

---

<div class="post-metadata">

**Author:** ![alexp0205](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexp0205/32/14855_2.png) [@alexp0205](https://discuss.elastic.co/u/alexp0205)\
**Post date:** [March 13, 2020, 6:56am UTC](https://discuss.elastic.co/t/error-on-parallel-index-calls-with-the-same-id-unable-to-save-document/221826/3 "2020-03-13T06:56:02Z")

</div>

It was failing consistently that day, but it stopped happening now. I had then created a support ticket too with more details like engine-name, url etc.

All documents had the same id and the documents to were the same (except for a time field which had the time of call).

I will reply on this thread if I see those error again.

---

<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 10, 2020, 6:56am UTC](https://discuss.elastic.co/t/error-on-parallel-index-calls-with-the-same-id-unable-to-save-document/221826/4 "2020-04-10T06:56:08Z")

</div>

Closed on April 10, 2020, 6:56am UTC

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