Open lenisko opened 4 years ago
The plugin seems to not be able to decode certain character sets on IRC. Ill see if I can get a PR to fix this soon.
This error is triggered because somewhere in the Logstash process, the program is trying to call the method force_encoding on an object that is nil. In Ruby, you can't call methods that are intended for a string on a nil value.
Looking at the stack trace, it appears that this error is originating from the IRC input plugin for Logstash. When the decode method is called in the plain codec, it appears to be passing a nil value, leading to the error.
Nice to see some attention on 3-year-old issue ;-) thanks for great go through and good luck!
output { elasticsearch { hosts => "localhost" index => "logstash-irc-%{+YYYY.MM.dd}" } }
Dec 21 04:27:01 saya logstash[26428]: [2019-12-21T04:27:01,808][ERROR][logstash.javapipeline ][main] A plugin had an unrecoverable error. Will restart this plugin. Dec 21 04:27:01 saya logstash[26428]: Pipeline_id:main Dec 21 04:27:01 saya logstash[26428]: Plugin: <LogStash::Inputs::Irc nick=>"xxx", channels=>["#xxx", "#xxx"], port=>6697, host=>"irc.pirc.pl", real=>"xxx", id=>"xxx", secure=>true, catch_all=>true, user=>"xxx", get_stats=>true, enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"xxx", enable_metric=>true, charset=>"UTF-8">, stats_interval=>5> Dec 21 04:27:01 saya logstash[26428]: Error: undefined method
force_encoding' for nil:NilClass Dec 21 04:27:01 saya logstash[26428]: Exception: NoMethodError Dec 21 04:27:01 saya logstash[26428]: Stack: /usr/share/logstash/logstash-core/lib/logstash/util/charset.rb:13:in
convert' Dec 21 04:27:01 saya logstash[26428]: /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-codec-plain-3.0.6/lib/logstash/codecs/plain.rb:35:indecode' Dec 21 04:27:01 saya logstash[26428]: /usr/share/logstash/logstash-core/lib/logstash/codecs/delegator.rb:45:in
block in decode' Dec 21 04:27:01 saya logstash[26428]: org/logstash/instrument/metrics/AbstractSimpleMetricExt.java:45:intime' Dec 21 04:27:01 saya logstash[26428]: org/logstash/instrument/metrics/AbstractNamespacedMetricExt.java:44:in
time' Dec 21 04:27:01 saya logstash[26428]: /usr/share/logstash/logstash-core/lib/logstash/codecs/delegator.rb:44:indecode' Dec 21 04:27:01 saya logstash[26428]: /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-irc-3.0.7/lib/logstash/inputs/irc.rb:146:in
handle_response' Dec 21 04:27:01 saya logstash[26428]: /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-irc-3.0.7/lib/logstash/inputs/irc.rb:117:inrun' Dec 21 04:27:01 saya logstash[26428]: /usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:322:in
inputworker' Dec 21 04:27:01 saya logstash[26428]: /usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:314:in `block in start_input'