[chef] Re: Re: Using vagrant + chef-zero and do not expect to see these error messages


Chronological Thread 
  • From: Anthony Kong < >
  • To:
  • Subject: [chef] Re: Re: Using vagrant + chef-zero and do not expect to see these error messages
  • Date: Fri, 30 Jan 2015 02:13:17 +1100

How can I specify the validation key via the chef-zero configuration? I am reading the README of https://github.com/chef/vagrant-omnibus/issues but I cannot find any reference to this property...




On Fri, Jan 30, 2015 at 2:10 AM, Brandon Raabe < " target="_blank"> > wrote:
If I remember correctly, you still need to provide a validation key, but it doesn't do any of the actual verification. So as long as the file exists, it should work and move on. 

On Thu, Jan 29, 2015 at 8:02 AM, Anthony Kong < " target="_blank"> > wrote:
Hi, 

I am using chef-zero and do not expect to see these error messages in the guest OS. According to doco, chef-zero is supposed to use a dumb-down version of chef-server which does not perform authentication or authorization. So there is no reason for the client to need the perm files, right?

Client log

:/var/log/chef$ cat client.log
# Logfile created on 2015-01-29 04:28:14 +0000 by logger.rb/31641
[2015-01-29T04:28:14+00:00] INFO: Daemonizing..
[2015-01-29T04:28:14+00:00] INFO: Forked, in 1317. Privileges: 0 0
[2015-01-29T04:28:32+00:00] INFO: Forking chef instance to converge...
[2015-01-29T04:28:32+00:00] INFO: *** Chef 11.8.2 ***
[2015-01-29T04:28:32+00:00] INFO: Chef-client pid: 2065
[2015-01-29T04:28:32+00:00] INFO: Client key /etc/chef/client.pem is not present - registering
[2015-01-29T04:28:32+00:00] WARN: Failed to read the private key /etc/chef/validation.pem: #<Errno::ENOENT: No such file or directory - /etc/chef/validation.pem>
[2015-01-29T04:28:32+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2015-01-29T04:28:32+00:00] ERROR: I cannot read /etc/chef/validation.pem, which you told me to use to sign requests!
[2015-01-29T04:28:32+00:00] ERROR: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
[2015-01-29T04:28:32+00:00] ERROR: Sleeping for 1800 seconds before trying again
[2015-01-29T04:28:45+00:00] INFO: SIGTERM received, exiting gracefully


chef-stacktrace.out

:/var/log/chef$ sudo cat /var/chef/cache/chef-stacktrace.out
Generated at 2015-01-29 04:28:32 +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'

Here is my vagrant provision clauses:

config.vm.provision "chef_zero" do |chef|
    # Do not need to specify cookbook path because berkshelf plugin
    #    handles cookbook management
    # Must provide ssl.json in data bag for sensu
    chef.data_bags_path = "data_bags"
    # Enable this for debug info
    chef.log_level = :debug
    chef.add_recipe 'apt'
    chef.add_recipe 'python'
    chef.add_recipe 'vim'
    chef.add_recipe 'git'
    chef.add_recipe 'sensu::default'
    chef.add_recipe 'sensu::rabbitmq'
    chef.add_recipe 'sensu::redis'
    chef.add_recipe 'sensu::server_service'
    chef.json = {
      :git   => {
        :prefix => "/usr/local"
      }
    }
  end

Target OS is  ubuntu/trusty64

My vagrant plugins:

$ vagrant plugin list
chef-zero (2.2.1)
vagrant-aws (0.6.0)
vagrant-berkshelf (4.0.2)
vagrant-cachier (1.2.0)
vagrant-chef-zero (0.7.1)
vagrant-omnibus (1.4.1)
vagrant-share (1.1.3, system)

Cheers, Tony








Archive powered by MHonArc 2.6.16.

§