Skip to content

Conversation

nhosoi
Copy link

@nhosoi nhosoi commented Dec 6, 2017

Steps:
0) Configure fluent-plugin-remote-syslog.

  1. Set "tag_key bogus" in the fluent-plugin-remote-syslog config file,
    where "bogus" is not a field of log messages.
  2. Let fluentd process logs.

Result: Following error/stacktraces are logged.
error_class="NoMethodError" error="undefined method []' for nil:NilClass" [warn]: /etc/fluent/plugin/out_syslog_buffered.rb:106:in send_to_syslog'
[warn]: /etc/fluent/plugin/out_syslog_buffered.rb:85:in block in write' [warn]: /usr/share/gems/gems/fluentd/lib/fluent/plugin/buf_memory.rb:67:in feed_each'
[warn]: /usr/share/gems/gems/fluentd/lib/fluent/plugin/buf_memory.rb:67:in msgpack_each' [warn]: /etc/fluent/plugin/out_syslog_buffered.rb:84:in write'
[warn]: /usr/share/gems/gems/fluentd/lib/fluent/buffer.rb:354:in write_chunk' [warn]: /usr/share/gems/gems/fluentd/lib/fluent/buffer.rb:333:in pop'
[warn]: /usr/share/gems/gems/fluentd/lib/fluent/output.rb:342:in try_flush' [warn]: /usr/share/gems/gems/fluentd/lib/fluent/output.rb:149:in run'

Fix: Prepare "rescue" for the case the tag_key value is not a log field,
i.e., record[@tag_key] is nil.

Steps:
0) Configure fluent-plugin-remote-syslog.
1) Set "tag_key bogus" in the fluent-plugin-remote-syslog config file,
   where "bogus" is not a field of log messages.
2) Let fluentd process logs.

Result: Following error/stacktraces are logged.
 error_class="NoMethodError" error="undefined method `[]' for nil:NilClass"
 [warn]: /etc/fluent/plugin/out_syslog_buffered.rb:106:in `send_to_syslog'
 [warn]: /etc/fluent/plugin/out_syslog_buffered.rb:85:in `block in write'
 [warn]: /usr/share/gems/gems/fluentd/lib/fluent/plugin/buf_memory.rb:67:in `feed_each'
 [warn]: /usr/share/gems/gems/fluentd/lib/fluent/plugin/buf_memory.rb:67:in `msgpack_each'
 [warn]: /etc/fluent/plugin/out_syslog_buffered.rb:84:in `write'
 [warn]: /usr/share/gems/gems/fluentd/lib/fluent/buffer.rb:354:in `write_chunk'
 [warn]: /usr/share/gems/gems/fluentd/lib/fluent/buffer.rb:333:in `pop'
 [warn]: /usr/share/gems/gems/fluentd/lib/fluent/output.rb:342:in `try_flush'
 [warn]: /usr/share/gems/gems/fluentd/lib/fluent/output.rb:149:in `run'

Fix: Prepare "rescue" for the case the tag_key value is not a log field,
     i.e., record[@tag_key] is nil.
@richm
Copy link

richm commented Dec 7, 2017

I think the travis failure is because this plugin requires an old version of fluentd: https://github.com/docebo/fluent-plugin-remote-syslog/blob/master/fluent-plugin-remote-syslog.gemspec#L19

 gem.add_dependency "fluentd", "~> 0.10.45"

which requires an old version of msgpack - 0.5.x

which does not work with ruby 2.4

@docebo any chance to update this plugin to support fluentd 0.12, 0.14?

@mrodriguezio
Copy link

@richm @docebo same issue #13 :(

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants