# Bulk requests are retried indefinitely

**URL:** <https://discuss.elastic.co/t/bulk-requests-are-retried-indefinitely/242488>\
**Category:** Logstash\
**Created:** [July 24, 2020, 9:21am UTC](https://discuss.elastic.co/t/bulk-requests-are-retried-indefinitely/242488 "2020-07-24T09:21:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cjmarkham](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cjmarkham/32/72748_2.png) [@cjmarkham](https://discuss.elastic.co/u/cjmarkham)\
**Post date:** [July 24, 2020, 9:21am UTC](https://discuss.elastic.co/t/bulk-requests-are-retried-indefinitely/242488/1 "2020-07-24T09:21:55Z")

</div>

I have an issue where a bulk request fails from the ELS output plugin. After reading the docs, I saw that these requests are retried indefinitely. However, this blocks the whole pipeline so no new events are consumed.

I have a dead letter queue set up and enabled so I would like for these bulk fails (which return a 400) to drop the message in to the DLQ and continue with others, not block the whole pipeline.

Is there any way to do this? Any way to specify the max amount of retries?

The actual error is:

```
[ERROR][logstash.outputs.elasticsearch] Encountered a retryable error. Will Retry with exponential backoff {:code=>400, :url=>"http://localhost:9200/_bulk", :body=>"{\"error\":{\"root_cause\":[{\"type\":\"action_request_validation_exception\",\"reason\":\"Validation Failed: 1: no requests added;\"}],\"type\":\"action_request_validation_exception\",\"reason\":\"Validation Failed: 1: no requests added;\"},\"status\":400}"}
```

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 24, 2020, 4:57pm UTC](https://discuss.elastic.co/t/bulk-requests-are-retried-indefinitely/242488/2 "2020-07-24T16:57:28Z")

</div>

> [@cjmarkham](#):
>
> Is there any way to do this?

I do not think so. "HTTP requests to the bulk API are expected to return a 200 response code. All other response codes are retried indefinitely."

---

<div class="post-metadata">

**Author:** ![cjmarkham](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cjmarkham/32/72748_2.png) [@cjmarkham](https://discuss.elastic.co/u/cjmarkham)\
**Post date:** [July 24, 2020, 5:45pm UTC](https://discuss.elastic.co/t/bulk-requests-are-retried-indefinitely/242488/3 "2020-07-24T17:45:14Z")

</div>

But then the processing of other events is blocked until this one is dropped manually by restarting logstash. Surely there's a way to prevent this loop

---

<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 21, 2020, 5:45pm UTC](https://discuss.elastic.co/t/bulk-requests-are-retried-indefinitely/242488/4 "2020-08-21T17:45:17Z")

</div>

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