2
votes

When I try to configure knife in AWS CentOS server using the following command:

knife configure -i

This is the output:

Where should I put the config file? [/root/.chef/knife.rb] 
Please enter the chef server URL: [http://myserverurl.com:4000] 
Please enter a clientname for the new client: [jim]  
Please enter the existing admin clientname: [chef-webui] 
Please enter the location of the existing admin client's private key: [/etc/chef/webui.pem] 
Please enter the validation clientname: [chef-validator] 
Please enter the location of the validation key: [/etc/chef/validation.pem] 
Please enter the path to a chef repository (or leave blank): 
Creating initial API user...

and this is the error:

ERROR: Server returned error for http://myserverurl.com:4000/clients, retrying 1/5 in 4s
ERROR: Server returned error for http://myserverurl.com:4000/clients/jim, retrying 1/5 in 3s

Update

I also tried to take a look at /root/.chef/knife.rb and this is the content of the file:

log_level                :info
log_location             STDOUT
node_name                'jim'
client_key               '/root/.chef/jim.pem'
validation_client_name   'chef-validator'
validation_key           '/etc/chef/validation.pem'
chef_server_url          'http://myserverurl.com:4000'
cache_type               'BasicFile'
cache_options( :path => '/root/.chef/checksums' )

The file /root/.chef/jim.pem does not exists, is it auto-generated or should I create it.

3

3 Answers

1
votes

Log into the chef server web UI and create a client. In the window it will show a "One Time" private key that you need to copy paste into the appropriate ~/.chef/client.pem file.

It looks like it is trying to log in and do that for you and failing.

0
votes

Chef solo didn't start rabbitmq for some reason:

sudo service rabbitmq-server restart
0
votes

I was facing the exact issue. But I got this solved by following this documentation.

Moreover, you might be doing another mistake here, when u ran the command to install chef it would have asked you for a chef server url. I was doing a mistake there.

If you are using Amazon EC2 then the chef server url is http://<your FQDN>: 4000

Please check if you are getting this step correct. And yes your FQDN is not the public dns. Run the hostname command and you will get something of the sort ip: 12-23-344-32. This is your FQDN

Hope this helps.