mitchellh / vagrant-aws

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

getaddrinfo: nodename nor servname provided, or not known (SocketError) #198

Open jessereynolds opened 10 years ago

jessereynolds commented 10 years ago

This was working a week or two ago. I'm not sure if this is an issue with vagrant-aws or something else...

[aws-ubuntu-precise64] Launching an instance with the following settings...
[aws-ubuntu-precise64]  -- Type: c3.large
[aws-ubuntu-precise64]  -- AMI: ami-978916ad
[aws-ubuntu-precise64]  -- Region: ap-southeast-2
[aws-ubuntu-precise64]  -- Keypair: vagrant-flapjack
[aws-ubuntu-precise64]  -- Block Device Mapping: []
[aws-ubuntu-precise64]  -- Terminate On Shutdown: false
[aws-ubuntu-precise64]  -- Monitoring: false
[aws-ubuntu-precise64]  -- EBS optimized: false
An error occurred while executing multiple actions in parallel.
Any errors that occurred are shown below.

An unexpected error ocurred when executing the action on the
'aws-ubuntu-precise64' machine. Please report this as a bug:

getaddrinfo: nodename nor servname provided, or not known (SocketError)

/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/socket.rb:135:in `getaddrinfo'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/socket.rb:135:in `connect'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/ssl_socket.rb:112:in `connect'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/socket.rb:28:in `initialize'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/ssl_socket.rb:8:in `initialize'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/connection.rb:373:in `new'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/connection.rb:373:in `socket'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/connection.rb:122:in `request_call'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/middlewares/mock.rb:42:in `request_call'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/middlewares/instrumentor.rb:22:in `request_call'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/middlewares/base.rb:15:in `request_call'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/middlewares/base.rb:15:in `request_call'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/middlewares/base.rb:15:in `request_call'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/connection.rb:251:in `request'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/middlewares/idempotent.rb:12:in `error_call'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/middlewares/base.rb:10:in `error_call'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/middlewares/base.rb:10:in `error_call'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/connection.rb:268:in `rescue in request'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/connection.rb:217:in `request'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/middlewares/idempotent.rb:12:in `error_call'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/middlewares/base.rb:10:in `error_call'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/middlewares/base.rb:10:in `error_call'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/connection.rb:268:in `rescue in request'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/connection.rb:217:in `request'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/middlewares/idempotent.rb:12:in `error_call'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/middlewares/base.rb:10:in `error_call'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/middlewares/base.rb:10:in `error_call'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/connection.rb:268:in `rescue in request'
/Users/jesse/.vagrant.d/gems/gems/excon-0.28.0/lib/excon/connection.rb:217:in `request'
/Users/jesse/.vagrant.d/gems/gems/fog-1.18.0/lib/fog/xml/sax_parser_connection.rb:36:in `request'
/Users/jesse/.vagrant.d/gems/gems/fog-1.18.0/lib/fog/core/deprecated/connection.rb:18:in `request'
/Users/jesse/.vagrant.d/gems/gems/fog-1.18.0/lib/fog/aws/compute.rb:434:in `_request'
/Users/jesse/.vagrant.d/gems/gems/fog-1.18.0/lib/fog/aws/compute.rb:429:in `request'
/Users/jesse/.vagrant.d/gems/gems/fog-1.18.0/lib/fog/aws/requests/compute/describe_security_groups.rb:39:in `describe_security_groups'
/Users/jesse/.vagrant.d/gems/gems/fog-1.18.0/lib/fog/aws/models/compute/security_groups.rb:66:in `all'
/Users/jesse/.vagrant.d/gems/gems/vagrant-aws-0.4.1/lib/vagrant-aws/action/run_instance.rb:190:in `block in allows_ssh_port?'
/Users/jesse/.vagrant.d/gems/gems/vagrant-aws-0.4.1/lib/vagrant-aws/action/run_instance.rb:189:in `map'
/Users/jesse/.vagrant.d/gems/gems/vagrant-aws-0.4.1/lib/vagrant-aws/action/run_instance.rb:189:in `allows_ssh_port?'
/Users/jesse/.vagrant.d/gems/gems/vagrant-aws-0.4.1/lib/vagrant-aws/action/run_instance.rb:98:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/jesse/.vagrant.d/gems/gems/vagrant-aws-0.4.1/lib/vagrant-aws/action/warn_networks.rb:14:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/jesse/.vagrant.d/gems/gems/vagrant-aws-0.4.1/lib/vagrant-aws/action/sync_folders.rb:23:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/jesse/.vagrant.d/gems/gems/vagrant-omnibus-1.2.1/lib/vagrant-omnibus/action/install_chef.rb:42:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/jesse/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/upload.rb:25:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/jesse/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/install.rb:33:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/builtin/provision.rb:52:in `call'
/Users/jesse/.vagrant.d/gems/gems/vagrant-cachier-0.5.1/lib/vagrant-cachier/provision_ext.rb:16:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/builder.rb:116:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/runner.rb:69:in `block in run'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/util/busy.rb:19:in `busy'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/runner.rb:69:in `run'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/builtin/call.rb:51:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/jesse/.vagrant.d/gems/gems/vagrant-aws-0.4.1/lib/vagrant-aws/action/connect_aws.rb:41:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/jesse/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/configure_chef.rb:23:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/jesse/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/load_shelf.rb:28:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/jesse/.vagrant.d/gems/gems/vagrant-berkshelf-1.3.7/lib/berkshelf/vagrant/action/set_ui.rb:12:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/builtin/env_set.rb:19:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/builtin/handle_box_url.rb:30:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/builder.rb:116:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/runner.rb:69:in `block in run'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/util/busy.rb:19:in `busy'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/runner.rb:69:in `run'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/machine.rb:147:in `action'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/batch_action.rb:63:in `block (2 levels) in run'
/Users/jesse/.vagrant.d/gems/gems/logging-1.8.1/lib/logging/diagnostic_context.rb:323:in `call'
/Users/jesse/.vagrant.d/gems/gems/logging-1.8.1/lib/logging/diagnostic_context.rb:323:in `block in create_with_logging_context'
jessereynolds commented 10 years ago

Turns out I think I was having DNS issues of some sort when the above occurred.

kenorb commented 8 years ago

I've the same issues when running multiple Vagrant processes at the same time for aws provider. E.g.

~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/socket.rb:100:in `getaddrinfo'~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/socket.rb:100:in `getaddrinfo': getaddrinfo: nodename nor servname provided, or not known (SocketError) (Excon::Errors::SocketError)
: ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/socket.rb:100:in `getaddrinfo'getaddrinfo: nodename nor servname provided, or not known (SocketError) (Excon::Errors::SocketError   from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/socket.rb:100:in `connect'
)
: getaddrinfo: nodename nor servname provided, or not known (SocketError)   from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/ssl_socket.rb:146:in `connect'
 (Excon::Errors::SocketError    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/socket.rb:100: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   from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/ssl_socket.rb:8:in `initialize'
.rb:146:in `connect'
~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/socket.rb:100:in `getaddrinfo'    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/socket.rb:100:in `connect'
~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/socket.rb:100:in `getaddrinfo':   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/socket.rb:28:in `initialize'
getaddrinfo: nodename nor servname provided, or not known (SocketError) (   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/ssl_socket.rb:8:in `initialize'
Excon::Errors::SocketError  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/socket.rb:28: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/ssl_socket.rb:8:in `initialize'
    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:404:in `new'
:   from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/connection.rb:106:in `request_call'

...

getaddrinfo: nodename nor servname provided, or not known (SocketError) from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
 (Excon::Errors::SocketError)
    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'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/socket.rb:100:in `connect'
    from ~/.vagrant.d/gems/gems/vagrant-triggers-0.5.3/lib/vagrant-triggers/action/trigger.rb:17:in `call'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/ssl_socket.rb:146:in `connect'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
    from ~/.vagrant.d/gems/gems/vagrant-triggers-0.5.3/lib/vagrant-triggers/action/trigger.rb:17:in `call'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/socket.rb:28:in `initialize'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/ssl_socket.rb:8:in `initialize'
    from ~/.vagrant.d/gems/gems/vagrant-triggers-0.5.3/lib/vagrant-triggers/action/trigger.rb:17:in `call'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/connection.rb:404:in `new'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/connection.rb:404:in `socket'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builder.rb:116:in `call'
    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 /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:66:in `block in run'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/middlewares/instrumentor.rb:25:in `request_call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/util/busy.rb:19:in `busy'
    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:25 from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:224:in `action_raw'
0:in `request'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:199:in `block in action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:561:in `lock'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:185:in `call'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/middlewares/idempotent.rb:26:in `error_call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:185:in `action'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/middlewares/base.rb:10:in `error_call'
    from ~/.vagrant.d/gems/gems/vagrant-aws-0.7.0/lib/vagrant-aws/provider.rb:32:in `state'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/middlewares/base.rb:10:in `error_call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:501:in `state'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/connection.rb:273:in `rescue in request'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/machine.rb:144:in `initialize'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/vagrantfile.rb:79:in `new'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/vagrantfile.rb:79:in `machine'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/connection.rb:221:in `request'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:663:in `machine'
    from ~/.vagrant.d/gems/gems/excon-0.49.0/lib/excon/middlewares/idempotent.rb:26:in `error_call'
    from ~/.vagrant.d/gems/gems/vagrant-auto_network-1.0.2/lib/auto_network/action/filter_networks.rb:38:in `block in machines_for_env'

This is happening almost every time when I run 2-10 vagrant processes in the background.

Vagrant 1.8.1 with vagrant-aws (0.7.0).

Maybe one Vagrant shouldn't block the socket for another process? It's like I'm trying to run more than 25 instances at the same time (in parallel, separate Vagrant processes), but it's not possible more than that (btw. I've got limit of 200).

Update: I think this probably could mean I've reached the limit of 25 standard volumes, but it's weird method of saying that.