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
ProxyCommand objects need the socket-like-obj _closed fix too #789
Comments
Interestingly, It only implements Since it wraps a |
The exception is gone, thanks!! import paramiko
import time
import logging
import os
ssh_host='localhost'
proxy_cmd='ssh -o StrictHostKeyChecking=no -W localhost:22 localhost'
logging.basicConfig(level=logging.DEBUG)
while True:
logging.debug('running PID %s', os.getpid())
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh_proxy = paramiko.ProxyCommand(proxy_cmd)
ssh.connect(sock=ssh_proxy, hostname=ssh_host)
sftp = ssh.open_sftp()
sftp.close()
ssh.close()
ssh_proxy.close()
logging.debug('going to sleep')
time.sleep(3) Results in: (
The logs after authentication look like this:
I tried changing the 'close' method of ProxyCommand from: Maybe I should use a different order of closing(i.e. sftp/ssh/proxy)? |
Update: changing proxy.py close method to: def close(self):
self.process.kill()
self.process.poll() Resolves the issue(no zombie process leftovers). Though I'm not sure if this has any side-affects. |
Ping. Wonder if we can get this going. I've been testing it for the past weeks and the above fix seems to be working(no zombie processes). |
Thanks for #811, I'll try verifying it on my end when I get to the next bugfix release. (May need to bump it to a feature since we're manipulating the public API, but either way it'll get looked at.) |
Starting to wonder if I should investigate using Invoke's Poking #811 now... |
I can:
I also doublechecked and the impl of Either way I don't think it should block the basic attribute-error-fixing commit from merging so I'm gonna do that and we can spin this discussion into a new ticket if it's still affecting you. Let me know. Thanks! |
@bitprophet - thanks for looking into this. I'll open a new issue if this happens again. |
Hello, I'm running into the same problem using SSH Tunnel(Netcat on jumphost). I get upstate = False I applied the fix #798 in paramiko/proxy.py but im still getting this error. Any clue what should I do next? from datetime import datetime from paramiko.ssh_exception import ProxyCommandFailure class ProxyCommand(ClosingContextManager):
|
See #774 (comment) ; also commutative to #520.
The text was updated successfully, but these errors were encountered: