0
votes

When a machine gets rebooted. it fails on chef-client run(run from rc.local) but if i run it manually it gets success and same error return on next auto chef-run.when i restart the chef-client the error stop coming . in fact when chef-client was failing on auto run ,ohai was giving the correct output.

root@something:~# ohai | grep 'fqdn'
 "fqdn": "something.someone",  
root@something:~# chef-client -v 
Chef: 12.20.3 
root@something:~# ohai -v
Ohai: 8.23.0 
root@something:~# hostname -f
something.someone

Output of stacktrace

root@something:~# cat /var/chef/cache/chef-stacktrace.out Generated at 2018-04-02 15:36:30 +0000 Chef::Exceptions::CannotDetermineNodeName: Unable to determine node name: configure node_name or configure the system's hostname and fqdn /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/client.rb:299:in node_name' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/client.rb:313:in register' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/client.rb:416:in do_run' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/client.rb:213:in block in run' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/client.rb:207:in fork' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/client.rb:207:in run' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/application.rb:237:in run_chef_client' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/application/client.rb:338:in block in run_application' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/application/client.rb:327:in loop' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/application/client.rb:327:in run_application' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/application.rb:55:in run' /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.14.2/bin/chef-client:26:in ' /usr/bin/chef-client:23:in load' /usr/bin/chef-client:23:in'[email protected]:~#

1

1 Answers

0
votes

You've clearly got a mismatch in what you are running. Your CLI says Chef 12, but the stack trace says Chef 11. I'm guessing you installed one via our Omnibus packages and the other via Rubygems? No matter the cause, fix that conflict and you'll probably be happier.