Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Fabric incorrectly treats a failed connection as an authentication failure when using a gateway. #1542
When connecting through a gateway, fabric will treat a connection failure as an auth failure and give a password prompt (even when using keyed auth).
You can easily reproduce this issue with the following program:
Connecting to a host directly and running this task gives
This same task, run through a gateway gives the following output:
It will continue to loop asking for the password until the host comes back. I did some digging and found that the issue is because paramiko gives a ChannelException when the gateway fails to connect to the remote host. Fabric treats this as a generic SSHException which will in turn cause a reauthentication attempt. I wrote a unit test that reproduces the issue, and a patch that fixes it.
A pull request will follow shortly.