Description
Due diligence
Please try searching the issue tracker for your problem if you haven't already!
If you find related issues that aren't an exact match, feel free to continue
making a report, and link to those issues.
Describe the bug
When I try to use Connection(....).open()
to connect to an ssh host that requires authentication with a key that is not local (i.e. via ssh-agent) but the SSH_AUTH_SOCK is stale, then it hangs forever. This may be acceptable because ssh-add -l
also hangs indefinitely in this scenario, but it's more annoying because I'm not invoking ssh directly so it's not obvious that this is the problem
To Reproduce
Steps to reproduce the behaviour (please attach a minimal example):
- Run
nc -lkU aSocket.sock
in a terminal and leave it running - run
export SSH_AUTH_SOCK=<absolute path to aSocket.sock>
- run
ssh-add -l
, see that it hangs, ^C it - in python do
conn = Connection(host, connect_timeout=1, ...); conn.open();
- See that it hangs forever
Expected behaviour
I would expect the timeout to fire after 1 second
Environment
Make sure your report gets the attention it deserves: bug reports with missing
information may be ignored or punted back to you, delaying a fix. The below
constitutes a bare minimum; more info is almost always better:
- What version of the Python interpreter are you using? Are you using an
alternative interpreter such as PyPy? - What operating system are you using both client & server-side? ubunt-22.04
- Are you using OpenSSH server or something else?
- Which version or versions of the software are you using? fabric==3.1.0
- Have you already tried the latest release? no
- Have you, or can you, try some older releases to pin down where the bug
appeared? my guess is it's been there forever
- How can the developers recreate the bug on their end? If possible, include a
copy of your code, the command you used to invoke it, and the full output of
your run (if applicable.)- A common tactic is to pare down your code until a simple (but still
bug-causing) “base case” remains. Not only can this help you identify
problems which aren’t real bugs, but it means the developer can get to fixing
the bug faster.
- A common tactic is to pare down your code until a simple (but still
Additional context
Add any other context about the problem here.