Forum: Ruby address family for hostname not supported

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2fef95aef6713c75612fbff6b75a53ce?d=identicon&s=25 Dax Huiberts (daxhuiberts)
on 2007-05-04 16:58
I tried to do a capistrano deployment yesterday when it suddenly didn't
want to
work anymore.
It says "address family for hostname not supported". After a lot of
searching and googling and source code lookup I came to the following:
On my development machine @ work (Windows 2003) there is a problem with
the low level Socket.getnameinfo() call.
When I try to do a
Socket.getnameinfo(['AF_INET', '22', 'beeplet.com'])
I get the above exception. but a
Socket.getnameinfo(['AF_INET', '23', 'beeplet.com'])
it works like a charm. It doesn't have anything to do
with what domain I use, it only happens when I use port 22 (ssh) in the
method call. Everything worked fine 2 days ago and now, suddenly, it
bails on me.
Doing the above method call from my development machine @ home (Ubuntu)
it all works just fine.

I don't know how and why I get this exception and haven't been able to
find a sollution either. Maybe somebody knows something more on this
topic?
Aee77dba395ece0a04c688b05b07cd63?d=identicon&s=25 Daniel Berger (Guest)
on 2007-05-04 17:20
(Received via mailing list)
On May 4, 8:59 am, Dax Huiberts <dax.huibe...@gmail.com> wrote:
> Socket.getnameinfo(['AF_INET', '23', 'beeplet.com'])
> it works like a charm. It doesn't have anything to do
> with what domain I use, it only happens when I use port 22 (ssh) in the
> method call. Everything worked fine 2 days ago and now, suddenly, it
> bails on me.
> Doing the above method call from my development machine @ home (Ubuntu)
> it all works just fine.
>
> I don't know how and why I get this exception and haven't been able to
> find a sollution either. Maybe somebody knows something more on this
> topic?

Are you using the one click installer? Perhaps this issue (# 9438) is
related:

http://rubyforge.org/tracker/index.php?func=detail...

Regards,

Dan
Ec07fbda510a142f5331ffd903b07820?d=identicon&s=25 Gordon Thiesfeld (Guest)
on 2007-05-04 17:25
(Received via mailing list)
You need to specify ssh in the %systemroot%\system32\drivers\etc
\services file.

Open it, and add a line like this:

ssh                22/tcp                           #SSH


Gordon
2fef95aef6713c75612fbff6b75a53ce?d=identicon&s=25 Dax Huiberts (daxhuiberts)
on 2007-05-04 17:42
Daniel Berger wrote:
>
> Are you using the one click installer? Perhaps this issue (# 9438) is
> related:
>
> http://rubyforge.org/tracker/index.php?func=detail...
>
> Regards,
>
> Dan

I'm not sure if that is the case, it worked all fine before, and I
haven't updated  my ruby installation.

But I solved it another way.
I uninstalled the net-ssh1.1.0 gem and now my capistrano deployment is
working flawlessly again with net-ssh1.0.10.
Thanks to a colleague futher down the hall @ work. He had a different
error, but problems with the latest net-ssh nonetheless.
2fef95aef6713c75612fbff6b75a53ce?d=identicon&s=25 Dax Huiberts (daxhuiberts)
on 2007-05-04 17:59
Gordon Thiesfeld wrote:
> You need to specify ssh in the %systemroot%\system32\drivers\etc
> \services file.
>
> Open it, and add a line like this:
>
> ssh                22/tcp                           #SSH
>
>
> Gordon

Cool!

That solved one problem,
now it wanted to create a file in my %home_dir%/.ssh directory which
didn't exists and quit. Manually creating that directory and adding the
ssh line to my services file makes net-ssh1.1.0 work with windows.
Apparently net-ssh1.1.0 isn't really geared towards windows usage I
suppose.

Thanks for all the help, I now know why it didn't work and how to solve
it.
Aee77dba395ece0a04c688b05b07cd63?d=identicon&s=25 Daniel Berger (Guest)
on 2007-05-04 19:45
(Received via mailing list)
On May 4, 9:59 am, Dax Huiberts <dax.huibe...@gmail.com> wrote:
> Cool!
>
> That solved one problem,
> now it wanted to create a file in my %home_dir%/.ssh directory which
> didn't exists and quit. Manually creating that directory and adding the
> ssh line to my services file makes net-ssh1.1.0 work with windows.
> Apparently net-ssh1.1.0 isn't really geared towards windows usage I
> suppose.

I found the problem (and it wasn't a Windows problem). It's the host-
key-verifier.rb file. Change line 64 to this:

Dir.mkdir(key_directory,  0700) if !File.exists?(key_directory)

I've already filed a bug report on the project site.

Regards,

Dan
This topic is locked and can not be replied to.