Skip to content

regression on Manticore 0.8.0 due port being part of host #155

@kares

Description

@kares

... with Manticore 0.8.0 the following configuration started failing:

  hosts => ["localhost:9243"]
  ssl => true

with

Manticore::ClientProtocolException: URI does not specify a valid host name: https://localhost:9243:9200/
                        initialize at /opt/local/rvm/gems/jruby-9.2.20.0@ls/gems/manticore-0.8.0-java/lib/manticore/response.rb:36
                              call at /opt/local/rvm/gems/jruby-9.2.20.0@ls/gems/manticore-0.8.0-java/lib/manticore/response.rb:79
                         call_once at /opt/local/rvm/gems/jruby-9.2.20.0@ls/gems/manticore-0.8.0-java/lib/manticore/response.rb:274
                              code at /opt/local/rvm/gems/jruby-9.2.20.0@ls/gems/manticore-0.8.0-java/lib/manticore/response.rb:158

caused by:

 Java::OrgApacheHttpClient::ClientProtocolException:
   URI does not specify a valid host name: https://localhost:9243:9200/
   org.apache.http.impl.client.CloseableHttpClient.determineTarget(org/apache/http/impl/client/CloseableHttpClient.java:95)

While the issue seems to be caused by the Manticore 0.8 upgrade it's questionable whether host detection in the client/plugin is correct in this case. The 'normalized' options from Elasticsearch::Client (passed down to Manticore) end up as:

@options={:hosts=>[{:host=>"localhost:9243", :scheme=>"https", :protocol=>"https", :port=>9200}]

... clearly elasticsearch-transport filled in a default 9200 port assuming a raw host was specified and this ends up being passed down to the underlying HttpClient library built as scheme://host:port ...

This behavior is not new in elasticsearch gem (tested versions 7.17.0, 7.16, 7.15 and 7.14.1)


NOTE: a work-around is to change the original Logstash configuration to hosts => ["https://localhost:9243"] (no need for the ssl setting).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions