Setting tag_key to a non-existing field causes a ruby error.#12
Open
nhosoi wants to merge 1 commit intodocebo:masterfrom
Open
Setting tag_key to a non-existing field causes a ruby error.#12nhosoi wants to merge 1 commit intodocebo:masterfrom
nhosoi wants to merge 1 commit intodocebo:masterfrom
Conversation
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.
|
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 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? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Steps:
0) Configure fluent-plugin-remote-syslog.
where "bogus" is not a field of log messages.
Result: Following error/stacktraces are logged.
error_class="NoMethodError" error="undefined method
[]' for nil:NilClass" [warn]: /etc/fluent/plugin/out_syslog_buffered.rb:106:insend_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:infeed_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:inwrite'[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:inpop'[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:inrun'Fix: Prepare "rescue" for the case the tag_key value is not a log field,
i.e., record[@tag_key] is nil.