# Error during reindexing via Elasticsearch input plugin

**URL:** <https://discuss.elastic.co/t/error-during-reindexing-via-elasticsearch-input-plugin/237940>\
**Category:** Logstash\
**Created:** [June 20, 2020, 10:02pm UTC](https://discuss.elastic.co/t/error-during-reindexing-via-elasticsearch-input-plugin/237940 "2020-06-20T22:02:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![magnalite](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnalite/32/69827_2.png) [@magnalite](https://discuss.elastic.co/u/magnalite)\
**Post date:** [June 20, 2020, 10:02pm UTC](https://discuss.elastic.co/t/error-during-reindexing-via-elasticsearch-input-plugin/237940/1 "2020-06-20T22:02:41Z")

</div>

I'm currently using the Elasticsearch input plugin to reindex an index via a Logstash (7.8.0) pipeline however I keep getting a random error which will stop the Logstash instance (and then get restarted, starting from the beginning again). The error is:

```auto
warning: thread "d1d9bd67d2f6b67650e4d28731599ca43bf2c429832ef20e110e54f795fc1185_slice_2" terminated with exception (report_on_exception is true):
Elasticsearch::Transport::Transport::Error: Cannot get new connection from pool.

perform_request at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/elasticsearch-transport-5.0.5/lib/elasticsearch/transport/transport/base.rb:254
perform_request at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/elasticsearch-transport-5.0.5/lib/elasticsearch/transport/transport/http/manticore.rb:67
perform_request at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/elasticsearch-transport-5.0.5/lib/elasticsearch/transport/client.rb:131
scroll at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/scroll.rb:61
scroll_request at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-elasticsearch-4.6.0/lib/logstash/inputs/elasticsearch.rb:317
process_next_scroll at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-elasticsearch-4.6.0/lib/logstash/inputs/elasticsearch.rb:285
do_run_slice at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-elasticsearch-4.6.0/lib/logstash/inputs/elasticsearch.rb:277
do_run at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-elasticsearch-4.6.0/lib/logstash/inputs/elasticsearch.rb:257

java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

```

There are multiple of these Logstash instances but only one seems to get hit with this error (but seems more susceptible to it from then on? weird). Is there a way I could increase how long it attempts to get a new connection from the pool?

Would increasing the scroll option help? (It's currently on 5m per batch of 10000 docs which seems ample as it should be indexing at 5000-10000 doc/s).

Furthermore none of my instances are currently cpu limited so I don't think it is related to pushing them too hard or anything like that. Any ideas would be appreciated.

**Edit: It looks like they were just running out of memory!**

---

<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 18, 2020, 10:02pm UTC](https://discuss.elastic.co/t/error-during-reindexing-via-elasticsearch-input-plugin/237940/2 "2020-07-18T22:02:51Z")

</div>

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