Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin fails to start with default hosts setting #155

Open
kares opened this issue Aug 12, 2021 · 0 comments
Open

plugin fails to start with default hosts setting #155

kares opened this issue Aug 12, 2021 · 0 comments

Comments

@kares
Copy link
Contributor

kares commented Aug 12, 2021

When hosts isn't specified (localhost:9200 is expected to be used) plugin fails to start properly:
(Elasticsearch::Transport::Transport::Error unable to retrieve an initial connection from the pool)

[2021-08-12T13:29:56,788][INFO ][logstash.javapipeline    ][main] Pipeline started {"pipeline.id"=>"main"}
[2021-08-12T13:29:56,869][INFO ][logstash.agent           ] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
[2021-08-12T13:29:56,947][ERROR][logstash.javapipeline    ][main][4e805afb4960a70553434dc5d7ffc52f8b2410239d6cfc4372f5a66ea701b94c] A plugin had an unrecoverable error. Will restart this plugin.
  Pipeline_id:main
  Plugin: <LogStash::Inputs::Elasticsearch index=>"kibana_sample_data_logs", password=><password>, id=>"4e805afb4960a70553434dc5d7ffc52f8b2410239d6cfc4372f5a66ea701b94c", size=>2, user=>"elastic", enable_metric=>true, codec=><LogStash::Codecs::JSON id=>"json_2ddd7d2d-4ec1-44fb-a9d8-359217280234", enable_metric=>true, charset=>"UTF-8">, query=>"{ \"sort\": [ \"_doc\" ] }", scroll=>"1m", docinfo=>false, docinfo_target=>"@metadata", docinfo_fields=>["_index", "_type", "_id"], connect_timeout_seconds=>10, request_timeout_seconds=>60, socket_timeout_seconds=>60, ssl=>false>
  Error: Cannot get new connection from pool.
  Exception: Elasticsearch::Transport::Transport::Error
  Stack: /home/kares/workspace/work/elastic/logstash-7.12.1/vendor/bundle/jruby/2.5.0/gems/elasticsearch-transport-5.0.5/lib/elasticsearch/transport/transport/base.rb:254:in `perform_request'
/home/kares/workspace/work/elastic/logstash-7.12.1/vendor/bundle/jruby/2.5.0/gems/elasticsearch-transport-5.0.5/lib/elasticsearch/transport/transport/http/manticore.rb:67:in `perform_request'
/home/kares/workspace/work/elastic/logstash-7.12.1/vendor/bundle/jruby/2.5.0/gems/elasticsearch-transport-5.0.5/lib/elasticsearch/transport/client.rb:131:in `perform_request'
/home/kares/workspace/work/elastic/logstash-7.12.1/vendor/bundle/jruby/2.5.0/gems/elasticsearch-api-5.0.5/lib/elasticsearch/api/actions/search.rb:183:in `search'
/home/kares/workspace/work/elastic/logstash-7.12.1/vendor/bundle/jruby/2.5.0/gems/logstash-input-elasticsearch-4.9.1/lib/logstash/inputs/elasticsearch.rb:349:in `search_request'
/home/kares/workspace/work/elastic/logstash-7.12.1/vendor/bundle/jruby/2.5.0/gems/logstash-input-elasticsearch-4.9.1/lib/logstash/inputs/elasticsearch.rb:272:in `do_run_slice'
/home/kares/workspace/work/elastic/logstash-7.12.1/vendor/bundle/jruby/2.5.0/gems/logstash-input-elasticsearch-4.9.1/lib/logstash/inputs/elasticsearch.rb:250:in `do_run'
/home/kares/workspace/work/elastic/logstash-7.12.1/vendor/bundle/jruby/2.5.0/gems/logstash-input-elasticsearch-4.9.1/lib/logstash/inputs/elasticsearch.rb:238:in `run'
/home/kares/workspace/work/elastic/logstash-7.12.1/logstash-core/lib/logstash/java_pipeline.rb:405:in `inputworker'
/home/kares/workspace/work/elastic/logstash-7.12.1/logstash-core/lib/logstash/java_pipeline.rb:396:in `block in start_input'

Sample reproducer (tested on LS 7.14.0 as well as older):
input { elasticsearch { index => 'kibana_sample_data_logs' size => 2 user => 'elastic' password => '...' } }

NOTE: adding hosts => 'localhost:9200' explicitly resolves the error.

Issue seems to relate to #133 (fixed a while back) - pool simply returns no connection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant