Closed jdoss closed 3 years ago
Could you share your full configuration file ... I can't replicate this error.
I will see if it is still happening and get you a config file on Monday.
Thanks very much @jdoss ... sorry it took me so long to look at this ...
@errm This isn't happening anymore. Here are the versions we have installed now and it must have been something funky with an older version of Fluentd.
2018-02-09 22:54:36 +0000 [info]: gem 'fluent-plugin-elasticsearch' version '2.4.1'
2018-02-09 22:54:36 +0000 [info]: gem 'fluent-plugin-kafka' version '0.6.5'
2018-02-09 22:54:36 +0000 [info]: gem 'fluent-plugin-s3' version '1.1.0'
2018-02-09 22:54:36 +0000 [info]: gem 'fluent-plugin-secure-forward' version '0.4.5'
2018-02-09 22:54:36 +0000 [info]: gem 'fluent-plugin-systemd' version '0.3.1'
2018-02-09 22:54:36 +0000 [info]: gem 'fluent-plugin-td' version '1.0.0'
2018-02-09 22:54:36 +0000 [info]: gem 'fluent-plugin-td-monitoring' version '0.2.3'
2018-02-09 22:54:36 +0000 [info]: gem 'fluent-plugin-webhdfs' version '1.2.2'
2018-02-09 22:54:36 +0000 [info]: gem 'fluentd' version '1.0.2'
Thanks for the report @jdoss good to know...
This is happening on my end as well when shutting down fluentd.
As I understand the problematic line is that one: https://github.com/fluent-plugin-systemd/fluent-plugin-systemd/blob/master/lib/fluent/plugin/in_systemd.rb#L115 - router
becomes nil
on shutdown.
@adie could you confirm the fluent version you are using?
I use fluentd v1.5.2 and fluent-plugin-systemd v1.0.2
@errm excerpt from my td-agent.log:
...
2019-07-08 09:27:32 +0000 [info]: #0 shutting down filter plugin type=:grep plugin_id="object:bc8f40"
2019-07-08 09:27:32 +0000 [info]: #0 shutting down filter plugin type=:grep plugin_id="object:ce700c"
2019-07-08 09:27:37 +0000 [warn]: #0 event loop does NOT exit until hard timeout.
2019-07-08 09:27:37 +0000 [error]: #0 Exception emitting record: undefined method `emit' for nil:NilClass
2019-07-08 09:27:37 +0000 [error]: #0 Exception emitting record: undefined method `emit' for nil:NilClass
... (around 6500 of the same lines)
2019-07-08 09:27:38 +0000 [error]: #0 Exception emitting record: undefined method `emit' for nil:NilClass
2019-07-08 09:27:38 +0000 [warn]: #0 killing existing thread thread=#<Thread:0x0000000001a5c2c8@/my-project/vendor/bundle/ruby/2.5.0/gems/fluentd-1.5.2/lib/fluent/plugin_helper/thread.rb:70 sleep>
2019-07-08 09:27:38 +0000 [warn]: #0 thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::SystemdInput title=:event_loop thread=#<Thread:0x0000000001a5c2c8@/my-project/vendor/bundle/ruby/2.5.0/gems/fluentd-1.5.2/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil
2019-07-08 09:27:38 +0000 [info]: Worker 0 finished unexpectedly with status 0
2019-07-08 09:27:39 +0000 [info]: adding match ...
...
2019-07-08 09:27:39 +0000 [info]: #0 fluentd worker is now running worker=0
So while it does not seem to cause any issues, it spams the logs.
Thanks for the info @adie ... sorry it's taken a long time to look at this!
Having had a hard look at the code it is clear we are not handling shutdown at all cleanly... I am going to take a look at this over the next week or so!
I released a new version 1.0.4 with the fix for this issue!
We are seeing this error happen on start up when using fluentd 0.14.16 and fluent-plugin-systemd 0.3.1. From what I can tell systemd events are getting processed as expected.