sous-chefs / consul

Development repository for the consul cookbook

Home Page:https://supermarket.chef.io/cookbooks/consul

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using consul with Chef::Handler::JsonFile causes exception in handler

mattlqx opened this issue · comments

Looks like the handler tries to serialize everything into json with to_json and something along the line results in ConsulCookbook::Resource::ConsulConfig.to_json being called with an argument. You can get this result just including chef_handler::json_file in your run_list.

Running handlers:
[2017-08-09T20:51:51+00:00] INFO: Running report handlers
[2017-08-09T20:51:51+00:00] INFO: Creating JSON run report
[2017-08-09T20:51:51+00:00] ERROR: Report handler Chef::Handler::JsonFile raised #<ArgumentError: wrong number of arguments (given 1, expected 0)>
[2017-08-09T20:51:51+00:00] ERROR: /var/chef/cache/cookbooks/consul/libraries/consul_config.rb:114:in `to_json'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/ffi-yajl-2.3.0/lib/ffi_yajl/encoder.rb:42:in `ffi_yajl'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/ffi-yajl-2.3.0/lib/ffi_yajl/encoder.rb:42:in `ffi_yajl'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/ffi-yajl-2.3.0/lib/ffi_yajl/encoder.rb:42:in `ffi_yajl'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/ffi-yajl-2.3.0/lib/ffi_yajl/encoder.rb:42:in `do_yajl_encode'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/ffi-yajl-2.3.0/lib/ffi_yajl/encoder.rb:42:in `encode'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/ffi-yajl-2.3.0/lib/ffi_yajl/encoder.rb:57:in `encode'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/json_compat.rb:103:in `to_json'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/json_compat.rb:113:in `to_json_pretty'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/handler/json_file.rb:50:in `block in report'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/handler/json_file.rb:43:in `open'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/handler/json_file.rb:43:in `report'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/handler.rb:259:in `run_report_unsafe'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/handler.rb:247:in `run_report_safely'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/handler.rb:125:in `block in run_report_handlers'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/handler.rb:123:in `each'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/handler.rb:123:in `run_report_handlers'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/handler.rb:135:in `block in <class:Handler>'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/client.rb:443:in `block in run_completed_successfully'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/client.rb:442:in `each'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/client.rb:442:in `run_completed_successfully'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/client.rb:301:in `run'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/application.rb:295:in `block in fork_chef_client'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/application.rb:283:in `fork'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/application.rb:283:in `fork_chef_client'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/application.rb:248:in `block in run_chef_client'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/local_mode.rb:44:in `with_server_connectivity'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/application.rb:236:in `run_chef_client'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/application/client.rb:464:in `sleep_then_run_chef_client'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/application/client.rb:451:in `block in interval_run_chef_client'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/application/client.rb:450:in `loop'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/application/client.rb:450:in `interval_run_chef_client'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/application/client.rb:434:in `run_application'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/lib/chef/application.rb:59:in `run'
[2017-08-09T20:51:51+00:00] ERROR: /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.21.3/bin/chef-client:26:in `<top (required)>'
[2017-08-09T20:51:51+00:00] ERROR: /usr/bin/chef-client:57:in `load'
[2017-08-09T20:51:51+00:00] ERROR: /usr/bin/chef-client:57:in `<main>'
  - Chef::Handler::JsonFile

Closing due to inactivity.

If this is still an issue please reopen or open another issue. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help!

Thanks,
Sous-Chefs

commented

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.