Retry SSH on Errno::EACCES

This commit is contained in:
Mitchell Hashimoto 2013-03-31 20:27:08 -07:00
parent ed97111b88
commit 4f1a3dad8c
4 changed files with 14 additions and 0 deletions

View File

@ -21,6 +21,7 @@ BUG FIXES:
- Show a human-friendly error if VBoxManage is not found (exit
status 126). [GH-934]
- Action hook prepend/append will only prepend or append once.
- Retry SSH on Errno::EACCES.
## 1.1.4 (March 25, 2013)

View File

@ -351,6 +351,10 @@ module Vagrant
error_key(:ssh_authentication_failed)
end
class SSHConnectEACCES < VagrantError
error_key(:ssh_connect_eacces)
end
class SSHConnectionRefused < VagrantError
error_key(:ssh_connection_refused)
end

View File

@ -168,6 +168,7 @@ module VagrantPlugins
# errors that are generally fixed from a retry and don't
# necessarily represent immediate failure cases.
exceptions = [
Errno::EACCES,
Errno::EADDRINUSE,
Errno::ECONNREFUSED,
Errno::ECONNRESET,
@ -203,6 +204,9 @@ module VagrantPlugins
end
end
end
rescue Errno::EACCES
# This happens on connect() for unknown reasons yet...
raise Vagrant::Errors::SSHConnectEACCES
rescue Errno::ETIMEDOUT, Timeout::Error
# This happens if we continued to timeout when attempting to connect.
raise Vagrant::Errors::SSHConnectionTimeout

View File

@ -276,6 +276,11 @@ en:
Vagrant assumes that this means the command failed!
%{command}
ssh_connect_eacces: |-
SSH is getting permission denied errors when attempting to connect
to the IP for SSH. This is usually caused by network rules and not being
able to connect to the specified IP. Please try changing the IP on
which the guest machine binds to for SSH.
ssh_connection_refused: |-
SSH connection was refused! This usually happens if the VM failed to
boot properly. Some steps to try to fix this: First, try reloading your