When the chef client fails to run the recipe successfully during bootstrapping sudo chef-client
to setup the connection with the chef-server. It will run with an empty run list. After its connected login to http://yourchefserver.com:4040/nodes/_NODE_NAME_, add the roles/recipes to the chef-client and run sudo chef-client
from the client again.
When fixing a recipe and re-running make your modifications run knife cookbook upload -a #or cookbook name
from your dev machine and run sudo chef-client
from the chef client.
When there are issues registering the client with the chef-server check that the chef-client name isn't already registered on the server under clients or nodes or that the client has not already been registered (see below)
When you want to re-register a removed client from the chef client run
sudo rm /etc/chef/client.pem && sudo chef-client
When you wanted to point a chef-client to a new chef server
- Remove the client.pem
- Update the key in /etc/chef/validation.pem
- Update the address of the server in /etc/chef/client.rb
To see logs of a failed run look in
less /var/log/chef/client.log
less less /var/log/cloud-init.log
sudo less /var/cache/chef/chef-stacktrace.out
sudo less /var/cache/chef/failed-run-data.json