Skip to content

Instantly share code, notes, and snippets.

@sppdev
Forked from mriddle/chef_troubleshooting.md
Created November 8, 2012 21:28
Show Gist options
  • Save sppdev/4041762 to your computer and use it in GitHub Desktop.
Save sppdev/4041762 to your computer and use it in GitHub Desktop.
Troubleshooting chef, clients and recipes

Troubleshooting a chef client/recipe

Debugging Chef with Shef

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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment