cloudfoundry / fluent-plugin-syslog_rfc5424

MIT License
3 stars 17 forks source link

Socket error with UDP #4

Closed mmarsula closed 4 years ago

mmarsula commented 4 years ago

With UDP transport configured, messages are not forwarded to remote syslog. Getting error:

020-08-03 20:00:42 +0000 [warn]: #0 fluent/log.rb:348:warn: failed to flush the buffer. retry_time=0 next_retry_seconds=2020-08-03 20:00:43 +0000 chunk="5abfe94130be7be10a569edc29e82adb" error_class=Errno::EDESTADDRREQ error="Destination address required"

fluentd is running in a container based on CentOS with Ruby 2.6.5.

Configuration is

 <match abc>
  @type syslog_rfc5424
  host x.y.com
  port 514
  transport udp
  <buffer>
    @type file
    path /fluentd/log/syslog_rfc5424_buffers
  </buffer>
  <format>
    @type syslog_rfc5424
  </format>
</match>

When the configuration is changed to use transport tcp, it works fine. We've only seen the failure with UDP (we have not tested TLS yet).

Debug log

2020-08-03 20:00:42.398875210 +0000 fluent.debug: {"message":"RFC 5424 Message"}
2020-08-03 20:00:42.399002643 +0000 fluent.debug: {"message":"<14>1 2020-08-03T19:59:37.872030+00:00 - - - - - -"}
2020-08-03 20:00:42 +0000 [debug]: #0 fluent/log.rb:306:debug: taking back chunk for errors. chunk="5abfe94130be7be10a569edc29e82adb"
2020-08-03 20:00:42 +0000 [trace]: #0 fluent/log.rb:284:trace: taking back a chunk instance=47421148700900 chunk_id="5abfe94130be7be10a569edc29e82adb"
2020-08-03 20:00:42 +0000 [trace]: #0 fluent/log.rb:284:trace: chunk taken back instance=47421148700900 chunk_id="5abfe94130be7be10a569edc29e82adb" metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=nil, tag=nil, variables=nil, seq=0>
2020-08-03 20:00:42 +0000 [warn]: #0 fluent/log.rb:348:warn: failed to flush the buffer. retry_time=0 next_retry_seconds=2020-08-03 20:00:43 +0000 chunk="5abfe94130be7be10a569edc29e82adb" error_class=Errno::EDESTADDRREQ error="Destination address required"
  2020-08-03 20:00:42 +0000 [warn]: #0 plugin/output.rb:1189:rescue in try_flush: /usr/local/lib/ruby/2.6.0/socket.rb:456:in `__write_nonblock'
  2020-08-03 20:00:42 +0000 [warn]: #0 plugin/output.rb:1189:rescue in try_flush: /usr/local/lib/ruby/2.6.0/socket.rb:456:in `write_nonblock'
  2020-08-03 20:00:42 +0000 [warn]: #0 plugin/output.rb:1189:rescue in try_flush: /usr/local/lib/ruby/gems/2.6.0/gems/fluent-plugin-syslog_rfc5424-0.8.0/lib/fluent/plugin/out_syslog_rfc5424.rb:31:in `block in write'
  2020-08-03 20:00:42 +0000 [warn]: #0 plugin/output.rb:1189:rescue in try_flush: /usr/local/lib/ruby/gems/2.6.0/gems/fluentd-1.11.1/lib/fluent/event.rb:325:in `each'
  2020-08-03 20:00:42 +0000 [warn]: #0 plugin/output.rb:1189:rescue in try_flush: /usr/local/lib/ruby/gems/2.6.0/gems/fluentd-1.11.1/lib/fluent/event.rb:325:in `block in each'
  2020-08-03 20:00:42 +0000 [warn]: #0 plugin/output.rb:1189:rescue in try_flush: /usr/local/lib/ruby/gems/2.6.0/gems/fluentd-1.11.1/lib/fluent/plugin/buffer/file_chunk.rb:171:in `open'
  2020-08-03 20:00:42 +0000 [warn]: #0 plugin/output.rb:1189:rescue in try_flush: /usr/local/lib/ruby/gems/2.6.0/gems/fluentd-1.11.1/lib/fluent/event.rb:324:in `each'
  2020-08-03 20:00:42 +0000 [warn]: #0 plugin/output.rb:1189:rescue in try_flush: /usr/local/lib/ruby/gems/2.6.0/gems/fluent-plugin-syslog_rfc5424-0.8.0/lib/fluent/plugin/out_syslog_rfc5424.rb:29:in `write'
  2020-08-03 20:00:42 +0000 [warn]: #0 plugin/output.rb:1189:rescue in try_flush: /usr/local/lib/ruby/gems/2.6.0/gems/fluentd-1.11.1/lib/fluent/plugin/output.rb:1133:in `try_flush'
  2020-08-03 20:00:42 +0000 [warn]: #0 plugin/output.rb:1189:rescue in try_flush: /usr/local/lib/ruby/gems/2.6.0/gems/fluentd-1.11.1/lib/fluent/plugin/output.rb:1439:in `flush_thread_run'
  2020-08-03 20:00:42 +0000 [warn]: #0 plugin/output.rb:1189:rescue in try_flush: /usr/local/lib/ruby/gems/2.6.0/gems/fluentd-1.11.1/lib/fluent/plugin/output.rb:461:in `block (2 levels) in start'
  2020-08-03 20:00:42 +0000 [warn]: #0 plugin/output.rb:1189:rescue in try_flush: /usr/local/lib/ruby/gems/2.6.0/gems/fluentd-1.11.1/lib/fluent/plugin_helper/thread.rb:78:in `block in thread_create'
2020-08-03 20:00:42.399581406 +0000 fluent.debug: {"chunk":"5abfe94130be7be10a569edc29e82adb","message":"taking back chunk for errors. chunk=\"5abfe94130be7be10a569edc29e82adb\""}
2020-08-03 20:00:42.399660077 +0000 fluent.trace: {"instance":47421148700900,"chunk_id":"5abfe94130be7be10a569edc29e82adb","message":"taking back a chunk instance=47421148700900 chunk_id=\"5abfe94130be7be10a569edc29e82adb\""}
2020-08-03 20:00:42.399717372 +0000 fluent.trace: {"instance":47421148700900,"chunk_id":"5abfe94130be7be10a569edc29e82adb","metadata":"#<struct Fluent::Plugin::Buffer::Metadata timekey=nil, tag=nil, variables=nil, seq=0>","message":"chunk taken back instance=47421148700900 chunk_id=\"5abfe94130be7be10a569edc29e82adb\" metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=nil, tag=nil, variables=nil, seq=0>"}
2020-08-03 20:00:42.400180576 +0000 fluent.warn: {"retry_time":0,"next_retry_seconds":"2020-08-03 20:00:43 +0000","chunk":"5abfe94130be7be10a569edc29e82adb","error":"#<Errno::EDESTADDRREQ: Destination address required>","message":"failed to flush the buffer. retry_time=0 next_retry_seconds=2020-08-03 20:00:43 +0000 chunk=\"5abfe94130be7be10a569edc29e82adb\" error_class=Errno::EDESTADDRREQ error=\"Destination address required\""}
mmarsula commented 4 years ago

The issue was caused by a stale Gemfile.lock.