emsearcy / fluent-plugin-gelf

Buffered fluentd output plugin to GELF (Graylog2)
Apache License 2.0
33 stars 57 forks source link

fix emit transaction failed: error_class=NoMethodError for bytesize #30

Closed guangwenz closed 7 years ago

guangwenz commented 7 years ago

2017-01-11 14:48:37 -0800 [warn]: emit transaction failed: error_class=NameError error="undefined local variable or method bytesize' for #<Fluent::GELFOutput:0x002b23318f77d8>" tag="tw.onprem.prod2.app.pxy.server.ca_access" 2017-01-11 14:48:37 -0800 [warn]: /etc/td-agent/plugin/out_gelf.rb:60:inblock in format' 2017-01-11 14:48:37 -0800 [warn]: /etc/td-agent/plugin/out_gelf.rb:58:in each_pair' 2017-01-11 14:48:37 -0800 [warn]: /etc/td-agent/plugin/out_gelf.rb:58:informat' 2017-01-11 14:48:37 -0800 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.20/lib/fluent/output.rb:273:in block in format_stream' 2017-01-11 14:48:37 -0800 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.20/lib/fluent/event.rb:128:incall' 2017-01-11 14:48:37 -0800 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.20/lib/fluent/event.rb:128:in block in each' 2017-01-11 14:48:37 -0800 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.20/lib/fluent/event.rb:127:ineach' 2017-01-11 14:48:37 -0800 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.20/lib/fluent/event.rb:127:in each' 2017-01-11 14:48:37 -0800 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.20/lib/fluent/output.rb:272:informat_stream' 2017-01-11 14:48:37 -0800 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.20/lib/fluent/output.rb:258:in emit' 2017-01-11 14:48:37 -0800 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.20/lib/fluent/output.rb:32:innext' 2017-01-11 14:48:37 -0800 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.20/lib/fluent/plugin/out_copy.rb:74:in emit' 2017-01-11 14:48:37 -0800 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.20/lib/fluent/event_router.rb:88:inemit_stream' 2017-01-11 14:48:37 -0800 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.20/lib/fluent/plugin/in_tail.rb:248:in receive_lines' 2017-01-11 14:48:37 -0800 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.20/lib/fluent/plugin/in_tail.rb:343:incall' 2017-01-11 14:48:37 -0800 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.20/lib/fluent/plugin/in_tail.rb:343:in wrap_receive_lines' 2017-01-11 14:48:37 -0800 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.20/lib/fluent/plugin/in_tail.rb:536:incall' 2017-01-11 14:48:37 -0800 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.20/lib/fluent/plugin/in_tail.rb:536:in on_notify' 2017-01-11 14:48:37 -0800 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.20/lib/fluent/plugin/in_tail.rb:369:inon_notify' 2017-01-11 14:48:37 -0800 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.20/lib/fluent/plugin/in_tail.rb:470:in call' 2017-01-11 14:48:37 -0800 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.20/lib/fluent/plugin/in_tail.rb:470:inon_change' 2017-01-11 14:48:37 -0800 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/cool.io-1.4.2/lib/cool.io/loop.rb:88:in run_once' 2017-01-11 14:48:37 -0800 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/cool.io-1.4.2/lib/cool.io/loop.rb:88:inrun' 2017-01-11 14:48:37 -0800 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.20/lib/fluent/plugin/in_tail.rb:233:in `run'

repeatedly commented 7 years ago

@emsearcy How about this patch? Some users hit this bug.

repeatedly commented 7 years ago

See also: https://github.com/emsearcy/fluent-plugin-gelf/issues/27

gcs-github commented 7 years ago

I'm hitting this problem too and this patch is 👌 to me

repeatedly commented 7 years ago

@emsearcy ping? If you hard to take a time to maintain this plugin, how about adding one more active maintainer? Forking plugin, e.g. fluent-plugin-gelf-ex, is not good for users.

emsearcy commented 7 years ago

Sorry, I seem to have accidentally merged the truncate-strings branch from #26. That wasn't supposed to hit master until somebody else had tested it; I had just written some proof of concept code. Since there is no comment here about whether the "responds_to" fix actually does the same thing, I'm going to assume it is no different than backing out the earlier commit.

I've reverted it from master until the new feature for #26 can be written & tested.