Skip to content

Error reading SSH protocol banner during reboot on Ubuntu 24.04 #96

@amrishparmar

Description

@amrishparmar

When attempting to run the reboot command on Ubuntu 24.04, it results in a series of exceptions.

I won't post the full trace as it's very long and they seem to end up in bit of a loop anyway, but relevant sections include

Traceback (most recent call last):
  File "/home/amrish/miniconda3/envs/myenv/lib/python3.12/site-packages/paramiko/transport.py", line 2363, in _check_banner
    buf = self.packetizer.readline(timeout)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/amrish/miniconda3/envs/myenv/lib/python3.12/site-packages/paramiko/packet.py", line 395, in readline
    buf += self._read_timeout(timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/amrish/miniconda3/envs/myenv/lib/python3.12/site-packages/paramiko/packet.py", line 665, in _read_timeout
    raise EOFError()
EOFError

Traceback (most recent call last):
  File "/home/amrish/miniconda3/envs/myenv/lib/python3.12/site-packages/paramiko/transport.py", line 2179, in run
    self._check_banner()
  File "/home/amrish/miniconda3/envs/myenv/lib/python3.12/site-packages/paramiko/transport.py", line 2367, in _check_banner
    raise SSHException(
paramiko.ssh_exception.SSHException: Error reading SSH protocol banner

fabric.exceptions.NetworkError: Error reading SSH protocol banner

Other commands (like run) seem to behave fine.

Potentially also affects other new-ish versions of Ubuntu, but I haven't tried to test with those. This issue doesn't happen on older versions of Ubuntu (e.g. 22.04)

Minimal reproduction:

  1. Set up a remote server running Ubuntu 24.04 that you have SSH access to
  2. Create the following file
  from fabric.api import env, reboot, run, task
  
  env.host_string = "myserver.example.com"
  env.user = "myuser"
  
  @task
  def test_reboot():
      run("echo 'Rebooting server...'")
      reboot()
  1. Run fab test_reboot

Versions:

➜  fab --version                  
fab-classic 1.20.1
Paramiko 4.0.0
Python 3.12.8

I first encountered this a while ago (at least as far back as Jan '25), so don't think it's related to any recent releases of fab-classic or Paramiko.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions