Damn chef-server

Fun trying to install Chef server on OEL5 (RHEL5-based):

$ sudo cat /opt/chef-server/embedded/cookbooks/cache/chef-stacktrace.out
2013-05-08 14:47:07 (1368049627)
Generated at 2013-05-08 14:46:49 -0700
Mixlib::ShellOut::ShellCommandFailed: execute[boostrap-chef-server] (chef-server::bootstrap line 27) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '127'
---- Begin output of bin/bootstrap-chef-server ----
STDOUT: =ERROR REPORT==== 8-May-2013::14:46:49 ===
Failed to create cookie file '/home/bjackson/.erlang.cookie': eaccesescript: exception error: no function clause matching
erlang:set_cookie(nonode@nohost,erchef)
STDERR:
---- End output of bin/bootstrap-chef-server ----
Ran bin/bootstrap-chef-server returned 127
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/mixlib-shellout-1.1.0/lib/mixlib/shellout.rb:248:in `invalid!'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/mixlib-shellout-1.1.0/lib/mixlib/shellout.rb:234:in `error!'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/mixin/shell_out.rb:36:in `shell_out!'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/provider/execute.rb:62:in `block in action_run'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/mixin/why_run.rb:52:in `call'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/mixin/why_run.rb:52:in `add_action'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/provider.rb:151:in `converge_by'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/provider/execute.rb:61:in `action_run'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/provider.rb:114:in `run_action'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/resource.rb:603:in `run_action'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/runner.rb:50:in `run_action'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/runner.rb:82:in `block (2 levels) in converge'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/runner.rb:82:in `each'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/runner.rb:82:in `block in converge'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/resource_collection.rb:94:in `block in execute_each_resource'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/resource_collection.rb:92:in `execute_each_resource'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/runner.rb:81:in `converge'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/client.rb:404:in `converge'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/client.rb:469:in `do_run'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/client.rb:200:in `run'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application.rb:190:in `run_chef_client'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application/solo.rb:239:in `block in run_application'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application/solo.rb:231:in `loop'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application/solo.rb:231:in `run_application'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/lib/chef/application.rb:73:in `run'
/opt/chef-server/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.0/bin/chef-solo:25:in `<top (required)>'
/opt/chef-server/embedded/bin/chef-solo:23:in `load'
/opt/chef-server/embedded/bin/chef-solo:23:in `<main>'2013-05-08 14:47:10 (1368049630)

So I poked around looking for a plausible explanation of this, and found something related, though not precisely the same error, on SO: http://stackoverflow.com/questions/16219409/chef-server-ctl-reconfigure-fails-because-of-rabbitmq

Aha!  So it’s not supposed to be creating that cookie file in my home directory!  Thought that was odd… so obviously it’s using ~ or $HOME incorrectly at some point — or something is happening to make those not work as expected.

How about we ensure sudo isn’t preserving the environment?

$ sudo -i chef-server-ctl reconfigure

[... wait a bit ...]

chef-server Reconfigured!

Success!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s