# Elasitcsearch-ruby raises "Cannot get new connection from pool" error

**URL:** https://discuss.elastic.co/t/elasitcsearch-ruby-raises-cannot-get-new-connection-from-pool-error/36252
**Category:** Elasticsearch
**Created:** [December 3, 2015, 7:49am UTC](https://discuss.elastic.co/t/elasitcsearch-ruby-raises-cannot-get-new-connection-from-pool-error/36252 "2015-12-03T07:49:12Z")
**Posts on this page:** 1
**Showing post:** 12

<div class="post-metadata">

### Author: ![tomwj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tomwj/32/10729_2.png) [@tomwj](https://discuss.elastic.co/u/tomwj)
#### Post date: [July 25, 2016, 10:02am UTC](https://discuss.elastic.co/t/elasitcsearch-ruby-raises-cannot-get-new-connection-from-pool-error/36252/12 "2016-07-25T10:02:28Z")

</div>

Hi,

I came across this trying to fix the same issue but in Logstash the fix was slightly different for me. I've added it to help anyone else who's struggling with the same problem.

```auto
:message=>"Cannot get new connection from pool.", :class=>"Elasticsearch::Transport::Transport::Error", :backtrace=>["/opt/logstash/vendor/bundle/jruby/1.9/gems/elasticsearch-transport-1.0.15/lib/elasticsearch/transport/transport/base.rb:193:in `perform_request'",

```

ElasticSearch would work for a bit but then stop ingesting data.

Failing configuration:

```auto
output {
  elasticsearch {
    hosts => ["https://search-*.us-east-1.es.amazonaws.com"]
    sniffing => true
    manage_template => false
    index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
    document_type => "%{[@metadata][type]}"
  }
}

```

Logstash tries to get a list of hosts from Elasticsearch but AWS's implementation has changed the format of the data returned. For more details on the specifics. [https://forums.aws.amazon.com/thread.jspa?threadID=222600](https://forums.aws.amazon.com/thread.jspa?threadID=222600)

Working configuration:

```auto
output
 {
  elasticsearch {
    hosts => ["https://search-*.us-east-1.es.amazonaws.com"]
    manage_template => false
    index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
    document_type => "%{[@metadata][type]}"
  }
}

```

tomwj

---

_[View the full topic](https://discuss.elastic.co/t/elasitcsearch-ruby-raises-cannot-get-new-connection-from-pool-error/36252)._
