Brad Montgomery

Hi! I'm Brad Montgomery.

Thanks for visiting my site. I'm a software developer living in the suburbs of Memphis, TN. I'm a python programming language enthusiast and I'm quite fond of the Django Web Framework.

I also organize the Memphis Python user group. If you're ever in my neighborhood, and you'd like to meet other Pythonistas, please get in touch!

Want to know more? Check out my about page.

Net::HTTPServerException: 412 "Precondition Failed"

Published by bkmontgomery on Feb. 5, 2012, 2:15 p.m..

So, I've been working with Chef quite a bit, lately. Every once in a while, I'll bootstrap a new node and it fails with this:

Net::HTTPServerException: 412 "Precondition Failed"

Every single time this has happened to me, I've had stop and scratch my head. Why can't I remember what causes this!? Well, in my case it's usually a misspelled cookbook or recipe name. For example, I might have a role that looks something like this:

name "sample-server"
description "sample apache server"
run_list "role[apache::default]"

Can you spot the problem? The opscode cookbook for apache is named apache2!

name "sample-server"
description "sample apache server"
run_list "role[apache2::default]"

So, one complaint that I have about chef is that Net::HTTPServerException: 412 "Precondition Failed" should probably say something like Net::HTTPServerException: 412 "Couldn't find cookbook 'apache'". Oh well... C'est la vie

Tagged with: chef

comments powered by Disqus