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


Chronological Thread 
  • From: Lamont Granquist < >
  • To:
  • Cc: Anthony Kong < >
  • Subject: [chef] Re: Re: Re: Using vagrant + chef-zero and do not expect to see these error messages
  • Date: Thu, 29 Jan 2015 15:20:03 -0800


You probably used a base box that already had an old version of chef installed, and you either don't have the vagrant-omnibus plugin installed or you've misconfigured it somehow, or there's two version of chef-client on the virt and Vagrant's provisioner is getting the wrong one, etc.

All those issues are solved if you use test-kitchen instead.

On 1/29/15 3:13 PM, Anthony Kong wrote:
" type="cite">
Hi Lamont,

Why chef client 11.8.2 is installed in the guest OS?

I had this line in my Vagrantfile already:

     config.omnibus.chef_version = :latest

I would expect it will install the latest version of chef for me to the guest OS, right?

Cheers, Tony


On Fri, Jan 30, 2015 at 4:18 AM, Lamont Granquist < " target="_blank"> > wrote:

You are using chef-client 11.8.2 (which is ancient at this point) installed in /usr/lib/ruby/vendor_ruby and not the omnibus install.

Best way to get started using chef and vagrant is to use test-kitchen out of ChefDK:

https://gist.github.com/lamont-granquist/40d26b6fa8178212594f


On 1/29/15 7:02 AM, Anthony Kong 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.

§