Skip to content
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

Excessive exception on TCP-probe #1682

Open
clmbrdude opened this issue May 12, 2020 · 0 comments
Open

Excessive exception on TCP-probe #1682

clmbrdude opened this issue May 12, 2020 · 0 comments

Comments

@clmbrdude
Copy link

We are running a paramiko sftp server in kubernetes.
To monitor that the server is up we have configured a TCP probe on port 22 to run every 10 seconds. Also we are running a load balancing nginx instance in front of the sftp servers, that will use a TCP probe the find out if the servers are alive.

Problem is that the logfiles are filled with exceptions looking like this:

paramiko.transport ERROR <host:4b4ade56cc9e> Exception: Error reading SSH protocol banner
paramiko.transport ERROR <host:4b4ade56cc9e> Traceback (most recent call last):
paramiko.transport ERROR <host:4b4ade56cc9e>   File "/usr/local/lib/python3.7/site-packages/paramiko/transport.py", line 2138, in _check_banner
paramiko.transport ERROR <host:4b4ade56cc9e>     buf = self.packetizer.readline(timeout)
paramiko.transport ERROR <host:4b4ade56cc9e>   File "/usr/local/lib/python3.7/site-packages/paramiko/packet.py", line 367, in readline
paramiko.transport ERROR <host:4b4ade56cc9e>     buf += self._read_timeout(timeout)
paramiko.transport ERROR <host:4b4ade56cc9e>   File "/usr/local/lib/python3.7/site-packages/paramiko/packet.py", line 563, in _read_timeout
paramiko.transport ERROR <host:4b4ade56cc9e>     raise EOFError()
paramiko.transport ERROR <host:4b4ade56cc9e> EOFError
paramiko.transport ERROR <host:4b4ade56cc9e> 
paramiko.transport ERROR <host:4b4ade56cc9e> During handling of the above exception, another exception occurred:
paramiko.transport ERROR <host:4b4ade56cc9e> 
paramiko.transport ERROR <host:4b4ade56cc9e> Traceback (most recent call last):
paramiko.transport ERROR <host:4b4ade56cc9e>   File "/usr/local/lib/python3.7/site-packages/paramiko/transport.py", line 1966, in run
paramiko.transport ERROR <host:4b4ade56cc9e>     self._check_banner()
paramiko.transport ERROR <host:4b4ade56cc9e>   File "/usr/local/lib/python3.7/site-packages/paramiko/transport.py", line 2143, in _check_banner
paramiko.transport ERROR <host:4b4ade56cc9e>     "Error reading SSH protocol banner" + str(e)
paramiko.transport ERROR <host:4b4ade56cc9e> paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
paramiko.transport ERROR <host:4b4ade56cc9e> 

It seems that the method _check_banner() will cause these exceptions to be raised if conecctions is dropped before a banner is sent.
The "easy" fix would be to catch and reraise the EOFError, i.e.

            except EOFError:
                raise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant