Catch Net::SSH::Disconnect when connecting to SSH
This error was experienced by @pearkes. It is thrown when the remote end unexpectedly closes the remote end. This is usually caused by SSH not being able to properly setup the connection.
This commit is contained in:
parent
639a6a72ed
commit
61621369d2
|
@ -153,6 +153,12 @@ module Vagrant
|
||||||
# This happens if authentication failed. We wrap the error in our
|
# This happens if authentication failed. We wrap the error in our
|
||||||
# own exception.
|
# own exception.
|
||||||
raise Errors::SSHAuthenticationFailed
|
raise Errors::SSHAuthenticationFailed
|
||||||
|
rescue Net::SSH::Disconnect
|
||||||
|
# This happens if the remote server unexpectedly closes the
|
||||||
|
# connection. This is usually raised when SSH is running on the
|
||||||
|
# other side but can't properly setup a connection. This is
|
||||||
|
# usually a server-side issue.
|
||||||
|
raise Errors::SSHDisconnected
|
||||||
rescue Errno::ECONNREFUSED
|
rescue Errno::ECONNREFUSED
|
||||||
# This is raised if we failed to connect the max amount of times
|
# This is raised if we failed to connect the max amount of times
|
||||||
raise Errors::SSHConnectionRefused
|
raise Errors::SSHConnectionRefused
|
||||||
|
|
|
@ -333,6 +333,11 @@ module Vagrant
|
||||||
error_key(:ssh_connection_timeout)
|
error_key(:ssh_connection_timeout)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class SSHDisconnected < VagrantError
|
||||||
|
status_code(83)
|
||||||
|
error_key(:ssh_disconnected)
|
||||||
|
end
|
||||||
|
|
||||||
class SSHKeyBadPermissions < VagrantError
|
class SSHKeyBadPermissions < VagrantError
|
||||||
status_code(12)
|
status_code(12)
|
||||||
error_key(:ssh_key_bad_permissions)
|
error_key(:ssh_key_bad_permissions)
|
||||||
|
|
|
@ -131,6 +131,11 @@ en:
|
||||||
means that the VM booted, but there are issues with the SSH configuration
|
means that the VM booted, but there are issues with the SSH configuration
|
||||||
or network connectivity issues. Please try to `vagrant reload` or
|
or network connectivity issues. Please try to `vagrant reload` or
|
||||||
`vagrant up` again.
|
`vagrant up` again.
|
||||||
|
ssh_disconnected: |-
|
||||||
|
The SSH connection was unexpectedly closed by the remote end. This
|
||||||
|
usually indicates that SSH within the guest machine was unable to
|
||||||
|
properly start up. Please boot the VM in GUI mode to check whether
|
||||||
|
it is booting properly.
|
||||||
ssh_key_bad_permissions: |-
|
ssh_key_bad_permissions: |-
|
||||||
The private key to connect to this box via SSH has invalid permissions
|
The private key to connect to this box via SSH has invalid permissions
|
||||||
set on it. The permissions of the private key should be set to 0600, otherwise SSH will
|
set on it. The permissions of the private key should be set to 0600, otherwise SSH will
|
||||||
|
|
Loading…
Reference in New Issue