[chef] Re: Re: sensu data bag file


Chronological Thread 
  • From: "A. Kong" < >
  • To:
  • Subject: [chef] Re: Re: sensu data bag file
  • Date: Tue, 4 Nov 2014 23:20:53 +1100

Hi Daniel,

Here is the content of /var/chef/cache/chef-stacktrace.out

Generated at 2014-11-04 11:40:08 +0000
Chef::Exceptions::PrivateKeyMissing: I cannot read /etc/chef/validation.pem, which you told me to use to sign requests!
/usr/lib/ruby/vendor_ruby/chef/http/authenticator.rb:74:in `rescue in load_signing_key'
/usr/lib/ruby/vendor_ruby/chef/http/authenticator.rb:64:in `load_signing_key'
/usr/lib/ruby/vendor_ruby/chef/http/authenticator.rb:38:in `initialize'
/usr/lib/ruby/vendor_ruby/chef/rest.rb:63:in `new'
/usr/lib/ruby/vendor_ruby/chef/rest.rb:63:in `initialize'
/usr/lib/ruby/vendor_ruby/chef/api_client/registration.rb:111:in `new'
/usr/lib/ruby/vendor_ruby/chef/api_client/registration.rb:111:in `http_api'
/usr/lib/ruby/vendor_ruby/chef/api_client/registration.rb:93:in `create'
/usr/lib/ruby/vendor_ruby/chef/api_client/registration.rb:84:in `create_or_update'
/usr/lib/ruby/vendor_ruby/chef/api_client/registration.rb:57:in `run'
/usr/lib/ruby/vendor_ruby/chef/client.rb:380:in `register'
/usr/lib/ruby/vendor_ruby/chef/client.rb:486:in `do_run'
/usr/lib/ruby/vendor_ruby/chef/client.rb:199:in `block in run'
/usr/lib/ruby/vendor_ruby/chef/client.rb:193:in `fork'
/usr/lib/ruby/vendor_ruby/chef/client.rb:193:in `run'
/usr/lib/ruby/vendor_ruby/chef/application.rb:208:in `run_chef_client'
/usr/lib/ruby/vendor_ruby/chef/application/client.rb:312:in `block in run_application'
/usr/lib/ruby/vendor_ruby/chef/application/client.rb:304:in `loop'
/usr/lib/ruby/vendor_ruby/chef/application/client.rb:304:in `run_application'
/usr/lib/ruby/vendor_ruby/chef/application.rb:66:in `run'
/usr/bin/chef-client:25:in `<main>'

BTW I have found out how to generate the data bag data file: https://github.com/sensu/sensu-chef/tree/master/examples/ssl


Cheers, Tony


On 4 Nov 2014, at 4:36 pm, Daniel DeLeo < " class=""> > wrote:

Can you copy the chef-stacktrace.out file? Looks like you’re passing an unexpected data type somewhere, but it’s not checked until it blows up somewhere in chef’s internals.  

--  
Daniel DeLeo


On Monday, November 3, 2014 at 4:18 PM, A. Kong wrote:

Hi

I am trying to use sensu with chef-solo. Chef requires a data_bag file. Unfortunately I can’t locate any info about what need to go into a data_bag file for the sensu package. I wonder if anyone can give me a pointer?

Currently I have put a file ‘mycompany.json’ in ~/.chef/data_bags/sensu/

The content of mycompany.json is just:

{
"id”:"mycompany"
}


This is the error message I am getting:

==> default: TypeError
==> default: ---------
==> default: can't convert Array into String
==> default:
==> default:
==> default: Cookbook Trace:
==> default: ---------------
==> default: /tmp/vagrant-chef-3/chef-solo-1/cookbooks/sensu/libraries/sensu_helpers.rb:36:in `data_bag_item'
==> default: /tmp/vagrant-chef-3/chef-solo-1/cookbooks/sensu/recipes/default.rb:65:in `from_file'
==> default:
==> default:
==> default: Relevant File Content:
==> default: ----------------------
==> default: /tmp/vagrant-chef-3/chef-solo-1/cookbooks/sensu/libraries/sensu_helpers.rb:
==> default:
==> default: 29: "/opt/sensu/embedded/bin/gem"
==> default: 30: else
==> default: 31: "gem"
==> default: 32: end
==> default: 33: end
==> default: 34:
==> default: 35: def data_bag_item(item, missing_ok=false)
==> default: 36>> raw_hash = Chef::DataBagItem.load("sensu", item)


Thanks, Tony  






Archive powered by MHonArc 2.6.16.

§