TWIL: YUM, Proxies, RabbitMQ, and Chef

Posted by: Jeffrey Hulten on 06/17/2011

This week I learned about some esoteric looking (but simple to solve) errors.

RabbitMQ and Chef

I was assisting a client with setting up and testing a new Chef 0.10 instance. He completed the steps we had outlined an used in previous environments, but we were getting a strange error when attempting to run "knife configure -i".

Creating initial API user...
ERROR: Server returned error for http://localhost:4000/clients/root, retrying 1/5 in 3s
ERROR: Server returned error for http://localhost:4000/clients/root, retrying 2/5 in 6s
ERROR: Server returned error for http://localhost:4000/clients/root, retrying 3/5 in 11s

We tried several things, checked some logs when we found this line with a substantial stack trace:

merb : chef-server (api) : worker (port 4000) ~ Connection failed - user: chef - (Bunny::ProtocolError)

After some head scratching and iterating on search terms I found a blog post by Jonathan Polansky indicating this was a problem with RabbitMQ not having the Chef specific configuration. He helpfully provided the commands to run that only needed tweaking to add the default password for the RabbitMQ user 'chef' (which is, BTW, 'testing').

# rabbitmqctl add_vhost /chef
# rabbitmqctl add_user chef testing
# rabbitmqctl set_permissions -p /chef chef ".*" ".*" ".*"

Thanks to Jonathan for finding that!

YUM and Proxies

Working with the same customer on spinning up a test machine with their new Chef infrastructure we came across this error:

Setting up repositories
http://[REDACTED]/RedHat/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (111, 'Connection refused')>

We could retrieve the file via CURL from the same machine without a problem but yum refused. Finally we figured out that our standard configuration in Chef for yum required a proxy. We had set this up in other environments, but we have not retrofit the new Chef instance to be configured by Chef.

 

Source: chef-server connection failed to rabbitmq using bunny protocol as user chef (http://jonathanpolansky.com/2010/10/chef-server-connection-failed-to-rabbitmq-using-bunny-protocol-as-user-chef/) by Jonathan Polansky


About Jeffrey Hulten

Jeffrey Hulten

Jeffrey recently started his own consultancy (Automated Labs, LLC) to help companies automate infrastructure, increase application performance, and bring an experimental mindset to adding value. Prior to hanging his own shingle, he spent over 15 years writing software and managing systems for various industries including telecommunications and finance. A long-time supporter of open-source solutions, he has presented his ideas at user groups across the country and co-founded the Seattle DevOps interest group.

More About Jeffrey »

NFJS, the Magazine

May Issue Now Available
  • On the road to learning

    by Raju Gandhi
  • Refactoring to Modularity

    by Kirk Knoernschild
  • RESTful Groovy

    by Kenneth Kousen
  • Getting Started with D3.js

    by Brian Sletten
Learn More »