-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
'YDocWebSocketHandler' object has no attribute 'room' #321
Comments
Could you try updating to jupyter-collaboration v3.0.0.a2? |
Is this (the v3.0a2 issue) when opening a plain text file or when opening the CAD file? |
It was when opening a CAD file. We should try to upgrade jupyter collaboration there with the recent beta. |
I can reproduce this exception when attempting to create a test notebook on HTTPServerRequest(protocol='http', host='127.0.0.1:35807', method='GET', uri='/a%40b/api/collaboration/room/json:notebook:649151c4-1672-4ad7-83e6-a91a79e2e963?sessionId=fef3429c-4cff-4dcf-ac61-97cad81c2b8b', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
File "/site-packages/tornado/web.py", line 1790, in _execute
result = await result
^^^^^^^^^^^^
File "/jupyter_collaboration/projects/jupyter-server-ydoc/jupyter_server_ydoc/handlers.py", line 210, in get
return await super().get(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/site-packages/tornado/websocket.py", line 273, in get
await self.ws_connection.accept_connection(self)
File "/site-packages/tornado/websocket.py", line 863, in accept_connection
await self._accept_connection(handler)
File "/site-packages/tornado/websocket.py", line 946, in _accept_connection
await self._receive_frame_loop()
File "/site-packages/tornado/websocket.py", line 1105, in _receive_frame_loop
self.handler.on_ws_connection_close(self.close_code, self.close_reason)
File "/site-packages/tornado/websocket.py", line 571, in on_ws_connection_close
self.on_connection_close()
File "/site-packages/tornado/websocket.py", line 563, in on_connection_close
self.on_close()
File "/jupyter_collaboration/projects/jupyter-server-ydoc/jupyter_server_ydoc/handlers.py", line 339, in on_close
if isinstance(self.room, DocumentRoom) and self.room.clients == [self]:
^^^^^^^^^
AttributeError: 'YDocWebSocketHandler' object has no attribute 'room' This can be uncovered by adding the following pytest test: @pytest.mark.parametrize("copy", [True, False])
async def test_get_document_notebook(rtc_create_notebook, jp_serverapp, copy):
path, content = await rtc_create_notebook("test.ipynb", "test", store=True)
collaboration = jp_serverapp.web_app.settings["jupyter_server_ydoc"]
document = await collaboration.get_document(
path=path, content_type="notebook", file_format="json", copy=copy
)
assert document.get() == content == "test"
await collaboration.stop_extension() |
Note that the content (
then it does not throw. It looks like exception handling may be off here. |
Any progress on this? On a clean, fresh install of jupyterlab with python 3.12 with mambaforge, I basically can't open any existing notebooks as I get pages and pages of these errors. I had to uninstall the collab machinery entirely so I could at least get work done. Given this is on a fully clean install on an otherwise empty system, I'm pretty concerned that it is likely to hit users very easily... And it's a hard blocker - nothing works, documents can't be opened, nor even closed: the UI hangs in a weird state. |
As per my previous reply, I think this error message is a red herring. It is basically error which shows up when the connection closes if there is a different error which lead to the connection closure. The immediate action item is to expose the real error so that we can address potentially multiple underlying problems. Do you also see this on newly created notebooks or only on existing notebooks? If it is the latter, can you share such an existing notebook? I do not experience the problem you are facing but none of the deployments I manage use Python 3.12, and I am using the bleeding edge beta of version 3. I hope that with version 3/JupyterLab 4.3 - also in beta - many bugs will be ironed out to make it production-ready (for now I would not advise trying the beta yet - unless you have patience to follow some workarounds that I can share - as there are known issues in works). |
From using more RTC a bit more, I seem to be able to get a clean working setup when starting fresh and removing the |
Mmh, on a completely clean install from scratch, made right now by downloading miniforge3 and adding my default packages, and after deleting the Basically (at least on this machine), the only way to use Jupyter for anything is to entirely remove |
@fperez I created an environment using your environment.yml using pixi init --import environment.yml
pixi shell
jupyter lab It's strange that you are mentioning |
Ah, you may be onto something... It seems the culprit is a version pin in JupyterLab:
I had Lab 4.2.5, which kept me pinned at collab 2.1.0. I can't upgrade jupyter-collaboration to 2.1.4 without downgrading JupyterLab. |
I can confirm that once I allow the JuptyerLab downgrade to 4.1.8 and install collab 2.1.4, it works fine. So whatever the bug was in collab was indeed fixed, thanks! The problem we have now is this version pin in JupyterLab, which may end up leaving users locked into an older version of collab with the bug. Thanks for the pointer! |
It seems to be a conda issue, because with |
Actually conda-forge was doing the right thing. I released jupyter-collaboration v2.1.5 which fixes the issue. |
Awesome, thanks so much @davidbrochart!! Glad we tracked this down :) |
Thank you for reporting the issue! |
I'm getting the following error with jupyter-collaboration 2.1.1:
The text was updated successfully, but these errors were encountered: