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

fix to raise ConfigError for type missing, and its tests #1202

Merged
merged 2 commits into from
Sep 2, 2016

Conversation

tagomoris
Copy link
Member

Previously, it raises NeMethodError for nil.

2016-09-02 09:45:47 +0900 [error]: unexpected error error="undefined method `to_sym' for nil:NilClass\nDid you mean?  to_s"
  2016-09-02 09:45:47 +0900 [error]: /Users/tagomoris/github/fluentd/lib/fluent/registry.rb:39:in `lookup'
  2016-09-02 09:45:47 +0900 [error]: /Users/tagomoris/github/fluentd/lib/fluent/plugin.rb:146:in `new_impl'
  2016-09-02 09:45:47 +0900 [error]: /Users/tagomoris/github/fluentd/lib/fluent/plugin.rb:104:in `new_output'
  2016-09-02 09:45:47 +0900 [error]: /Users/tagomoris/github/fluentd/lib/fluent/agent.rb:133:in `add_match'
  2016-09-02 09:45:47 +0900 [error]: /Users/tagomoris/github/fluentd/lib/fluent/agent.rb:69:in `block in configure'
  2016-09-02 09:45:47 +0900 [error]: /Users/tagomoris/github/fluentd/lib/fluent/agent.rb:63:in `each'
  2016-09-02 09:45:47 +0900 [error]: /Users/tagomoris/github/fluentd/lib/fluent/agent.rb:63:in `configure'
  2016-09-02 09:45:47 +0900 [error]: /Users/tagomoris/github/fluentd/lib/fluent/root_agent.rb:86:in `configure'
  2016-09-02 09:45:47 +0900 [error]: /Users/tagomoris/github/fluentd/lib/fluent/engine.rb:119:in `configure'
  2016-09-02 09:45:47 +0900 [error]: /Users/tagomoris/github/fluentd/lib/fluent/engine.rb:93:in `run_configure'
  2016-09-02 09:45:47 +0900 [error]: /Users/tagomoris/github/fluentd/lib/fluent/supervisor.rb:673:in `run_configure'
  2016-09-02 09:45:47 +0900 [error]: /Users/tagomoris/github/fluentd/lib/fluent/supervisor.rb:435:in `block in run_worker'
  2016-09-02 09:45:47 +0900 [error]: /Users/tagomoris/github/fluentd/lib/fluent/supervisor.rb:606:in `main_process'
  2016-09-02 09:45:47 +0900 [error]: /Users/tagomoris/github/fluentd/lib/fluent/supervisor.rb:431:in `run_worker'
  2016-09-02 09:45:47 +0900 [error]: /Users/tagomoris/github/fluentd/lib/fluent/command/fluentd.rb:271:in `<top (required)>'
  2016-09-02 09:45:47 +0900 [error]: bin/fluentd:5:in `require'
  2016-09-02 09:45:47 +0900 [error]: bin/fluentd:5:in `<main>'

This fix makes the situation better.

2016-09-02 09:48:17 +0900 [error]: config error file="example/match_without_type.conf" error="Missing 'type' parameter on <match> directive"

fix #1201.

@@ -63,6 +63,7 @@ def configure(conf)
conf.elements('filter', 'match').each { |e|
pattern = e.arg.empty? ? '**' : e.arg
type = e['@type']
raise ConfigError, "Missing 'type' parameter on <#{e.name}> directive" unless type
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use @type, not type.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right... I copied it from other error.

@tagomoris tagomoris merged commit 81b4330 into master Sep 2, 2016
@tagomoris tagomoris deleted the raise-configuration-errors-for-missing-type branch September 2, 2016 04:46
repeatedly pushed a commit that referenced this pull request Sep 5, 2016
…issing-type

fix to raise ConfigError for type missing, and its tests
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

Successfully merging this pull request may close these issues.

Buffer match without type declaration fails with NIL reference
2 participants