3

I've created a chef server on a virtual machine (192.168.0.21). The server runs fine on https (this is the last version from the opscode site).

knife user list (and the other list commands) run fine, returning the right results (all the users/nodes/clients. new users shows just fine).

when I'm trying to upload a cookbook to the server, I'm getting this error:

Network Error: getaddrinfo: Name or service not known Check your knife configuration and network settings

or this longer error:

ERROR: Network Error: getaddrinfo: Name or service not known Check your knife configuration and network settings /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:763:in initialize': getaddrinfo: Name or service not known (SocketError) from /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:763:inopen' from /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:763:in block in connect' from /opt/chef/embedded/lib/ruby/1.9.1/timeout.rb:69:intimeout' from /opt/chef/embedded/lib/ruby/1.9.1/timeout.rb:100:in timeout' from /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:763:inconnect' from /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:756:in do_start' from /opt/chef/embedded/lib/ruby/1.9.1/net/http.rb:745:instart' from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in transmit' from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rest-client-1.6.7/lib/restclient/request.rb:64:inexecute' from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in execute' from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rest-client-1.6.7/lib/restclient/resource.rb:76:input' from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/cookbook_uploader.rb:153:in block in uploader_function_for' from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/cookbook_uploader.rb:25:incall' from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/cookbook_uploader.rb:25:in block (3 levels) in setup_worker_threads' from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/cookbook_uploader.rb:24:inloop' from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.8.0/lib/chef/cookbook_uploader.rb:24:in `block (2 levels) in setup_worker_threads'

the knife.rb file:

log_level                :info
log_location             STDOUT
node_name                'dony'
client_key               '/home/dony/.chef/dony.pem'
validation_client_name   'chef-validator'
validation_key           '/home/dony/Documents/cd/cv.pem'
chef_server_url          'https://192.168.0.21'
syntax_check_cache_path  '/home/dony/.chef/syntax_check_cache'
cookbook_path   [ "/home/dony/Documents/chef" ]

Since other commands to the server are working, I can't put my finger on that issue.

2

it appears that it is the server fault. server FQDN should be set on the server side.

  1. edit /etc/hostname, to e.g. yourhost.dyndns.org
  2. run: hostname -F /etc/hostname

thats all

|improve this answer|||||
  • @MikeFiedler $ knife cookbook list apt 2.6.1 awesome_customers 0.1.0 firewall 1.5.2 httpd 0.2.19 learn_chef_apache2 0.2.1 poise 2.3.2 This means my knife configuration is Ok .... & $ hostname ashishk.example.com .....this shows network settings is also Ok ....Still getting error ERROR: Network Error: getaddrinfo: Name or service not known Check your knife configuration and network settings – Ashish Karpe Sep 23 '15 at 7:28
0

You may have come across a weird bug in either Chef or it's underlying library, rest-client.

In Chef 11.10.alpha, this may have been replaced/fixed already.

You might also try to specify the actual port in knife.rb, like so:

chef_server_url          'https://192.168.0.21:443'

This might help the current library interpret the location correctly.

|improve this answer|||||
  • the chef_server_url is configure correctly in the knife.rb file, otherwise I won't be able to run command to the server (e.g. list). I don't know if a client.rb will help, but I'll definitely try that. Thank you anyway, and I'll update here for any results. – donald Dec 22 '13 at 17:34
  • BTW setting this on the knife.rb did nothing. I'm still getting to the server, but can't upload. – donald Dec 22 '13 at 17:37
  • Sorry. This solution is not helping. thanks for your time – donald Dec 22 '13 at 18:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.