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

Error in asyncio client.py #87

Open
Ben-Herz opened this issue Dec 13, 2024 · 1 comment
Open

Error in asyncio client.py #87

Ben-Herz opened this issue Dec 13, 2024 · 1 comment

Comments

@Ben-Herz
Copy link

We run jupyterhub-ssh in a jupyterhub 4.1.5 Docker container

When we try to connect, we get the following error in the debug output and the message closed by remote host:

root@jupyterhub:/opt/jupyterhub_ssh# python -m jupyterhub_ssh --debug
[JupyterHubSSH] Looking for jupyterhub_ssh_config in /opt/jupyterhub_ssh
[JupyterHubSSH] Loaded config file: /opt/jupyterhub_ssh/jupyterhub_ssh_config.py
[asyncssh] Creating SSH listener on port 8022
[asyncssh] [conn=0] Accepted SSH client connection
[asyncssh] [conn=0] Local address: ..., port 8022
[asyncssh] [conn=0] Peer address: ..., port *****
[asyncssh] [conn=0] Sending version SSH-2.0-AsyncSSH_2.18.0
[asyncssh] [conn=0] Received version SSH-2.0-OpenSSH_for_Windows_9.5
[asyncssh] [conn=0] Requesting key exchange
[asyncssh] [conn=0] Received key exchange request
[asyncssh] [conn=0] Beginning key exchange
[asyncssh] [conn=0] Completed key exchange
[asyncssh] [conn=0] Beginning auth for user ****
[asyncssh] [conn=0] Trying keyboard-interactive auth
[asyncssh] [conn=0] Trying keyboard-interactive auth
[asyncssh] [conn=0] Auth for user **** succeeded
[asyncssh] [conn=0] Sending server host keys disabled
[asyncssh] [conn=0, chan=0] Set write buffer limits: low-water=16384, high-water=65536
[asyncssh] [conn=0, chan=0] New SSH session requested
[asyncssh] [conn=0, chan=0] Terminal type: xterm-256color
[asyncssh] [conn=0, chan=0] Terminal size: 120x30 (640x480 pixels)
[asyncssh] [conn=0, chan=0] PTY created
[asyncssh] [conn=0, chan=0] Interactive shell requested
[asyncssh] [conn=0, chan=0] Uncaught exception
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/asyncssh/connection.py", line 1088, in _reap_task
task.result()
File "/usr/local/lib/python3.10/dist-packages/jupyterhub_ssh/init.py", line 155, in _handle_client
async with ClientSession() as client, Terminado(
File "/usr/local/lib/python3.10/dist-packages/jupyterhub_ssh/terminado.py", line 27, in aenter
self.ws = await websockets.connect(str(ws_url), extra_headers=self.headers)
File "/usr/local/lib/python3.10/dist-packages/websockets/asyncio/client.py", line 442, in await_impl
self.connection = await self.create_connection()
File "/usr/local/lib/python3.10/dist-packages/websockets/asyncio/client.py", line 368, in create_connection
_, connection = await loop.create_connection(factory, **kwargs)
TypeError: BaseEventLoop.create_connection() got an unexpected keyword argument 'extra_headers'
[asyncssh] [conn=0, chan=0] Closing channel due to connection close
[asyncssh] [conn=0, chan=0] Channel closed: BaseEventLoop.create_connection() got an unexpected keyword argument 'extra_headers'

@yuvipanda
Copy link
Owner

I recommend using https://github.com/yuvipanda/jupyter-sshd-proxy instead now. It was my next attempt at doing this, and is built with lessons learned from here!

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

2 participants