Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It turns out that interval parameter is mandatory #10

Open
b-a-t opened this issue Oct 29, 2023 · 0 comments
Open

It turns out that interval parameter is mandatory #10

b-a-t opened this issue Oct 29, 2023 · 0 comments

Comments

@b-a-t
Copy link

b-a-t commented Oct 29, 2023

I was trying to use a sample configuration from the README on a newer fluentd v5 aka fluentd-1.16.2 with the config:

  <worker 0>
    <source>
      @type utmpx
      tag "wtmp"
      pos_file "/var/lib/fluent/wtmp.pos"
      path "/var/log/wtmp"
    </source>
  </worker>

and got a stack trace in the log:

2023-10-29 01:21:07 +0000 [info]: #0 adding source type="utmpx"
2023-10-29 01:21:17 +0000 [warn]: #0 emit transaction failed: error_class=ArgumentError error="time must be a Fluent::EventTime (or Integer): Time" location="/opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/plugin/output.rb:914:in `metadata'" tag="wtmp"
  2023-10-29 01:21:17 +0000 [warn]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/plugin/output.rb:914:in `metadata'
  2023-10-29 01:21:17 +0000 [warn]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/plugin/output.rb:1042:in `block in handle_stream_with_custom_format'
  2023-10-29 01:21:17 +0000 [warn]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/event.rb:196:in `block in each'
  2023-10-29 01:21:17 +0000 [warn]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/event.rb:195:in `each'
  2023-10-29 01:21:17 +0000 [warn]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/event.rb:195:in `each'
  2023-10-29 01:21:17 +0000 [warn]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/plugin/output.rb:1041:in `handle_stream_with_custom_format'
  2023-10-29 01:21:17 +0000 [warn]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/plugin/output.rb:969:in `execute_chunking'
  2023-10-29 01:21:17 +0000 [warn]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/plugin/output.rb:897:in `emit_buffered'
  2023-10-29 01:21:17 +0000 [warn]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/event_router.rb:115:in `emit_stream'
  2023-10-29 01:21:17 +0000 [warn]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluent-plugin-utmpx-0.5.0/lib/fluent/plugin/in_utmpx.rb:100:in `block in refresh_watchers'
  2023-10-29 01:21:17 +0000 [warn]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluent-plugin-utmpx-0.5.0/lib/fluent/plugin/in_utmpx.rb:93:in `open'
  2023-10-29 01:21:17 +0000 [warn]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluent-plugin-utmpx-0.5.0/lib/fluent/plugin/in_utmpx.rb:93:in `refresh_watchers'
  2023-10-29 01:21:17 +0000 [warn]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/plugin_helper/timer.rb:80:in `on_timer'
  2023-10-29 01:21:17 +0000 [warn]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/cool.io-1.7.1/lib/cool.io/loop.rb:88:in `run_once'
  2023-10-29 01:21:17 +0000 [warn]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/cool.io-1.7.1/lib/cool.io/loop.rb:88:in `run'
  2023-10-29 01:21:17 +0000 [warn]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/plugin_helper/event_loop.rb:93:in `block in start'
  2023-10-29 01:21:17 +0000 [warn]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/plugin_helper/thread.rb:78:in `block in thread_create'
2023-10-29 01:21:17 +0000 [error]: #0 Unexpected error raised. Stopping the timer. title=:execute_utmpx error_class=ArgumentError error="time must be a Fluent::EventTime (or Integer): Time"
  2023-10-29 01:21:17 +0000 [error]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/plugin/output.rb:914:in `metadata'
  2023-10-29 01:21:17 +0000 [error]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/plugin/output.rb:1042:in `block in handle_stream_with_custom_format'
  2023-10-29 01:21:17 +0000 [error]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/event.rb:196:in `block in each'
  2023-10-29 01:21:17 +0000 [error]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/event.rb:195:in `each'
  2023-10-29 01:21:17 +0000 [error]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/event.rb:195:in `each'
  2023-10-29 01:21:17 +0000 [error]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/plugin/output.rb:1041:in `handle_stream_with_custom_format'
  2023-10-29 01:21:17 +0000 [error]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/plugin/output.rb:969:in `execute_chunking'
  2023-10-29 01:21:17 +0000 [error]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/plugin/output.rb:897:in `emit_buffered'
  2023-10-29 01:21:17 +0000 [error]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/event_router.rb:115:in `emit_stream'
  2023-10-29 01:21:17 +0000 [error]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluent-plugin-utmpx-0.5.0/lib/fluent/plugin/in_utmpx.rb:100:in `block in refresh_watchers'
  2023-10-29 01:21:17 +0000 [error]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluent-plugin-utmpx-0.5.0/lib/fluent/plugin/in_utmpx.rb:93:in `open'
  2023-10-29 01:21:17 +0000 [error]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluent-plugin-utmpx-0.5.0/lib/fluent/plugin/in_utmpx.rb:93:in `refresh_watchers'
  2023-10-29 01:21:17 +0000 [error]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/plugin_helper/timer.rb:80:in `on_timer'
  2023-10-29 01:21:17 +0000 [error]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/cool.io-1.7.1/lib/cool.io/loop.rb:88:in `run_once'
  2023-10-29 01:21:17 +0000 [error]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/cool.io-1.7.1/lib/cool.io/loop.rb:88:in `run'
  2023-10-29 01:21:17 +0000 [error]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/plugin_helper/event_loop.rb:93:in `block in start'
  2023-10-29 01:21:17 +0000 [error]: #0 /opt/fluent/lib/ruby/gems/3.2.0/gems/fluentd-1.16.2/lib/fluent/plugin_helper/thread.rb:78:in `block in thread_create'
2023-10-29 01:21:17 +0000 [error]: #0 Timer detached. title=:execute_utmpx

After adding option interval 10 to the source configuration and restarting the fluentd, the error has gone.

Interestingly enough, removing the option and restarting the service didn't bring the stack trace back.

It turned out that the issue is also connected with the presence of the file from the pos_file - if it already exists and contains valid information the error doesn't pop up. But if that file doesn't (yet) exist - I get the stack trace from the above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant