getnameinfo: ai_family not supported (SocketError)

A

A. S. Bradbury

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
 
E

Eric Hodel

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?

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

A. S. Bradbury

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?

Alex
 
E

Eric Hodel

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?

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]]
 
A

A. S. Bradbury

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 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
 
E

Eric Hodel

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.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top