Skip to content

Commit

Permalink
Rescue EPIPE on connect in ssh transport
Browse files Browse the repository at this point in the history
SSH will raise an Errno::EPIPE if the remote server closes the
connection unexpectedly. This can happen, for example, in cases where a
user has an improperly configured ProxyCommand for that host in
`~/.ssh/config`.

Adding EPIPE to the set of exceptions to rescue ensures that we raise
Train::Transports::SSHFailed which callers of train my already be
rescuing.
  • Loading branch information
stevendanna authored and chris-rock committed Aug 17, 2016
1 parent e1da796 commit 5fe5151
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/train/transports/ssh_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def uri

RESCUE_EXCEPTIONS_ON_ESTABLISH = [
Errno::EACCES, Errno::EADDRINUSE, Errno::ECONNREFUSED, Errno::ETIMEDOUT,
Errno::ECONNRESET, Errno::ENETUNREACH, Errno::EHOSTUNREACH,
Errno::ECONNRESET, Errno::ENETUNREACH, Errno::EHOSTUNREACH, Errno::EPIPE,
Net::SSH::Disconnect, Net::SSH::AuthenticationFailed, Net::SSH::ConnectionTimeout,
Timeout::Error
].freeze
Expand Down

0 comments on commit 5fe5151

Please sign in to comment.