Skip to content

Getting frequent AssertionError exceptions when forwarding TCP #765

@misa-hase

Description

@misa-hase

I'm running asyncssh 2.21.0 on my server as a reverse SSH listener - using asyncssh.listen_reverse - which forwards 2 TCP ports to my local host using forward_local_port.
It's been working great but as the number of connections to the asyncssh server have increased I've started getting frequent forwarding-related AssertionErrors on connection_lost callback:

 Traceback (most recent call last):
  File "asyncssh/connection.py", line 1529, in _recv_data
  File "asyncssh/connection.py", line 1689, in _recv_packet
  File "asyncssh/packet.py", line 238, in process_packet
  File "asyncssh/channel.py", line 628, in _process_eof
  File "asyncssh/channel.py", line 357, in _flush_recv_buf
  File "asyncssh/forward.py", line 155, in eof_received
  File "asyncssh/forward.py", line 94, in write_eof
AssertionError

The assertion itself seems to be assert self._transport is not None from write_eof in asyncssh/forward.py.
For whatever reason my self._transport ends up becoming None?

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