# Post data to elasticsearch sometimes throws error 429

**URL:** <https://discuss.elastic.co/t/post-data-to-elasticsearch-sometimes-throws-error-429/339345>\
**Category:** Elasticsearch\
**Created:** [July 26, 2023, 7:21pm UTC](https://discuss.elastic.co/t/post-data-to-elasticsearch-sometimes-throws-error-429/339345 "2023-07-26T19:21:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![111407](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111407/32/78114_2.png) [@111407](https://discuss.elastic.co/u/111407)\
**Post date:** [July 26, 2023, 7:21pm UTC](https://discuss.elastic.co/t/post-data-to-elasticsearch-sometimes-throws-error-429/339345/1 "2023-07-26T19:21:21Z")

</div>

command:  
`curl -u username:pw -X POST 'http://sd-4531-6c55:9200/testindex/_doc' -H 'Content-type: application/json' -d '{"test":11234}'`

response:  
`{"error":{"root_cause":[{"type":"remote_transport_exception","reason":"[sd-15ef-0be6.mydomain][10.105.125.237:9300][indices:data/write/bulk[s]]"}],"type":"es_rejected_execution_exception","reason":"rejected execution of processing of [387323569][indices:data/write/bulk[s][p]]: request: BulkShardRequest [[testindex][3]] containing [index {[testindex][_doc][OHiYk4kB4MkhK63VlcX5], source[{\"test\":11234}]}], target allocation id: q6QnwDtHR6WyA6nWP24cmg, primary term: 1 on EsThreadPoolExecutor[name = sd-15ef-0be6.mydomain/write, queue capacity = 200, org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor@17c39c90[Running, pool size = 2, active threads = 2, queued tasks = 200, completed tasks = 161898316]]"},"status":429}`

elasticsearch.yml:

```auto
cluster.name: ELK_SIT
path.data: /opt/gicapods/elasticdata
network.host: ${HOSTNAME}
discovery.zen.ping.unicast.hosts: sd-4531-6c55,sd-15ef-0be6
node.name: ${HOSTNAME}
http.port: 9200
discovery.zen.minimum_master_nodes: 2
xpack.security.transport.ssl.enabled: true
xpack.security.enabled: true
bootstrap.system_call_filter: false
xpack.ssl.cipher_suites: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256

xpack.security.transport.ssl.verification_mode: none
xpack.security.transport.ssl.keystore.path: certs/elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: certs/elastic-certificates.p12

```

Logfiles of both nodes have no related entries.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 26, 2023, 7:37pm UTC](https://discuss.elastic.co/t/post-data-to-elasticsearch-sometimes-throws-error-429/339345/2 "2023-07-26T19:37:00Z")

</div>

Sounds like you are sending more bulk requests than what your cluster can deal with.

You should catch this error and slow down a bit the injection. Or modify your cluster (add more nodes) or send bulk requests to other nodes...

My 2 cents

---

<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:** [August 23, 2023, 7:37pm UTC](https://discuss.elastic.co/t/post-data-to-elasticsearch-sometimes-throws-error-429/339345/3 "2023-08-23T19:37:34Z")

</div>

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