-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Socket is closed raised on Connection.put() after Connection.close() Connection.open() called #1981
Comments
Definitely is related to the adding following code fixes the issue:
I understand the reason in current implementation, but I think it should have at least an explicit method for sftp client connection closing. EDIT: Or |
I'm being hit by this bug. |
I'm hitting this too - on a box with OpenSSHD V8.8. |
Hello, any chance to have the fix merge ? with ThreadingGroup.from_connections(cclfabric_list) as g:
try:
# This one to fix
# https://github.com/fabric/fabric/issues/1981
for conn in g:
conn._sftp = None
conn.open()
results = g.put(file_to_send, file_to_send)
for r in results:
print(f'Succeeded {r.host}: send file')
g.close()
os.remove(file_to_send)
return True
except GroupException as e:
results = e.result
# Print results
for rf in results.failed:
conn = results.failed[rf]
print(f'Some failed {rf.host}: {conn}')
for rs in results.succeeded:
print(f'Some succeeded {rs.host}: send file')
g.close()
os.remove(file_to_send)
return False |
I've manually tested @davidjmemmett's method and it fixes the issue for me. |
Merging the related PR for 3.0.x line (out soon!) |
Might be related to
Connection.sftp()
:Code to reproduce
Traceback:
The text was updated successfully, but these errors were encountered: