# Encountered an unexpected error submitting a bulk request! Will retry

**URL:** https://discuss.elastic.co/t/encountered-an-unexpected-error-submitting-a-bulk-request-will-retry/71642
**Category:** Logstash
**Created:** [January 15, 2017, 11:24am UTC](https://discuss.elastic.co/t/encountered-an-unexpected-error-submitting-a-bulk-request-will-retry/71642 "2017-01-15T11:24:51Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![nbari](https://avatars.discourse-cdn.com/v4/letter/n/e36b37/32.png) [@nbari](https://discuss.elastic.co/u/nbari)
#### Post date: [January 15, 2017, 11:24am UTC](https://discuss.elastic.co/t/encountered-an-unexpected-error-submitting-a-bulk-request-will-retry/71642/1 "2017-01-15T11:24:51Z")

</div>

I am installing/testing logstash 5.1.1 I am available to send the logs to elasticsearch this is my output:

```
output {
  elasticsearch {
    timeout => 30
    hosts => ["10.10.23.183"]
    index => "logstash-%{_idx_env_suffix}-%{_idx_type_suffix}-%{+YYYY.MM.dd}"
  }
}

```

But after couple of hours I start go get this error and therefore elasticsearch don't receive/show nothing:

`[2017-01-15T11:05:10,371][ERROR][logstash.outputs.elasticsearch] Encountered an unexpected error submitting a bulk request! Will retry. {:error_message=>"undefined method`response' for #LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError:0x543b5904", :class=\>"NoMethodError", :backtrace=\>["/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-5.4.0-java/lib/logstash/outputs/elasticsearch/common.rb:223:in `safe_bulk'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-5.4.0-java/lib/logstash/outputs/elasticsearch/common.rb:187:in`safe\_bulk'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-5.4.0-java/lib/logstash/outputs/elasticsearch/common.rb:109:in `submit'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-5.4.0-java/lib/logstash/outputs/elasticsearch/common.rb:76:in`retrying\_submit'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-5.4.0-java/lib/logstash/outputs/elasticsearch/common.rb:27:in `multi_receive'", "/usr/share/logstash/logstash-core/lib/logstash/output_delegator_strategies/shared.rb:12:in`multi\_receive'", "/usr/share/logstash/logstash-core/lib/logstash/output\_delegator.rb:42:in `multi_receive'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:331:in`output\_batch'", "org/jruby/RubyHash.java:1342:in `each'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:330:in`output\_batch'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:288:in `worker_loop'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:258:in`start\_workers'"]}`

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [January 15, 2017, 11:57pm UTC](https://discuss.elastic.co/t/encountered-an-unexpected-error-submitting-a-bulk-request-will-retry/71642/2 "2017-01-15T23:57:08Z")

</div>

Anything in ES logs?

---

<div class="post-metadata">

### Author: ![nbari](https://avatars.discourse-cdn.com/v4/letter/n/e36b37/32.png) [@nbari](https://discuss.elastic.co/u/nbari)
#### Post date: [January 17, 2017, 10:00am UTC](https://discuss.elastic.co/t/encountered-an-unexpected-error-submitting-a-bulk-request-will-retry/71642/3 "2017-01-17T10:00:17Z")

</div>

On Elasticsearch I just get multiple times this:

```
[2017-01-17T09:55:06,783][WARN][o.e.l.LicenseService] [testing.test]
#
# License [will expire] on [Thursday, January 19, 2017]. If you have a new license, please update it.
# Otherwise, please reach out to your support contact.
#
# Commercial plugins operate with reduced functionality on license expiration:
# - security
# - Cluster health, cluster stats and indices stats operations are blocked
# - All data operations (read and write) continue to work
# - watcher
# - PUT / GET watch APIs are disabled, DELETE watch API continues to work
# - Watches execute and write to the history
# - The actions of the watches don't execute
# - monitoring
# - The agent will stop collecting cluster and indices metrics
# - The agent will stop automatically cleaning indices older than [xpack.monitoring.history.duration]
# - graph
# - Graph explore APIs are disabled

```

But nothing relevant to the logstash error:

`[2017-01-17T09:59:36,187][ERROR][logstash.outputs.elasticsearch] Encountered an unexpected error submitting a bulk request! Will retry. {:error_message=>"undefined method`response' for #LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError:0x7d8581c0", :class=\>"NoMethodError", :backtrace=\>["/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-5.4.0-java/lib/logstash/outputs/elasticsearch/common.rb:223:in `safe_bulk'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-5.4.0-java/lib/logstash/outputs/elasticsearch/common.rb:187:in`safe\_bulk'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-5.4.0-java/lib/logstash/outputs/elasticsearch/common.rb:109:in `submit'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-5.4.0-java/lib/logstash/outputs/elasticsearch/common.rb:76:in`retrying\_submit'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-elasticsearch-5.4.0-java/lib/logstash/outputs/elasticsearch/common.rb:27:in `multi_receive'", "/usr/share/logstash/logstash-core/lib/logstash/output_delegator_strategies/shared.rb:12:in`multi\_receive'", "/usr/share/logstash/logstash-core/lib/logstash/output\_delegator.rb:42:in `multi_receive'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:331:in`output\_batch'", "org/jruby/RubyHash.java:1342:in `each'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:330:in`output\_batch'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:288:in `worker_loop'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:258:in`start\_workers'"]}`

---

<div class="post-metadata">

### Author: ![nbari](https://avatars.discourse-cdn.com/v4/letter/n/e36b37/32.png) [@nbari](https://discuss.elastic.co/u/nbari)
#### Post date: [January 17, 2017, 3:25pm UTC](https://discuss.elastic.co/t/encountered-an-unexpected-error-submitting-a-bulk-request-will-retry/71642/4 "2017-01-17T15:25:11Z")

</div>

Giving a try to this update:

`bin/logstash-plugin install --version "6.2.0" logstash-output-elasticsearch`

---

<div class="post-metadata">

### Author: ![nbari](https://avatars.discourse-cdn.com/v4/letter/n/e36b37/32.png) [@nbari](https://discuss.elastic.co/u/nbari)
#### Post date: [January 23, 2017, 9:19am UTC](https://discuss.elastic.co/t/encountered-an-unexpected-error-submitting-a-bulk-request-will-retry/71642/5 "2017-01-23T09:19:48Z")

</div>

Ended removing logstash in favor off using filebeat to write directly to elasticsearch.

---

<div class="post-metadata">

### Author: ![DeLoVaN](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/delovan/32/15074_2.png) [@DeLoVaN](https://discuss.elastic.co/u/DeLoVaN)
#### Post date: [January 31, 2017, 5:03pm UTC](https://discuss.elastic.co/t/encountered-an-unexpected-error-submitting-a-bulk-request-will-retry/71642/6 "2017-01-31T17:03:11Z")

</div>

Hi, I was having the same problem as you.  
I was parsing huge logs files (for a total of 150Go), and after 30 min, the process just stopped with the kind of errors you got.  
After a day of hard debugging, I concluded that the problem was with the plugin logstash-output-elasticsearch.  
The version bundle with logstash 5.1.2 is the version 5.4 of the plugin. Upgrade it to the last version (6.2.4 at the time I write this message), and the errors are gone, logstash continue to forward to elasticsearch.

To update your plugin, do the following (on Debian) :

```auto
sudo /usr/share/logstash/bin/logstash-plugin update logstash-output-elasticsearch

```

---

<div class="post-metadata">

### Author: ![DeLoVaN](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/delovan/32/15074_2.png) [@DeLoVaN](https://discuss.elastic.co/u/DeLoVaN)
#### Post date: [February 1, 2017, 2:06pm UTC](https://discuss.elastic.co/t/encountered-an-unexpected-error-submitting-a-bulk-request-will-retry/71642/7 "2017-02-01T14:06:02Z")

</div>

Today, the update to logstash 5.2 will automatically update the plugin to 6.2.4. Enjoy.

---

<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: [March 1, 2017, 2:06pm UTC](https://discuss.elastic.co/t/encountered-an-unexpected-error-submitting-a-bulk-request-will-retry/71642/8 "2017-03-01T14:06:16Z")

</div>

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