getnameinfo: ai_family not supported (SocketError)

Discussion in 'Ruby' started by A. S. Bradbury, Sep 1, 2006.

  1. 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
     
    A. S. Bradbury, Sep 1, 2006
    #1
    1. Advertising

  2. A. S. Bradbury

    Eric Hodel Guest

    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?


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

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

    http://trackmap.robotcoop.com
     
    Eric Hodel, Sep 2, 2006
    #2
    1. Advertising

  3. 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?

    Alex
     
    A. S. Bradbury, Sep 2, 2006
    #3
  4. A. S. Bradbury

    Eric Hodel Guest

    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?


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

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

    http://trackmap.robotcoop.com
     
    Eric Hodel, Sep 4, 2006
    #4
  5. 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]]


    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
     
    A. S. Bradbury, Sep 7, 2006
    #5
  6. A. S. Bradbury

    Eric Hodel Guest

    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.


    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.

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

    http://trackmap.robotcoop.com
     
    Eric Hodel, Sep 8, 2006
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. NEETU GARG
    Replies:
    1
    Views:
    734
    Simon Peacock
    Apr 10, 2004
  2. Mariano

    Using getnameinfo()

    Mariano, Jun 30, 2008, in forum: C Programming
    Replies:
    3
    Views:
    839
  3. Bradley, Todd
    Replies:
    0
    Views:
    336
    Bradley, Todd
    Nov 16, 2004
  4. Baq Haidri
    Replies:
    4
    Views:
    369
    Baq Haidri
    May 7, 2008
  5. Walle Wallen

    Pingecho, causing SocketError.

    Walle Wallen, Aug 2, 2010, in forum: Ruby
    Replies:
    3
    Views:
    138
    Walle Wallen
    Aug 2, 2010
Loading...

Share This Page