Getaddrinfo: Name or service not known


#1

When using knife to look at chef configuration, it works fine:

$ knife recipe list
chef_handler
chef_handler::json_file
powershell
windows
windows::reboot_handler

When trying to bootstrap using knife it looks like IP address is not satisfied
only after connection to remote node:

knife bootstrap windows winrm 10.0.1.30 -r 'role[License]'
Bootstrapping Chef on windows
ERROR: Network Error: getaddrinfo: Name or service not known
Check your knife configuration and network settings

knife.rb looks right to me. Network settings should not matter since IP is
being used.

What am I missing?

Tried to search for getaddrinfo on opscode and got no hits.

Thank you.


#2

On Wednesday, May 1, 2013 at 3:25 PM, charles@2ndwatch.com wrote:

When using knife to look at chef configuration, it works fine:

$ knife recipe list
chef_handler
chef_handler::json_file
powershell
windows
windows::reboot_handler

When trying to bootstrap using knife it looks like IP address is not satisfied
only after connection to remote node:

knife bootstrap windows winrm 10.0.1.30 -r 'role[License]'
Bootstrapping Chef on windows
ERROR: Network Error: getaddrinfo: Name or service not known
Check your knife configuration and network settings

knife.rb looks right to me. Network settings should not matter since IP is
being used.

What am I missing?

Tried to search for getaddrinfo on opscode and got no hits.

Thank you.
Can you run knife with -VV and share the output? At some point along the way, a bad hostname is getting passed to a network call. For example:

irb(main):005:0> Net::HTTP.get(URI(“http://bogus”))
SocketError: getaddrinfo: nodename nor servname provided, or not known


Daniel DeLeo


#3

On Thu, May 2, 2013 at 12:25 AM, charles@2ndwatch.com wrote:

When using knife to look at chef configuration, it works fine:

$ knife recipe list
chef_handler
chef_handler::json_file
powershell
windows
windows::reboot_handler

When trying to bootstrap using knife it looks like IP address is not
satisfied
only after connection to remote node:

knife bootstrap windows winrm 10.0.1.30 -r 'role[License]'
Bootstrapping Chef on windows
ERROR: Network Error: getaddrinfo: Name or service not known
Check your knife configuration and network settings

knife.rb looks right to me. Network settings should not matter since IP is
being used.

What am I missing?

Tried to search for getaddrinfo on opscode and got no hits.

Just had the same issue. Make sure you have the knife-windows gem
installed, otherwise knife tries to resolve windows as a host name :slight_smile:

Might make sense to put in some warning in this case, quite confusing…

/Jeppe