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

new version of fluentd does not auto load core libs -- fluent:latest #9

Closed
jescarri opened this issue Aug 29, 2016 · 4 comments
Closed

Comments

@jescarri
Copy link
Contributor

new version of fluentd does not auto load core libs, causing lib/fluent/plugin/systemd/pos_writer.rb to die with unexpected error error=uninitialized constant Fluent::Input

@jescarri
Copy link
Contributor Author

jescarri commented Aug 29, 2016

016-08-29 20:13:58 +0000 [error]: unexpected error error="uninitialized constant Fluent::Input"
  2016-08-29 20:13:58 +0000 [error]: /var/lib/gems/2.1.0/gems/fluent-plugin-systemd-0.0.3/lib/fluent/plugin/systemd/pos_writer.rb:2:in `<module:Fluent>'
  2016-08-29 20:13:58 +0000 [error]: /var/lib/gems/2.1.0/gems/fluent-plugin-systemd-0.0.3/lib/fluent/plugin/systemd/pos_writer.rb:1:in `<top (required)>'
  2016-08-29 20:13:58 +0000 [error]: /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `require'
  2016-08-29 20:13:58 +0000 [error]: /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
  2016-08-29 20:13:58 +0000 [error]: /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
  2016-08-29 20:13:58 +0000 [error]: /var/lib/gems/2.1.0/gems/fluent-plugin-systemd-0.0.3/lib/fluent/plugin/in_systemd.rb:2:in `<top (required)>'
  2016-08-29 20:13:58 +0000 [error]: /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  2016-08-29 20:13:58 +0000 [error]: /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  2016-08-29 20:13:58 +0000 [error]: /var/lib/gems/2.1.0/gems/fluentd-0.14.2/lib/fluent/registry.rb:94:in `block in search'
  2016-08-29 20:13:58 +0000 [error]: /var/lib/gems/2.1.0/gems/fluentd-0.14.2/lib/fluent/registry.rb:92:in `each'
  2016-08-29 20:13:58 +0000 [error]: /var/lib/gems/2.1.0/gems/fluentd-0.14.2/lib/fluent/registry.rb:92:in `search'
  2016-08-29 20:13:58 +0000 [error]: /var/lib/gems/2.1.0/gems/fluentd-0.14.2/lib/fluent/registry.rb:43:in `lookup'
  2016-08-29 20:13:58 +0000 [error]: /var/lib/gems/2.1.0/gems/fluentd-0.14.2/lib/fluent/plugin.rb:146:in `new_impl'
  2016-08-29 20:13:58 +0000 [error]: /var/lib/gems/2.1.0/gems/fluentd-0.14.2/lib/fluent/plugin.rb:100:in `new_input'
  2016-08-29 20:13:58 +0000 [error]: /var/lib/gems/2.1.0/gems/fluentd-0.14.2/lib/fluent/root_agent.rb:229:in `add_source'
  2016-08-29 20:13:58 +0000 [error]: /var/lib/gems/2.1.0/gems/fluentd-0.14.2/lib/fluent/root_agent.rb:95:in `block in configure'
  2016-08-29 20:13:58 +0000 [error]: /var/lib/gems/2.1.0/gems/fluentd-0.14.2/lib/fluent/root_agent.rb:92:in `each'
  2016-08-29 20:13:58 +0000 [error]: /var/lib/gems/2.1.0/gems/fluentd-0.14.2/lib/fluent/root_agent.rb:92:in `configure'
  2016-08-29 20:13:58 +0000 [error]: /var/lib/gems/2.1.0/gems/fluentd-0.14.2/lib/fluent/engine.rb:119:in `configure'
  2016-08-29 20:13:58 +0000 [error]: /var/lib/gems/2.1.0/gems/fluentd-0.14.2/lib/fluent/engine.rb:93:in `run_configure'
  2016-08-29 20:13:58 +0000 [error]: /var/lib/gems/2.1.0/gems/fluentd-0.14.2/lib/fluent/supervisor.rb:620:in `run_configure'
  2016-08-29 20:13:58 +0000 [error]: /var/lib/gems/2.1.0/gems/fluentd-0.14.2/lib/fluent/supervisor.rb:408:in `block in run_worker'
  2016-08-29 20:13:58 +0000 [error]: /var/lib/gems/2.1.0/gems/fluentd-0.14.2/lib/fluent/supervisor.rb:553:in `call'
  2016-08-29 20:13:58 +0000 [error]: /var/lib/gems/2.1.0/gems/fluentd-0.14.2/lib/fluent/supervisor.rb:553:in `main_process'
  2016-08-29 20:13:58 +0000 [error]: /var/lib/gems/2.1.0/gems/fluentd-0.14.2/lib/fluent/supervisor.rb:404:in `run_worker'
  2016-08-29 20:13:58 +0000 [error]: /var/lib/gems/2.1.0/gems/fluentd-0.14.2/lib/fluent/command/fluentd.rb:271:in `<top (required)>'
  2016-08-29 20:13:58 +0000 [error]: /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  2016-08-29 20:13:58 +0000 [error]: /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  2016-08-29 20:13:58 +0000 [error]: /var/lib/gems/2.1.0/gems/fluentd-0.14.2/bin/fluentd:5:in `<top (required)>'
  2016-08-29 20:13:58 +0000 [error]: /usr/local/bin/fluentd:23:in `load'
  2016-08-29 20:13:58 +0000 [error]: /usr/local/bin/fluentd:23:in `<main>'

@jescarri
Copy link
Contributor Author

jescarri commented Aug 29, 2016

PR #10

@jescarri
Copy link
Contributor Author

I was able to make it pass almost all the tests, however there is one that seems to not work properly.

  def test_reading_from_an_invalid_pos # rubocop:disable Metrics/AbcSize
    file = File.open(pos_path, "w+")
    file.print "thisisinvalid"
    file.close

    # It continues as if the pos file did not exist
    d = create_driver(head_config)
    d.run
    assert_equal 461, d.emits.size
    assert_match(
      /\[warn\]: Could not seek to cursor thisisinvalid found in pos file: #{pos_path}/,
      d.instance.log.out.logs.first,
    )
  end

In https://github.com/reevoo/fluent-plugin-systemd/blob/master/lib/fluent/plugin/in_systemd.rb#L43-L48

seems that the log buffer is not properly initialized, or there is another way to get it back from the DummyLog module, d.instance.log.out.logs.first

@jescarri jescarri changed the title new version of fluentd does not auto load core libs new version of fluentd does not auto load core libs -- fluent:latest Aug 30, 2016
@errm
Copy link
Collaborator

errm commented Aug 30, 2016

Thanks for your contribution.
I have released a new version of the plugin

@errm errm closed this as completed Aug 30, 2016
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

2 participants