Getnameinfo: ai_family not supported (SocketError)

When trying to run gem_server on either of my gentoo systems, I get the
following:
[2006-09-01 11:08:44] INFO WEBrick 1.3.1
[2006-09-01 11:08:44] INFO ruby 1.8.4 (2005-12-24) [i686-linux]
/usr/lib/ruby/1.8/webrick/utils.rb:63:in `getaddrinfo': getnameinfo: ai_family
not supported (SocketError)
        from /usr/lib/ruby/1.8/webrick/utils.rb:63:in `create_listeners'
        from /usr/lib/ruby/1.8/webrick/server.rb:75:in `listen'
        from /usr/lib/ruby/1.8/webrick/server.rb:63:in `initialize'
        from /usr/lib/ruby/1.8/webrick/httpserver.rb:24:in `initialize'
        from /usr/bin/gem_server:353

I've googled and only found some people with issues from a couple of years
back, which surprised me seeing as I've encountered this on two different
systems. Any ideas what's up?

Alex

Guessing from the last time I was playing around in create_listeners, but do your systems support IPv6?

···

On Sep 1, 2006, at 3:18 AM, A. S. Bradbury wrote:

When trying to run gem_server on either of my gentoo systems, I get the
following:
[2006-09-01 11:08:44] INFO WEBrick 1.3.1
[2006-09-01 11:08:44] INFO ruby 1.8.4 (2005-12-24) [i686-linux]
/usr/lib/ruby/1.8/webrick/utils.rb:63:in `getaddrinfo': getnameinfo: ai_family
not supported (SocketError)
        from /usr/lib/ruby/1.8/webrick/utils.rb:63:in `create_listeners'
        from /usr/lib/ruby/1.8/webrick/server.rb:75:in `listen'
        from /usr/lib/ruby/1.8/webrick/server.rb:63:in `initialize'
        from /usr/lib/ruby/1.8/webrick/httpserver.rb:24:in `initialize'
        from /usr/bin/gem_server:353

I've googled and only found some people with issues from a couple of years
back, which surprised me seeing as I've encountered this on two different
systems. Any ideas what's up?

--
Eric Hodel - drbrain@segment7.net - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com

They do not, emergeing ruby with the ipv6 USE flag prevents this error, though
seeing as my system has no ipv6 support in any other packages, or the kernel
this doesn't seem like a sensible thing to do. Am I likely to see anything
break?

Alex

···

On Saturday 02 September 2006 02:36, Eric Hodel wrote:

Guessing from the last time I was playing around in create_listeners,
but do your systems support IPv6?

I don't know.

Can you try:

require 'socket'

p Socket.getaddrinfo(nil, 80, Socket::AF_UNSPEC,
                      Socket::SOCK_STREAM, 0, Socket::AI_PASSIVE)

On an IPv6 capable machine I get:

[["AF_INET6", 80, "::", "::", 30, 1, 6], ["AF_INET", 80, "0.0.0.0", "0.0.0.0", 2, 1, 6]]

and on an IPv4 only machine I get:

[["AF_INET", 80, "0.0.0.0", "0.0.0.0", 2, 1, 6]]

···

On Sep 2, 2006, at 9:37 AM, A. S. Bradbury wrote:

On Saturday 02 September 2006 02:36, Eric Hodel wrote:

Guessing from the last time I was playing around in create_listeners,
but do your systems support IPv6?

They do not, emergeing ruby with the ipv6 USE flag prevents this error, though
seeing as my system has no ipv6 support in any other packages, or the kernel
this doesn't seem like a sensible thing to do. Am I likely to see anything
break?

--
Eric Hodel - drbrain@segment7.net - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com

On my ipv4 machine I get:
SocketError: getnameinfo: ai_family not supported
        from (irb):4:in `getaddrinfo'
        from (irb):4

On the ipv4 machine with gentoo's ebuild of ruby compiled with the ipv6 USE
flag I get similar output to yours. I wonder if this is something broken on
my systems, a ruby issue, or a packaging issue.

Alex

···

On Monday 04 September 2006 03:27, Eric Hodel wrote:

Can you try:

require 'socket'

p Socket.getaddrinfo(nil, 80, Socket::AF_UNSPEC,
                      Socket::SOCK_STREAM, 0, Socket::AI_PASSIVE)

On an IPv6 capable machine I get:

[["AF_INET6", 80, "::", "::", 30, 1, 6], ["AF_INET", 80, "0.0.0.0",
"0.0.0.0", 2, 1, 6]]

and on an IPv4 only machine I get:

[["AF_INET", 80, "0.0.0.0", "0.0.0.0", 2, 1, 6]]

I suspect it is an issue on the gentoo side, as far as I can tell, getaddrinfo should not fail when given AF_UNSPEC. My IPv4 only machine (FreeBSD 4) behaves this way.

···

On Sep 7, 2006, at 7:04 AM, A. S. Bradbury wrote:

and on an IPv4 only machine I get:

[["AF_INET", 80, "0.0.0.0", "0.0.0.0", 2, 1, 6]]

On my ipv4 machine I get:
SocketError: getnameinfo: ai_family not supported
        from (irb):4:in `getaddrinfo'
        from (irb):4

On the ipv4 machine with gentoo's ebuild of ruby compiled with the ipv6 USE
flag I get similar output to yours. I wonder if this is something broken on
my systems, a ruby issue, or a packaging issue.

--
Eric Hodel - drbrain@segment7.net - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com