Errno::ENETUNREACH: Network is unreachable with deploy:check

Hi I tried to deploy foodsoft.

I am not very much into ruby/rails etc., but this is what i did:

I forked the repo and added a deploy ssh key to my github foodsoft repo, altered the config files: deploy.rb, deploy/*.rb.

When excuting on my local machine the deploy:check I got the following error:

bundle exec cap production deploy:check --trace
** Invoke production (first_time)
** Execute production
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke rvm:hook (first_time)
** Execute rvm:hook
cap aborted!
Errno::ENETUNREACH: Network is unreachable - connect(2) for [2606:2800:220:1:248:1893:25c8:1946]:22
/home/simon/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/socket.rb:64:in connect' /home/simon/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/socket.rb:64:in connect_internal’
/home/simon/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/socket.rb:139:in connect' /home/simon/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/socket.rb:636:in block in tcp’
/home/simon/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/socket.rb:231:in each' /home/simon/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/socket.rb:231:in foreach’
/home/simon/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/socket.rb:626:in tcp' /home/simon/.rvm/gems/ruby-2.3.0/gems/net-ssh-3.1.1/lib/net/ssh/transport/session.rb:70:in initialize’
/home/simon/.rvm/gems/ruby-2.3.0/gems/net-ssh-3.1.1/lib/net/ssh.rb:229:in new' /home/simon/.rvm/gems/ruby-2.3.0/gems/net-ssh-3.1.1/lib/net/ssh.rb:229:in start’
/home/simon/.rvm/gems/ruby-2.3.0/gems/sshkit-1.10.0/lib/sshkit/backends/connection_pool.rb:59:in call' /home/simon/.rvm/gems/ruby-2.3.0/gems/sshkit-1.10.0/lib/sshkit/backends/connection_pool.rb:59:in with’
/home/simon/.rvm/gems/ruby-2.3.0/gems/sshkit-1.10.0/lib/sshkit/backends/netssh.rb:143:in with_ssh' /home/simon/.rvm/gems/ruby-2.3.0/gems/sshkit-1.10.0/lib/sshkit/backends/netssh.rb:96:in execute_command’
/home/simon/.rvm/gems/ruby-2.3.0/gems/sshkit-1.10.0/lib/sshkit/backends/abstract.rb:137:in block in create_command_and_execute' /home/simon/.rvm/gems/ruby-2.3.0/gems/sshkit-1.10.0/lib/sshkit/backends/abstract.rb:137:in tap’
/home/simon/.rvm/gems/ruby-2.3.0/gems/sshkit-1.10.0/lib/sshkit/backends/abstract.rb:137:in create_command_and_execute' /home/simon/.rvm/gems/ruby-2.3.0/gems/sshkit-1.10.0/lib/sshkit/backends/abstract.rb:50:in test’

Any ideas?

Hi,

This looks like you’re deploying to an IPv6 address that doesn’t having
SSH listening. You could try to enable SSH for IPv6, disable IPv4 on
your deploying machine, or specify an IPv4-addres in your ~/.ssh/config
for the host, among other options.

  • Willem

I did this on the server:

sudo netstat -lntpe | grep :22

tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 0 1906590555 435/sshd
tcp6 0 0 :::22 :::* LISTEN 0 1906590559 435/sshd

Doesn’t this mean, that is is listining on ipv6 with ssh?

Yes it is! Perhaps the firewall is still blocking it?

Hm, on the ubuntu 12.04 sever ufw is not active/existing.

And on the deploying machine ubuntu 14.04 neither (it’s inactive)

If you want to just get it deployed, I’d ssh to the IPv4 address
(instead of the hostname). IPv6 has gotten a long way, but it isn’t
always fully working out of the box :frowning: Apart from the server and your
own computer, your ISP and hosting provider also need to support it.

Ok, stupid me: forgot to adapt the first three lines in config/production.rb :

role :app, %w{user@exmaple.com}
etc.

Now I could connect and I will continue to set config files on server!

Thanks anyway.