mitchellh / vagrant-aws

Use Vagrant to manage your EC2 and VPC instances.
MIT License
2.61k stars 574 forks source link

lib/excon/socket.rb:124:in `connect_nonblock': Network is down - connect(2) (Errno::ENETDOWN) (Excon::Errors::SocketError) #467

Open kenorb opened 8 years ago

kenorb commented 8 years ago

Vagrant 1.8.1

I've got this error:

$ PROVIDER=aws vagrant up
Bringing machine 'mt-aws' up with 'aws' provider...
==> mt-aws: Starting the instance...
==> mt-aws: Waiting for instance to become "ready"...
==> mt-aws: Waiting for SSH to become available...
~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/socket.rb:124:in `connect_nonblock': Network is down - connect(2) for 54.239.29.8:443 (Errno::ENETDOWN) (Excon::Errors::SocketError)
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/socket.rb:124:in `block in connect'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/socket.rb:102:in `each'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/socket.rb:102:in `connect'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/ssl_socket.rb:146:in `connect'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/socket.rb:28:in `initialize'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/ssl_socket.rb:8:in `initialize'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/connection.rb:404:in `new'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/connection.rb:404:in `socket'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/connection.rb:106:in `request_call'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/middlewares/mock.rb:47:in `request_call'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/middlewares/instrumentor.rb:25:in `request_call'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/middlewares/base.rb:15:in `request_call'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/middlewares/base.rb:15:in `request_call'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/middlewares/base.rb:15:in `request_call'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/connection.rb:250:in `request'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/middlewares/idempotent.rb:26:in `error_call'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/middlewares/base.rb:10:in `error_call'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/middlewares/base.rb:10:in `error_call'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/connection.rb:273:in `rescue in request'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/connection.rb:221:in `request'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/middlewares/idempotent.rb:26:in `error_call'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/middlewares/base.rb:10:in `error_call'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/middlewares/base.rb:10:in `error_call'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/connection.rb:273:in `rescue in request'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/connection.rb:221:in `request'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/middlewares/idempotent.rb:26:in `error_call'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/middlewares/base.rb:10:in `error_call'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/middlewares/base.rb:10:in `error_call'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/connection.rb:273:in `rescue in request'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/connection.rb:221:in `request'
    from ~/.vagrant.d/gems/gems/fog-xml-0.1.2/lib/fog/xml/sax_parser_connection.rb:35:in `request'
    from ~/.vagrant.d/gems/gems/fog-xml-0.1.2/lib/fog/xml/connection.rb:7:in `request'
    from ~/.vagrant.d/gems/gems/fog-aws-0.9.2/lib/fog/aws/compute.rb:525:in `_request'
    from ~/.vagrant.d/gems/gems/fog-aws-0.9.2/lib/fog/aws/compute.rb:520:in `request'
    from ~/.vagrant.d/gems/gems/fog-aws-0.9.2/lib/fog/aws/requests/compute/describe_instances.rb:81:in `describe_instances'
    from ~/.vagrant.d/gems/gems/fog-aws-0.9.2/lib/fog/aws/models/compute/servers.rb:62:in `all'
    from ~/.vagrant.d/gems/gems/fog-aws-0.9.2/lib/fog/aws/models/compute/servers.rb:149:in `get'
    from ~/.vagrant.d/gems/gems/vagrant-aws-0.7.0/lib/vagrant-aws/action/read_ssh_info.rb:24:in `read_ssh_info'
    from ~/.vagrant.d/gems/gems/vagrant-aws-0.7.0/lib/vagrant-aws/action/read_ssh_info.rb:15:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
    from ~/.vagrant.d/gems/gems/vagrant-aws-0.7.0/lib/vagrant-aws/action/connect_aws.rb:43:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
    from ~/.vagrant.d/gems/gems/vagrant-auto_network-1.0.2/lib/auto_network/action/request.rb:24:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'

I think my mistake was to not specify the --provider=aws (to use different vm.define which is dynamic in my case). My Vagrantfile.

This is the edge-case, however I think the error still should be caught properly by vagrant-aws?

Possibly related: #184