Book Image

Chef Infrastructure Automation Cookbook Second Edition

By : Matthias Marschall
Book Image

Chef Infrastructure Automation Cookbook Second Edition

By: Matthias Marschall

Overview of this book

Table of Contents (14 chapters)
Chef Infrastructure Automation Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Debugging Chef client runs


Sometimes you get obscure error messages when running the Chef client and you have a hard time finding any clue about where to look for the error. Is your cookbook broken? Do you have a networking issue? Is your Chef server down? Only by looking at the most verbose log output do you have a chance to find out.

Getting ready

You need a Chef client hooked up to the hosted Chef or your own Chef server.

How to do it...

Let's see how we can ask the Chef client to print debug messages:

  1. Run the Chef-client with debug output:

    user@server:~$ sudo chef-client -l debug
    
    …TRUNCATED OUTPUT…
    [2014-12-27T21:38:34+00:00] DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_request
    [2014-12-27T21:38:34+00:00] DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_request
    [2014-12-27T21:38:34+00:00] DEBUG: Initiating GET to https://api.opscode.com/organizations/awo/nodes/server
    [2014-12-27T21:38:34+00:00] DEBUG: ---- HTTP Request Header Data: ----
    [2014-12-27T21:38...