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

Add placeholder validation target to error message #1497

Merged

Conversation

joker1007
Copy link
Contributor

In some case, placeholder_validate! checks composited value.
For example, fluent-plugins-nursery/fluent-plugin-bigquery#115.

this patch enable user to can find wrong config easily by error message even if In the case.

Output Example

% be fluentd -c fluent.conf -v
2017-03-10 23:04:32 +0900 [info]: fluent/supervisor.rb:696:read_config: reading config file path="fluent.conf"
2017-03-10 23:04:32 +0900 [info]: fluent/supervisor.rb:537:supervise: starting fluentd-0.14.13 pid=26713
2017-03-10 23:04:32 +0900 [info]: fluent/supervisor.rb:546:supervise: spawn command to main:  cmdline=["/home/joker/.rbenv/versions/2.3.3/bin/ruby", "-Eascii-8bit:ascii-8bit", "-rbundler/setup", "/home/joker/fluentd_workspace/.bundle/ruby/2.3.0/bin/fluentd", "-c", "fluent.conf", "-v", "--under-supervisor"]
2017-03-10 23:04:32 +0900 [info]: fluent/engine.rb:114:block in configure: gem 'fluentd' version '0.14.13'
2017-03-10 23:04:32 +0900 [info]: fluent/engine.rb:114:block in configure: gem 'fluent-mixin-config-placeholders' version '0.4.0'
2017-03-10 23:04:32 +0900 [info]: fluent/engine.rb:114:block in configure: gem 'fluent-mixin-plaintextformatter' version '0.2.6'
2017-03-10 23:04:32 +0900 [info]: fluent/engine.rb:114:block in configure: gem 'fluent-mixin-rewrite-tag-name' version '0.1.0'
2017-03-10 23:04:32 +0900 [info]: fluent/engine.rb:114:block in configure: gem 'fluent-plugin-bigquery' version '0.5.0.beta'
2017-03-10 23:04:32 +0900 [info]: fluent/engine.rb:114:block in configure: gem 'fluent-plugin-record-modifier' version '0.5.0'
2017-03-10 23:04:32 +0900 [info]: fluent/engine.rb:114:block in configure: gem 'fluent-plugin-remote_syslog' version '0.3.2'
2017-03-10 23:04:32 +0900 [info]: fluent/agent.rb:124:add_match: adding match in @FLUENT_LOG pattern="fluent.info" type="remote_syslog"
2017-03-10 23:04:32 +0900 [error]: #0 fluent/supervisor.rb:665:block in main_process: config error file="fluent.conf" error_class=Fluent::ConfigError error="Parameter 'remote_syslog: host=logs2.papertrailapp.com/host_with_port=/facility=user/severity=${fugafuga}/program=fluentd.repro-local-test' doesn't have tag placeholder"
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/.ghq/github.com/fluent/fluentd/lib/fluent/plugin/output.rb:606:in `validate_tag!'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/.ghq/github.com/fluent/fluentd/lib/fluent/plugin/output.rb:581:in `validate!'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/.ghq/github.com/fluent/fluentd/lib/fluent/plugin/output.rb:530:in `block in placeholder_validate!'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/.ghq/github.com/fluent/fluentd/lib/fluent/plugin/output.rb:529:in `each'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/.ghq/github.com/fluent/fluentd/lib/fluent/plugin/output.rb:529:in `placeholder_validate!'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/.ghq/github.com/reproio/fluent-plugin-remote_syslog/lib/fluent/plugin/out_remote_syslog.rb:53:in `configure'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/.ghq/github.com/fluent/fluentd/lib/fluent/plugin.rb:164:in `configure'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/.ghq/github.com/fluent/fluentd/lib/fluent/agent.rb:128:in `add_match'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/.ghq/github.com/fluent/fluentd/lib/fluent/agent.rb:71:in `block in configure'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/.ghq/github.com/fluent/fluentd/lib/fluent/agent.rb:64:in `each'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/.ghq/github.com/fluent/fluentd/lib/fluent/agent.rb:64:in `configure'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/.ghq/github.com/fluent/fluentd/lib/fluent/label.rb:31:in `configure'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/.ghq/github.com/fluent/fluentd/lib/fluent/root_agent.rb:83:in `block in configure'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/.ghq/github.com/fluent/fluentd/lib/fluent/root_agent.rb:83:in `each'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/.ghq/github.com/fluent/fluentd/lib/fluent/root_agent.rb:83:in `configure'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/.ghq/github.com/fluent/fluentd/lib/fluent/engine.rb:117:in `configure'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/.ghq/github.com/fluent/fluentd/lib/fluent/engine.rb:91:in `run_configure'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/.ghq/github.com/fluent/fluentd/lib/fluent/supervisor.rb:734:in `run_configure'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/.ghq/github.com/fluent/fluentd/lib/fluent/supervisor.rb:503:in `block in run_worker'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/.ghq/github.com/fluent/fluentd/lib/fluent/supervisor.rb:662:in `main_process'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/.ghq/github.com/fluent/fluentd/lib/fluent/supervisor.rb:499:in `run_worker'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/.ghq/github.com/fluent/fluentd/lib/fluent/command/fluentd.rb:300:in `<top (required)>'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/.ghq/github.com/fluent/fluentd/bin/fluentd:5:in `require'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/.ghq/github.com/fluent/fluentd/bin/fluentd:5:in `<top (required)>'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/fluentd_workspace/.bundle/ruby/2.3.0/bin/fluentd:22:in `load'
  2017-03-10 23:04:32 +0900 [debug]: #0 fluent/supervisor.rb:661:main_process: /home/joker/fluentd_workspace/.bundle/ruby/2.3.0/bin/fluentd:22:in `<main>'
2017-03-10 23:04:33 +0900 [info]: serverengine/multi_process_server.rb:136:alive?: Worker 0 finished unexpectedly with status 2
2017-03-10 23:04:33 +0900 [info]: serverengine/server.rb:51:stop: Received graceful stop

@repeatedly repeatedly merged commit b08e313 into fluent:master Mar 13, 2017
@repeatedly
Copy link
Member

Good. Thx!

@joker1007 joker1007 deleted the improve-placeholder-validation-message branch March 13, 2017 17:28
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.

2 participants