Muffinresearch Labs by Stuart Colville

Debugging Elusive Puppet Errors | 1 Comment

Posted in Code, Linux/Unix on 8th June 2010, 6:14 pm by

On working on some puppet manifests I hit this error message:

$ sudo puppetd -t
err: Could not retrieve catalog from remote server: undefined method `closed?' for nil:NilClass
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run

Certainly not the most enlightening error message. After checking over the syntax of my mainfests it still wasn’t obvious what was wrong.

First port of call to diagnose the problem is to try enabling debugging on the client:

On the client:

# Run the client with debugging enabled.
$ sudo puppetd -t --debug

If that yields nothing useful try the following:

On the puppetmaster run:

# If it's running stop the puppetmasterd service
# change this to suit your distro - the following is debian specific
$ sudo /etc/init.d/puppetmaster stop 

# start the puppetmasterd in debug mode without daemonizing it.
$ sudo puppetmasterd --no-daemonize --debug

Back on the client re-run the puppetd:

$ sudo puppetd -t

By looking at the debug output on the puppetmaster I was able to see my problem which was that a generate command didn’t have permission to write a necessary file. Once I’d fixed it everything worked as expected.

Once finished ctrl-c the foreground puppetmasterd and restart the service if you’d stopped it to run it in debug mode:

$ sudo /etc/init.d/puppetmaster start

Post Tools

  • Ernesto

    Hi, I hope that you can help me. When I execute puppetd – t in the client appears to me the following error

    Could not retrieve macaddress: private method `split’ called for nil:NilClass
    Could not retrieve macaddress: private method `split’ called for nil:NilClass
    err: Could not retrieve catalog from remote server: Connection refused – connect(2)
    warning: Not using cache on failed catalog
    err: Could not retrieve catalog; skipping run

GNU screen: open tab in current working directory|(1)

A nice trick for having screen open a new tab in the same directory as the one you’re currently in. To use it add it to your .screenrc

# Open new window in current dir.
bind c stuff "screen -X chdir \$PWD;screen^M"
bind ^c stuff "screen -X chdir \$PWD;screen^M"

Hat tip: mteckert on SuperUser.com

Ubuntu: add-apt-repository: command not found|(3)

When you’re using a minimal Ubuntu install if you find the ‘add-apt-repository’ command is missing (it’s useful for adding PPAs and other repositories), then simply run:

sudo apt-get install python-software-properties

Photos on Flickr

© Copyright 2004-12 Stuart Colville, all rights reserved. May contain traces of Muffin. Powered by WordPress. Hosting by Slicehost.com This page was baked in 0.459s.