Chef Server > Exception: NoMethodError: undefined method `save' for #<Hash:0x7f9b5d518d08> when running 'knife configure -i'

StackOverflow https://stackoverflow.com/questions/15753617

  •  31-03-2022
  •  | 
  •  

Question

Not sure if this issue has been address or if I am doing anything wrong. Looked through the current tickets and did not see the same error.

I am following the installation guide for 'Installing Chef Server on Debian or Ubuntu using Packages' provided by the Opscode wiki found here: http://wiki.opscode.com/display/chef/Installing+Chef+Server+on+Debian+or+Ubuntu+using+Packages

Installation seemed to go smoothly until I reach the section 'Configure the Command Line Client'. I ran 'knife configure -i' from my users home directory and entered the following:

admin@chef:~$ knife configure -i
Overwrite /home/admin/.chef/knife.rb? (Y/N) y
Please enter the chef server URL: http://chef.website.org:4000
Please enter a clientname for the new client: [admin]
Please enter the existing admin clientname: [chef-webui]
Please enter the location of the existing admin client's private key: [/etc/chef/webui.pem] .chef/webui.pem
Please enter the validation clientname: [chef-validator]
Please enter the location of the validation key: [/etc/chef/validation.pem] .chef/validation.pem
Please enter the path to a chef repository (or leave blank):

...and I receive the following error:

Creating initial API user...
ERROR: knife encountered an unexpected error
This may be a bug in the 'configure' knife command or plugin
Please collect the output of this command with the `-VV` option before filing a bug report.
Exception: NoMethodError: undefined method `save' for #<Hash:0x7f9b5d518d08>

The -VV option does not seem to work with the -i option when running 'knife configure -i'

When I run the next command in the tutorial with the -VV command, I receive:

admin@chef:~$ knife client list -VV
DEBUG: Using configuration from /home/admin/.chef/knife.rb
WARN: Failed to read the private key /home/admin/.chef/admin.pem: #<Errno::ENOENT: No such file or directory - /home/admin/.chef/admin.pem>
/usr/lib/ruby/vendor_ruby/chef/rest/auth_credentials.rb:64:in `load_signing_key': I cannot read /home/admin/.chef/admin.pem, which you told me to use to sign requests! (Chef::Exceptions::PrivateKeyMissing)
from /usr/lib/ruby/vendor_ruby/chef/rest/auth_credentials.rb:34:in `initialize'
from /usr/lib/ruby/vendor_ruby/chef/rest.rb:64:in `new'
from /usr/lib/ruby/vendor_ruby/chef/rest.rb:64:in `initialize'
from /usr/lib/ruby/vendor_ruby/chef/api_client.rb:198:in `new'
from /usr/lib/ruby/vendor_ruby/chef/api_client.rb:198:in `list'
from /usr/lib/ruby/vendor_ruby/chef/knife/client_list.rb:38:in `run'
from /usr/lib/ruby/vendor_ruby/chef/knife.rb:408:in `run_with_pretty_exceptions'
from /usr/lib/ruby/vendor_ruby/chef/knife.rb:168:in `run'
from /usr/lib/ruby/vendor_ruby/chef/application/knife.rb:123:in `run'
from /usr/bin/knife:24

Which I am guessing is coming from the "knife config -i" refusing to run. What am I doing wrong here? What am I missing?

Was it helpful?

Solution

That's because of a security related change in ruby-json package. Have a look at:

http://community.opscode.com/chat/chef/2013-02-26

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=701629

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top