Skip to content

Error reading SSH protocol banner in high concurrency connection #244

@PKUfjh

Description

@PKUfjh

I recently modify the ssh_context to support totp secret authentication, but when submitting using dflow in high concurrency scenarios, this error often occured. Can anyone know the reason for this error and how to make it more robust?

Exception (client): Error reading SSH protocol banner
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/paramiko/transport.py", line 2271, in _check_banner
    buf = self.packetizer.readline(timeout)
  File "/usr/local/lib/python3.8/site-packages/paramiko/packet.py", line 380, in readline
    buf += self._read_timeout(timeout)
  File "/usr/local/lib/python3.8/site-packages/paramiko/packet.py", line 609, in _read_timeout
    raise EOFError()
EOFError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/paramiko/transport.py", line 2094, in run
    self._check_banner()
  File "/usr/local/lib/python3.8/site-packages/paramiko/transport.py", line 2275, in _check_banner
    raise SSHException(
paramiko.ssh_exception.SSHException: Error reading SSH protocol banner

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/paramiko/transport.py", line 2271, in _check_banner
    buf = self.packetizer.readline(timeout)
  File "/usr/local/lib/python3.8/site-packages/paramiko/packet.py", line 380, in readline
    buf += self._read_timeout(timeout)
  File "/usr/local/lib/python3.8/site-packages/paramiko/packet.py", line 609, in _read_timeout
    raise EOFError()
EOFError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/argo/staging/script", line 46, in <module>
    machine = Machine.load_from_dict(json.loads('{"batch_type": "Slurm", "context_type": "SSHContext", "local_root": ".", "remote_root": "/home/fanjiahao/dflow/workflows", "remote_profile": {"hostname": "101.200.149.59", "username": "fanjiahao", "port": 22, "timeout": 60, "password": "6tjfP8zE/PkYo8Mx"}}'))
  File "/usr/local/lib/python3.8/site-packages/dpdispatcher/machine.py", line 129, in load_from_dict
    context = BaseContext.load_from_dict(machine_dict)
  File "/usr/local/lib/python3.8/site-packages/dpdispatcher/base_context.py", line 35, in load_from_dict
    context = context_class.load_from_dict(context_dict)
  File "/usr/local/lib/python3.8/site-packages/dpdispatcher/ssh_context.py", line 331, in load_from_dict
    ssh_context = cls(
  File "/usr/local/lib/python3.8/site-packages/dpdispatcher/ssh_context.py", line 304, in __init__
    self.ssh_session = SSHSession(**remote_profile)
  File "/usr/local/lib/python3.8/site-packages/dpdispatcher/ssh_context.py", line 44, in __init__
    self._setup_ssh()
  File "/usr/local/lib/python3.8/site-packages/dpdispatcher/ssh_context.py", line 133, in _setup_ssh
    ts.start_client(timeout=self.timeout)
  File "/usr/local/lib/python3.8/site-packages/paramiko/transport.py", line 699, in start_client
    raise e
  File "/usr/local/lib/python3.8/site-packages/paramiko/transport.py", line 2094, in run
    self._check_banner()
  File "/usr/local/lib/python3.8/site-packages/paramiko/transport.py", line 2275, in _check_banner
    raise SSHException(
paramiko.ssh_exception.SSHException: Error reading SSH protocol banner

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions