[repost from correct address, i hope]

This is coming from the 'peer' method in lib/net/ssh/transport/
session.rb:

        # Returns info about the remote peer
        def peer
          @peer ||= begin
            addr = @socket.getpeername
            ip_address = Socket.getnameinfo(addr,
Socket::NI_NUMERICHOST).first
            { :ip => ip_address, :port => @port.to_i, :host => @host }
          end
        end

I was able to replicate this problem on windows, with this code:

  require 'socket'
  include Socket::Constants
  socket = Socket.new( AF_INET, SOCK_STREAM, 0 )
  sockaddr = Socket.pack_sockaddr_in( 80, 'www.google.com' )
  socket.connect( sockaddr )
  addr = socket.getpeername
  ip_address = Socket.getnameinfo(addr, Socket::NI_NUMERICHOST).first

which gives:

test.rb:11:in `getnameinfo': getnameinfo: address family for hostname
not supported. (SocketError)
        from test.rb:11

It looks like this solves it:

  ip_address = Socket.getnameinfo(addr, Socket::NI_NUMERICHOST |
Socket::NI_NUMERICSERV).first

I've not tested this in capistrano or even Net::SSH (though I will
later, on OSX), but it should help.

I suspect the reason we don't see this everywhere is that it depends
on the combination of IPv6 support in your kernel, in your resolver
and in your ruby build.


Chris.



On May 1, 10:01 pm, Jamis Buck <[EMAIL PROTECTED]> wrote:
> Grrr.
>
> I hate Windows.
>
> Can someone with Windows networking chops take a look at that and see
> if they can figure out why Net::SSH is choking? Otherwise, I'm just
> going to add a caveat saying Windows users are out of luck and should
> not upgrade.
>
> - Jamis
>
> On May 1, 2007, at 2:55 PM, LarryK wrote:
>
>
>
> > Yes, I also had a problem with net-ssh 1.1.0
>
> > Error received on a winXP box with current capistrano and other gems
> > (fresh install)
>
> > When doing cap setup:
>
> >  getnameinfo: address family for hostname not supported. (SocketError)
> > (see longer log below)
>
> > Moving to older net-ssh gem ver 1.0.10
> > solved the problem.
>
> > Regards,
>
> > LarryK in New York City
>
> > ~~~~~~~~~
>
> > C:\instant_rails_1.7\InstantRails\rails_apps\am2>cap setup
> >   * executing task setup
> >   * executing "umask 02 &&\n    mkdir -p /home2/ma1_deploy /home2/
> > ma1_deploy/releases /home2/ma1_deploy/shared /home2/ma1_deploy/shared/
> > system &&\n    mkdir -p /home2/ma1_deploy/shared/log &&\n    mkdir -
> > p /
> > home2/ma1_deploy/shared/pids"
> >     servers: ["192.168.22.2"]
> > C:/instant_rails_1.7/InstantRails/ruby/lib/ruby/gems/1.8/gems/net-
> > ssh-1.1.0/lib/net/ssh/transport/session.rb:108:in `getnameinfo':
> > getnameinfo: address family for hostname not supported. (SocketError)


--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to