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

Fluentd v0.14.9: json parser plugin occurs undefined method `info' error #1343

Closed
mia-0032 opened this issue Dec 1, 2016 · 3 comments
Closed

Comments

@mia-0032
Copy link

mia-0032 commented Dec 1, 2016

Hi,

I'm testing to use Fluentd v0.14.9 without oj gem. But json parser plugin occurs undefined method `info' error.

  • fluentd or td-agent version.

Fluentd v0.14.9 and master branch version(without oj gem)

  • Environment information, e.g. OS.

OSX and Linux(TravisCI)

  • Your configuration

I encounterd this error on TravisCI https://travis-ci.org/mia-0032/fluent-plugin-gcloud-pubsub-custom/jobs/180170659 .

And I checked creating simple plugin.

require 'fluent/input'
require 'fluent/parser'

module Fluent
  class TestInput < Input
    Fluent::Plugin.register_input('test', self)
    config_param :format, :string,  default: 'json'

    def configure(conf)
      super
      @parser = Plugin.new_parser(@format)
      @parser.configure(conf)
    end
  end
end

fluent.conf is below:

<source>
  @type test
</source>
  • Your problem explanation. If you have an error logs, write it together.
2016-12-01 17:30:32 +0900 [error]: unexpected error error="undefined method `info' for nil:NilClass"
  2016-12-01 17:30:32 +0900 [error]: /path/to/fluentd/lib/fluent/plugin/parser_json.rb:56:in `rescue in configure_json_parser'
  2016-12-01 17:30:32 +0900 [error]: /path/to/fluentd/lib/fluent/plugin/parser_json.rb:44:in `configure_json_parser'
  2016-12-01 17:30:32 +0900 [error]: /path/to/fluentd/lib/fluent/plugin/parser_json.rb:40:in `configure'
  2016-12-01 17:30:32 +0900 [error]: /path/to/fluentd/lib/fluent/plugin/in_test.rb:12:in `configure'
  2016-12-01 17:30:32 +0900 [error]: /path/to/fluentd/lib/fluent/root_agent.rb:237:in `add_source'
  2016-12-01 17:30:32 +0900 [error]: /path/to/fluentd/lib/fluent/root_agent.rb:95:in `block in configure'
  2016-12-01 17:30:32 +0900 [error]: /path/to/fluentd/lib/fluent/root_agent.rb:92:in `each'
  2016-12-01 17:30:32 +0900 [error]: /path/to/fluentd/lib/fluent/root_agent.rb:92:in `configure'
  2016-12-01 17:30:32 +0900 [error]: /path/to/fluentd/lib/fluent/engine.rb:119:in `configure'
  2016-12-01 17:30:32 +0900 [error]: /path/to/fluentd/lib/fluent/engine.rb:93:in `run_configure'
  2016-12-01 17:30:32 +0900 [error]: /path/to/fluentd/lib/fluent/supervisor.rb:693:in `run_configure'
  2016-12-01 17:30:32 +0900 [error]: /path/to/fluentd/lib/fluent/supervisor.rb:453:in `block in run_worker'
  2016-12-01 17:30:32 +0900 [error]: /path/to/fluentd/lib/fluent/supervisor.rb:626:in `main_process'
  2016-12-01 17:30:32 +0900 [error]: /path/to/fluentd/lib/fluent/supervisor.rb:449:in `run_worker'
  2016-12-01 17:30:32 +0900 [error]: /path/to/fluentd/lib/fluent/command/fluentd.rb:288:in `<top (required)>'
  2016-12-01 17:30:32 +0900 [error]: /path/to/fluentd/bin/fluentd:5:in `require'
  2016-12-01 17:30:32 +0900 [error]: /path/to/fluentd/bin/fluentd:5:in `<top (required)>'
  2016-12-01 17:30:32 +0900 [error]: /path/to/fluentd/vendor/bundle/ruby/2.3.0/bin/fluentd:23:in `load'
  2016-12-01 17:30:32 +0900 [error]: /path/to/fluentd/vendor/bundle/ruby/2.3.0/bin/fluentd:23:in `<main>'
2016-12-01 17:30:32 +0900 [info]: Worker 0 finished unexpectedly with status 1

Thanks.

@repeatedly
Copy link
Member

repeatedly commented Dec 1, 2016

In v0.12, log should not be used in parser plugin.
I will fix it soon.

@repeatedly
Copy link
Member

BTW, you can avoid this problem by specifying "json_parser json".

repeatedly added a commit that referenced this issue Dec 2, 2016
…lugin

Don't access log in v0.12 plugin with old parser factory mechanizm. fix #1343
@mia-0032
Copy link
Author

mia-0032 commented Dec 2, 2016

Thank you for your response!

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