# Es\_rejected\_execution\_exception - what steps do I need to take?

**URL:** <https://discuss.elastic.co/t/es-rejected-execution-exception-what-steps-do-i-need-to-take/306836>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [June 10, 2022, 12:23am UTC](https://discuss.elastic.co/t/es-rejected-execution-exception-what-steps-do-i-need-to-take/306836 "2022-06-10T00:23:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![corndog](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/corndog/32/96803_2.png) [@corndog](https://discuss.elastic.co/u/corndog)\
**Post date:** [June 10, 2022, 12:23am UTC](https://discuss.elastic.co/t/es-rejected-execution-exception-what-steps-do-i-need-to-take/306836/1 "2022-06-10T00:23:17Z")

</div>

I am using Elasticsearch docker image 7.17.4.

I am on a 12 core machine using Python and the helpers.parallel\_bulk() function with the default thread count and queue size.

The error I get is

```bash
elasticsearch.ApiError: ApiError(429, 'es_rejected_execution_exception', 'rejected execution of coordinating operation [coordinating_and_primary_bytes=51058829, replica_bytes=0, all_bytes=51058829, coordinating_operation_bytes=18165106, max_coordinating_and_primary_bytes=53687091]')

```

What do I need to add to my Docker config, or change to not get this error?

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [June 10, 2022, 12:46am UTC](https://discuss.elastic.co/t/es-rejected-execution-exception-what-steps-do-i-need-to-take/306836/2 "2022-06-10T00:46:19Z")

</div>

Hi @corndog!

Read this [solution](https://chenriang.me/elasticsearch-bulk-insert-rejection.html).

---

<div class="post-metadata">

**Author:** ![corndog](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/corndog/32/96803_2.png) [@corndog](https://discuss.elastic.co/u/corndog)\
**Post date:** [June 10, 2022, 1:29am UTC](https://discuss.elastic.co/t/es-rejected-execution-exception-what-steps-do-i-need-to-take/306836/3 "2022-06-10T01:29:15Z")

</div>

Hey very cool that did it -  
In docker-compose I added these environment variables:

- "ES\_JAVA\_OPTS=-Xms2g -Xmx2g"

---

<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 8, 2022, 1:29am UTC](https://discuss.elastic.co/t/es-rejected-execution-exception-what-steps-do-i-need-to-take/306836/4 "2022-07-08T01:29:30Z")

</div>

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