Open openface opened 4 years ago
Using udp transport, I've narrowed down the issue to the following:
The UDPSocket is created here: https://github.com/cloudfoundry/fluent-plugin-syslog_rfc5424/blob/main/lib/fluent/plugin/out_syslog_rfc5424.rb#L53
@sockets[socket_key(transport, host, port)] = socket_create(transport.to_sym, host, port, socket_options)
This passes in socket_options which return {}.
socket_options
{}
https://github.com/cloudfoundry/fluent-plugin-syslog_rfc5424/blob/main/lib/fluent/plugin/out_syslog_rfc5424.rb#L57
But in order for this to work with UDPSocket, we have to explicitly tell fluent'd helper socket_create to pass connect: true as an option.
socket_create
connect: true
https://github.com/fluent/fluentd/blob/master/lib/fluent/plugin_helper/socket.rb#L81
Notice that connect argument defaults to false.
connect
So this results in the following error:
2020-08-19 19:40:03 +0000 [warn]: #0 fluent/log.rb:348:warn: failed to flush the buffer. retry_time=0 next_retry_seconds=2020-08-19 19:40:04 +0000 chunk="5ad402ade8c90acdc250f30fc886a360" error_class=Errno::EDESTADDRREQ error="Destination address required"
Because the socket is not connected.
Changing the socket_options method to pass connect: true when @transport == 'udp' fixes this.
@transport == 'udp'
def socket_options if @transport == 'udp' { connect: true } elsif @transport == 'tls' # TODO: make timeouts configurable { insecure: @insecure, verify_fqdn: !@insecure, cert_paths: @trusted_ca_path } #, connect_timeout: 1, send_timeout: 1, recv_timeout: 1, linger_timeout: 1 } else {} end end
can someone make a new release with this fix?
Is this project abandoned? the last release was in Dec 26, 2019.
Can anyone recommend a workaround?
Using udp transport, I've narrowed down the issue to the following:
The UDPSocket is created here: https://github.com/cloudfoundry/fluent-plugin-syslog_rfc5424/blob/main/lib/fluent/plugin/out_syslog_rfc5424.rb#L53
This passes in
socket_options
which return{}
.https://github.com/cloudfoundry/fluent-plugin-syslog_rfc5424/blob/main/lib/fluent/plugin/out_syslog_rfc5424.rb#L57
But in order for this to work with UDPSocket, we have to explicitly tell fluent'd helper
socket_create
to passconnect: true
as an option.https://github.com/fluent/fluentd/blob/master/lib/fluent/plugin_helper/socket.rb#L81
Notice that
connect
argument defaults to false.So this results in the following error:
Because the socket is not connected.
Changing the socket_options method to pass
connect: true
when@transport == 'udp'
fixes this.