Address family for hostname not supported

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?

On May 4, 8:59 am, Dax H. [email protected] 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&aid=9438&group_id=167&atid=715

Regards,

Dan

Daniel B. wrote:

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

http://rubyforge.org/tracker/index.php?func=detail&aid=9438&group_id=167&atid=715

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.

Gordon T. 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.

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

On May 4, 9:59 am, Dax H. [email protected] 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