Getting "Pipeline aborted due to error" in tutorial pipeline & 401 Error


(Tzur E) #1

Update at the next msg - found out it's receiving a msg of 401 error.
Hi,
I'm using the tutorial pipeline here and everything was okay, until I got to the part where I wanted to connect my pipeline to elastic search.
This is my pipeline yml -

input {
    beats {
        port => "5044"
    }
}
filter {
    grok {
        match => { "message" => "%{COMBINEDAPACHELOG}"}
    }
}
output {
    elasticsearch {
        hosts => [ "127.0.0.1:9200" ]
        user => logstash_u
        password => 123456
    }
}

When I write it to the console - everything works fine. I can see the correct output.
But when I'm trying to do it with Elasticsearch and Kibana, I keep getting this error:

[2018-01-11T17:23:14,390][ERROR][logstash.pipeline ] Pipeline aborted due to error {:pipeline_id=>"main", :exception=>#<TypeError: no implicit conversion of Fixnum into String>, :backtrace=>["org/jruby/ext/cgi/escape/CGIEscape.java:387:in escape'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.2-java/lib/logstash/outputs/elasticsearch/http_client_builder.rb:148:insetup_basic_auth'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.2-java/lib/logstash/outputs/elasticsearch/http_client_builder.rb:56:in build'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.2-java/lib/logstash/outputs/elasticsearch.rb:230:inbuild_client'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.0.2-java/lib/logstash/outputs/elasticsearch/common.rb:24:in register'", "/usr/share/logstash/logstash-core/lib/logstash/output_delegator_strategies/shared.rb:9:inregister'", "/usr/share/logstash/logstash-core/lib/logstash/output_delegator.rb:43:in register'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:343:inregister_plugin'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:354:in block in register_plugins'", "org/jruby/RubyArray.java:1734:ineach'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:354:in register_plugins'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:743:inmaybe_setup_out_plugins'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:364:in start_workers'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:288:inrun'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:248:in `block in start'"], :thread=>"#<Thread:0x39e9d596@/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:245 run>"}
[2018-01-11T17:23:14,403][ERROR][logstash.agent ] Failed to execute action {:id=>:main, :action_type=>LogStash::ConvergeResult::FailedAction, :message=>"Could not execute action: LogStash::PipelineAction::Create/pipeline_id:main, action_result: false", :backtrace=>nil}

I've marked the error.
I have no idea how to address this. Can anyone provide some assistance?
Thanks!


(Tzur E) #2

Update
I think It happens because I keep getting this error:

server {:message=>"Got response code '401' contacting Elasticsearch at URL 'http://localhost:9200/_xpack'", :class=>"LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError"}

Where is this coming from? I've installed X-pack and put the right user/pass


(Mark Walkom) #3

Check that the username and password using curl. Also check the Elasticsearch logs.


(Tzur E) #4

I've checked and it's ok.

But you made me look at it a bit more, then I found that logstash.yml uses different creds for the monitor and not the one that was defined in the pipeline.
So I've changed that and added:
xpack.monitoring.elasticsearch.username/password

And now everything works.
Thanks!


(system) #5

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