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

"fluent-plugin-config-format" can't handle some plugins in the markdown format #1584

Closed
nokute78 opened this issue May 27, 2017 · 2 comments
Closed

Comments

@nokute78
Copy link
Contributor

Check CONTRIBUTING guideline first and here is the list to help us investigate the problem.

  • fluentd or td-agent version.
    fluentd 0.14.16

  • Environment information, e.g. OS.
    CentOS 6.9
    ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]

  • Your configuration
    none.
    The issue is about "fluent-plugin-config-format"

  • Your problem explanation. If you have an error logs, write it together.

"fluent-plugin-config-format" doesn't work for some plugins. (e.g. out_null)
The issue is only happened when the format is markdown.

$ bundle exec bin/fluent-plugin-config-format output null
bundler: failed to load command: bin/fluent-plugin-config-format (bin/fluent-plugin-config-format)
NoMethodError: undefined method `trace' for nil:NilClass
Did you mean?  trace_var
               trap
  /home/taka/git/oss/fluentd/lib/fluent/command/plugin_config_formatter.rb:170:in `block in dump_section_markdown'
  /home/taka/git/oss/fluentd/lib/fluent/command/plugin_config_formatter.rb:166:in `each'
  /home/taka/git/oss/fluentd/lib/fluent/command/plugin_config_formatter.rb:166:in `dump_section_markdown'
  /home/taka/git/oss/fluentd/lib/fluent/command/plugin_config_formatter.rb:144:in `block in dump_markdown'
  /home/taka/git/oss/fluentd/lib/fluent/command/plugin_config_formatter.rb:141:in `each'
  /home/taka/git/oss/fluentd/lib/fluent/command/plugin_config_formatter.rb:141:in `dump_markdown'
  /home/taka/git/oss/fluentd/lib/fluent/command/plugin_config_formatter.rb:67:in `call'
  bin/fluent-plugin-config-format:5:in `<top (required)>'

'$log' seems not to be initialized.
The workaround is to comment out like this and the tool will work correctly.

$ git diff
diff --git a/lib/fluent/command/plugin_config_formatter.rb b/lib/fluent/command/plugin_config_formatter.rb
index c1b6621..e77bf85 100644
--- a/lib/fluent/command/plugin_config_formatter.rb
+++ b/lib/fluent/command/plugin_config_formatter.rb
@@ -167,7 +167,7 @@ class FluentPluginConfigFormatter
       required = sub_section.delete(:required)
       multi = sub_section.delete(:multi)
       alias_name = sub_section.delete(:alias)
-      $log.trace(name: section_name, required: required, multi: multi, alias_name: alias_name)
+#      $log.trace(name: section_name, required: required, multi: multi, alias_name: alias_name)
       sub_section.delete(:section)
       dumped << ERB.new(template_path("section.md.erb").read, nil, "-").result(binding)
     end
@repeatedly
Copy link
Member

Thanks for the report!
#1585 fixes it.

repeatedly added a commit that referenced this issue May 29, 2017
fluent-plugin-config-format: remove $log from markdown call path. fix #1584
@nokute78
Copy link
Contributor Author

Thanks!

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