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

Some notebooks fail to open #162

Closed
tilosp opened this issue Jun 10, 2023 · 41 comments
Closed

Some notebooks fail to open #162

tilosp opened this issue Jun 10, 2023 · 41 comments
Labels
bug Something isn't working

Comments

@tilosp
Copy link

tilosp commented Jun 10, 2023

Description

Notebook loads forever and the log gets spammed with:

[E 2023-06-10 08:42:25.572 YDocExtension] Error watching file: work/somenb.ipynb
    TypeError("'<' not supported between instances of 'NoneType' and 'datetime.datetime'")
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.10/site-packages/jupyter_collaboration/loaders.py", line 170, in _watch_file
        await self.notify()
      File "/opt/conda/lib/python3.10/site-packages/jupyter_collaboration/loaders.py", line 187, in notify
        await callback("metadata", model)
      File "/opt/conda/lib/python3.10/site-packages/jupyter_collaboration/rooms.py", line 190, in _on_content_change
        if event == "metadata" and self._last_modified < args["last_modified"]:
    TypeError: '<' not supported between instances of 'NoneType' and 'datetime.datetime'
@tilosp tilosp added the bug Something isn't working label Jun 10, 2023
@welcome
Copy link

welcome bot commented Jun 10, 2023

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@aghand0ur
Copy link

I am recently getting the same issue after installing jupyter rtc
any insights?

I am also hitting this warning which I tracked to the below line of code:
Two collaborative sessions are accessing the file xxxxxxxxxxxxxx simultaneously. Opening a document with multiple views simultaneously is not supported. Please close one view; otherwise, you might lose some of your progress.

Github Link

Any idea what I am doing wrong exactly? I guess the purpose behind RTC is to be able to open the same file from different locations…

@hbcarlos
Copy link
Member

Fixed by #157

@hbcarlos
Copy link
Member

hbcarlos commented Jun 30, 2023

I am also hitting this warning which I tracked to the below line of code:
Two collaborative sessions are accessing the file xxxxxxxxxxxxxx simultaneously. Opening a document with multiple views simultaneously is not supported. Please close one view; otherwise, you might lose some of your progress.

Hi @aghand0ur, thank you for reporting this.
The message is wrong. It should say something like ... simultaneously with different types of view is not supported. ....
It means that opening the same document with two different views (in the same client or other clients) is not supported. For example, in JupyterLab, you can open a notebook with the Notebook Editor or the Editor (by right click -> open with -> Editor). These two editors use a different model (which means it uses a different schema or set of data structures to load the data in memory). We can not sync those two models between them, and since they are both accessing the same file, one editor could overwrite the progress made with the other editor.

In summary, you can collaborate between Notebook Editor and Notebook Editor on different clients but not between Notebook Editor and Editor (either the same client or another client).

FYI, Editor is the plain text editor, and Notebook Editor is the notebook.

@aghand0ur
Copy link

thanks for the elaborative reply @hbcarlos

@aghand0ur
Copy link

@hbcarlos

Fixed by #157

The error persists with the new PR:

Jul 05 16:12:00 jamada jupyter-lab[937]: [E 2023-07-05 16:12:00.675 YDocExtension] Error watching file: jupyterlab/eo-xai/CityscapesNoiseEfficient-noise1/Unoise_eval_method.ipynb
Jul 05 16:12:00 jamada jupyter-lab[937]:     TypeError("'<' not supported between instances of 'NoneType' and 'datetime.datetime'")
Jul 05 16:12:00 jamada jupyter-lab[937]:     Traceback (most recent call last):
Jul 05 16:12:00 jamada jupyter-lab[937]:       File "/home/jamada/.local/lib/python3.10/site-packages/jupyter_collaboration/loaders.py", line 170, in _watch_file
Jul 05 16:12:00 jamada jupyter-lab[937]:         await self.notify()
Jul 05 16:12:00 jamada jupyter-lab[937]:       File "/home/jamada/.local/lib/python3.10/site-packages/jupyter_collaboration/loaders.py", line 187, in notify
Jul 05 16:12:00 jamada jupyter-lab[937]:         await callback("metadata", model)
Jul 05 16:12:00 jamada jupyter-lab[937]:       File "/home/jamada/.local/lib/python3.10/site-packages/jupyter_collaboration/rooms.py", line 190, in _on_content_change
Jul 05 16:12:00 jamada jupyter-lab[937]:         if event == "metadata" and self._last_modified < args["last_modified"]:
Jul 05 16:12:00 jamada jupyter-lab[937]:     TypeError: '<' not supported between instances of 'NoneType' and 'datetime.datetime'
Jul 05 16:12:01 jamada jupyter-lab[937]: [W 2023-07-05 16:12:01.139 ServerApp] SSL Error on 45 ('100.83.67.115', 53059): [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] sslv3 alert certif>
Jul 05 16:12:01 jamada jupyter-lab[937]: [E 2023-07-05 16:12:01.678 YDocExtension] Error watching file: jupyterlab/eo-xai/CityscapesNoiseEfficient-noise1/Unoise_eval_method.ipynb
Jul 05 16:12:01 jamada jupyter-lab[937]:     TypeError("'<' not supported between instances of 'NoneType' and 'datetime.datetime'")
Jul 05 16:12:01 jamada jupyter-lab[937]:     Traceback (most recent call last):
Jul 05 16:12:01 jamada jupyter-lab[937]:       File "/home/jamada/.local/lib/python3.10/site-packages/jupyter_collaboration/loaders.py", line 170, in _watch_file
Jul 05 16:12:01 jamada jupyter-lab[937]:         await self.notify()
Jul 05 16:12:01 jamada jupyter-lab[937]:       File "/home/jamada/.local/lib/python3.10/site-packages/jupyter_collaboration/loaders.py", line 187, in notify
Jul 05 16:12:01 jamada jupyter-lab[937]:         await callback("metadata", model)
Jul 05 16:12:01 jamada jupyter-lab[937]:       File "/home/jamada/.local/lib/python3.10/site-packages/jupyter_collaboration/rooms.py", line 190, in _on_content_change
Jul 05 16:12:01 jamada jupyter-lab[937]:         if event == "metadata" and self._last_modified < args["last_modified"]:
Jul 05 16:12:01 jamada jupyter-lab[937]:     TypeError: '<' not supported between instances of 'NoneType' and 'datetime.datetime'

@aghand0ur
Copy link

I guess we need to re-open this issue

@martinRenou
Copy link
Member

The package was not released yet with the fix, or have you installed a dev version of jupyter-collaboration?

@hbcarlos
Copy link
Member

hbcarlos commented Jul 5, 2023

Hi, @aghand0ur. That trace doesn't correspond with the main branch.

Jul 05 16:12:01 jamada jupyter-lab[937]:       File "/home/jamada/.local/lib/python3.10/site-packages/jupyter_collaboration/rooms.py", line 190, in _on_content_change
Jul 05 16:12:01 jamada jupyter-lab[937]:         if event == "metadata" and self._last_modified < args["last_modified"]:
Jul 05 16:12:01 jamada jupyter-lab[937]:     TypeError: '<' not supported between instances of 'NoneType' and 'datetime.datetime'

packages/jupyter_collaboration/rooms.py", line 190, in _on_content_change is now checking that the property self._last_modified is not null. See:

if event == "metadata" and (
self._last_modified is None or self._last_modified < args["last_modified"]
):

@aghand0ur
Copy link

no I installed version 1.0.1 released on 29 June 2023..
so the fix is not contained there?
shall I clone and compile the main branch?

@martinRenou
Copy link
Member

If you absolutely want the fix today yes. Otherwise you could wait for a release to be made.

@aghand0ur
Copy link

any idea when is the planned coming release?

@cw00dw0rd
Copy link

This issue is still present in 1.1.0

I only ever open the notebooks via double clicking from the file browser menu. I assume this is the notebook editor. There also seems to be no way to track where and how the files are opened, such as a session management feature?

In my experience, I open a notebook make some changes, navigate away from the server site and come back some time later and start receiving these errors.

@jonashoechst
Copy link

I also come across exactly this error quite regularly. Running Jupyter via the docker jupyter/datascience-notebook image which includes the most recent v1.2.0 of Jupyter-collaboration.

[E 2023-09-21 14:25:51.400 YDocExtension] Error watching file: debug.ipynb
    TypeError("'<' not supported between instances of 'NoneType' and 'datetime.datetime'")
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.11/site-packages/jupyter_collaboration/loaders.py", line 170, in _watch_file
        await self.notify()
      File "/opt/conda/lib/python3.11/site-packages/jupyter_collaboration/loaders.py", line 187, in notify
        await callback("metadata", model)
      File "/opt/conda/lib/python3.11/site-packages/jupyter_collaboration/rooms.py", line 190, in _on_content_change
        if event == "metadata" and self._last_modified < args["last_modified"]:
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    TypeError: '<' not supported between instances of 'NoneType' and 'datetime.datetime'

@chuyqa
Copy link

chuyqa commented Oct 9, 2023

I hit this issue as well with jupyter_collaboration 1.2.0, and could no longer create new notebooks-- only copy existing nbs and then rename.

Fwiw monkey-patching rooms.py single line to:

        if event == "metadata" and (self._last_modified is None or self._last_modified < args["last_modified"]):

Fixed it for me until main branch has a new release.

@aghand0ur
Copy link

@martinRenou @hbcarlos shall this issue be re-opened?

@hbcarlos hbcarlos reopened this Oct 10, 2023
@krassowski
Copy link
Member

krassowski commented Oct 10, 2023

Hi, @aghand0ur. That trace doesn't correspond with the main branch.

Jul 05 16:12:01 jamada jupyter-lab[937]:       File "/home/jamada/.local/lib/python3.10/site-packages/jupyter_collaboration/rooms.py", line 190, in _on_content_change
Jul 05 16:12:01 jamada jupyter-lab[937]:         if event == "metadata" and self._last_modified < args["last_modified"]:
Jul 05 16:12:01 jamada jupyter-lab[937]:     TypeError: '<' not supported between instances of 'NoneType' and 'datetime.datetime'

packages/jupyter_collaboration/rooms.py", line 190, in _on_content_change is now checking that the property self._last_modified is not null. See:

if event == "metadata" and (
self._last_modified is None or self._last_modified < args["last_modified"]
):

Both wheel and source distributions uploaded to PyPI contain the problematic line rather than what is there on the main branch. Is there a problem with the release process?

image

@krassowski
Copy link
Member

Well, I guess not - this was just not backported to 1.x branch:

if event == "metadata" and self._last_modified < args["last_modified"]:

@nwalters512
Copy link

I see this too after installing jupyter-collaboration==1.2.0. I see a log like the following printed once per second once I try to open a notebook:

[E 2023-10-12 21:18:41.495 YDocExtension] Error watching file: Workbook.ipynb
    TypeError("'<' not supported between instances of 'NoneType' and 'datetime.datetime'")
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.11/site-packages/jupyter_collaboration/loaders.py", line 170, in _watch_file
        await self.notify()
      File "/opt/conda/lib/python3.11/site-packages/jupyter_collaboration/loaders.py", line 187, in notify
        await callback("metadata", model)
      File "/opt/conda/lib/python3.11/site-packages/jupyter_collaboration/rooms.py", line 190, in _on_content_change
        if event == "metadata" and self._last_modified < args["last_modified"]:
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    TypeError: '<' not supported between instances of 'NoneType' and 'datetime.datetime'

If I disable RTC by adding c.YDocExtension.disable_rtc = True to my jupyter_server_config.py config file, this error goes away and I can once again open notebooks.

In case it's relevant, this is in a Docker image based on jupyter/minimal-notebook:2023-10-02.

@hbcarlos
Copy link
Member

Hi, @aghand0ur and @nwalters512.

There is a new pre-release with a fix for this issue. Could you check whether this issue persists with the new v2.0.0-alpha.1?

You can install the new pre-release in a new environment with:

pip install jupyter-collaboration --pre

@aghand0ur
Copy link

aghand0ur commented Nov 16, 2023

@hbcarlos
Currently testing your alpha release (2.0.0a4) and will let you know in case some issues were faced

@aghand0ur
Copy link

@hbcarlos,
It was noticed by @Hasanmog that images loading failed per below image and logs:
image

[I 2023-11-21 19:20:26.441 ServerApp] Request for Y document 'jupyterlab/gdino-peft/test.jpg' with room ID: 35699d11-d427-468e-aa73-cc4b6c7c3881
[W 2023-11-21 19:20:26.603 ServerApp] SSL Error on 47 ('10.0.0.19', 21333): [SSL: SSLV3_ALERT_CERTIFICATE_UNKNOWN] sslv3 alert certificate unknown (_ss>
[I 2023-11-21 19:20:26.717 ServerApp] New client connecting to room: base64:file:35699d11-d427-468e-aa73-cc4b6c7c3881
[I 2023-11-21 19:20:26.717 YDocExtension] Creating FileLoader for: jupyterlab/gdino-peft/test.jpg
[I 2023-11-21 19:20:26.718 YDocExtension] Initializing room base64:file:35699d11-d427-468e-aa73-cc4b6c7c3881
[I 2023-11-21 19:20:26.719 YDocExtension] Watching file: jupyterlab/gdino-peft/test.jpg
[I 2023-11-21 19:20:26.726 YDocExtension] Content in room base64:file:35699d11-d427-468e-aa73-cc4b6c7c3881 loaded from file jupyterlab/gdino-peft/test.>

@martinRenou
Copy link
Member

This issue should be reopened and a fix should be provided for 1.x and 2.x. I'm looking into making a PR.

@davidbrochart davidbrochart reopened this Dec 19, 2023
@martinRenou
Copy link
Member

Actually it is fixed in 2.x but not backported.

@davidbrochart
Copy link
Collaborator

And 2.x is not merged, right?

@martinRenou
Copy link
Member

Sorry I did not mean the 2.x branch but the 2.x releases

@martinRenou
Copy link
Member

We should probably reset the 2.x branch to main to remove this confusion

@davidbrochart
Copy link
Collaborator

What do you mean by "reset"? I think 2.x still has to be reviewed.

@martinRenou
Copy link
Member

martinRenou commented Dec 20, 2023

Then "renamed" and not "reset".

@davidbrochart
Copy link
Collaborator

Maybe yes, what about renaming 2.x to 3.x?

@davidbrochart
Copy link
Collaborator

Done: 3.x.

@aghand0ur
Copy link

does the new 2.0.1 release cover this issue?

@davidbrochart
Copy link
Collaborator

Yes, it should be fixed since v2.0.0.

@aghand0ur
Copy link

Right but another issue popped-up as outlined here:
#162 (comment)

@davidbrochart
Copy link
Collaborator

I opened #229.

@EduardDurech
Copy link

EduardDurech commented Mar 18, 2024

This issue seems to be happening for some files as well only with RTC

Document session error
Error initializing: foofile.ipynb.
You need to close the document.

whenever I open with RTC:

Here is the log
[I 2024-03-18 10:13:44.493 ServerApp] Request for Y document 'foofile.ipynb' with room ID: 5621191c-8a5f-4b5e-823c-36055d811d86
[I 2024-03-18 10:13:44.673 YDocExtension] Creating FileLoader for: foofile.ipynb
[I 2024-03-18 10:13:44.673 YDocExtension] Watching file: foofile.ipynb
[I 2024-03-18 10:13:44.674 ServerApp] Initializing room json:notebook:5621191c-8a5f-4b5e-823c-36055d811d86
[I 2024-03-18 10:13:44.860 ServerApp] Kernel started: daef3650-5d84-4b7a-8ad2-cb43f85b00b8
[I 2024-03-18 10:13:45.212 ServerApp] Connecting to kernel daef3650-5d84-4b7a-8ad2-cb43f85b00b8.
[I 2024-03-18 10:13:45.218 ServerApp] Connecting to kernel daef3650-5d84-4b7a-8ad2-cb43f85b00b8.
[I 2024-03-18 10:13:45.222 ServerApp] Connecting to kernel daef3650-5d84-4b7a-8ad2-cb43f85b00b8.
[I 2024-03-18 10:13:45.808 ServerApp] Content in room json:notebook:5621191c-8a5f-4b5e-823c-36055d811d86 loaded from the ystore SQLiteYStore
[E 2024-03-18 10:13:45.809 ServerApp] Error initializing: foofile.ipynb
    KeyError('nbformat')
    Traceback (most recent call last):
      File "/usr/local/lib/python3.10/dist-packages/jupyter_collaboration/handlers.py", line 186, in open
        await self.room.initialize()
      File "/usr/local/lib/python3.10/dist-packages/jupyter_collaboration/rooms.py", line 125, in initialize
        if self._document.source != model["content"]:
      File "/usr/local/lib/python3.10/dist-packages/jupyter_ydoc/ybasedoc.py", line 70, in source
        return self.get()
      File "/usr/local/lib/python3.10/dist-packages/jupyter_ydoc/ynotebook.py", line 187, in get
        cell = self.get_cell(i)
      File "/usr/local/lib/python3.10/dist-packages/jupyter_ydoc/ynotebook.py", line 103, in get_cell
        if "id" in cell and meta["nbformat"] == 4 and meta["nbformat_minor"] <= 4:
    KeyError: 'nbformat'
[I 2024-03-18 10:13:45.809 ServerApp] Deleting Y document from memory: json:notebook:5621191c-8a5f-4b5e-823c-36055d811d86
[I 2024-03-18 10:13:45.809 ServerApp] Room json:notebook:5621191c-8a5f-4b5e-823c-36055d811d86 deleted
[I 2024-03-18 10:13:45.809 ServerApp] Deleting file foofile.ipynb
2024-03-18 10:13:45,810 - ServerApp - ERROR - Exception in callback functools.partial(<function WebSocketProtocol._run_callback.<locals>.<lambda> at 0x7fdeba74e710>, <Task finished name='Task-4842' coro=<YDocWebSocketHandler.on_message() done, defined at /usr/local/lib/python3.10/dist-packages/jupyter_collaboration/handlers.py:226> exception=AttributeError("'YDocWebSocketHandler' object has no attribute 'room'")>)
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/tornado/ioloop.py", line 738, in _run_callback
    ret = callback()
  File "/usr/local/lib/python3.10/dist-packages/tornado/websocket.py", line 639, in <lambda>
    self.stream.io_loop.add_future(result, lambda f: f.result())
  File "/usr/local/lib/python3.10/dist-packages/jupyter_collaboration/handlers.py", line 235, in on_message
    changes = self.room.awareness.get_changes(message[1:])
AttributeError: 'YDocWebSocketHandler' object has no attribute 'room'
2024-03-18 10:13:45,810 - ServerApp - ERROR - Uncaught exception GET /api/collaboration/room/json:notebook:5621191c-8a5f-4b5e-823c-36055d811d86?sessionId=cbecf1ea-6785-4005-9aaf-609e296eda3f (127.0.0.1)
HTTPServerRequest(protocol='http', host='localhost:8800', method='GET', uri='/api/collaboration/room/json:notebook:5621191c-8a5f-4b5e-823c-36055d811d86?sessionId=cbecf1ea-6785-4005-9aaf-609e296eda3f', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/tornado/web.py", line 1786, in _execute
    result = await result
  File "/usr/local/lib/python3.10/dist-packages/jupyter_collaboration/handlers.py", line 163, in get
    return await super().get(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/tornado/websocket.py", line 272, in get
    await self.ws_connection.accept_connection(self)
  File "/usr/local/lib/python3.10/dist-packages/tornado/websocket.py", line 862, in accept_connection
    await self._accept_connection(handler)
  File "/usr/local/lib/python3.10/dist-packages/tornado/websocket.py", line 945, in _accept_connection
    await self._receive_frame_loop()
  File "/usr/local/lib/python3.10/dist-packages/tornado/websocket.py", line 1101, in _receive_frame_loop
    await self._receive_frame()
  File "/usr/local/lib/python3.10/dist-packages/tornado/websocket.py", line 1192, in _receive_frame
    await handled_future
AttributeError: 'YDocWebSocketHandler' object has no attribute 'room'
[I 2024-03-18 10:14:43.955 YDocExtension] Processed 13 Y patches in one minute
[I 2024-03-18 10:14:43.956 YDocExtension] Connected Y users: 1
2024-03-17.18-52-35.mp4

These files were working before in RTC so not sure what caused them to stop working but the nbformat log is fixed by shutting it down (important, as it seems to overwrite the fixed file if open) and running

python3 -c "import nbformat; nb = nbformat.read(open('foofile.ipynb'), as_version=4); nbformat.write(nb, open('foofile.ipynb', 'w'))"

then it works, for anyone looking for a fix

@EduardDurech
Copy link

I am also hitting this warning which I tracked to the below line of code:
Two collaborative sessions are accessing the file xxxxxxxxxxxxxx simultaneously. Opening a document with multiple views simultaneously is not supported. Please close one view; otherwise, you might lose some of your progress.

Hi @aghand0ur, thank you for reporting this. The message is wrong. It should say something like ... simultaneously with different types of view is not supported. .... It means that opening the same document with two different views (in the same client or other clients) is not supported. For example, in JupyterLab, you can open a notebook with the Notebook Editor or the Editor (by right click -> open with -> Editor). These two editors use a different model (which means it uses a different schema or set of data structures to load the data in memory). We can not sync those two models between them, and since they are both accessing the same file, one editor could overwrite the progress made with the other editor.

In summary, you can collaborate between Notebook Editor and Notebook Editor on different clients but not between Notebook Editor and Editor (either the same client or another client).

FYI, Editor is the plain text editor, and Notebook Editor is the notebook.

I get this error even when only opening the notebook, if I create a copy of the notebook then it will show an encoded version instead of the notebook (second video)

2024-03-18.11-41-14.mp4
2024-03-18.11-44-54.mp4

Binary diff of the files show they are the exact same, so there must be something with some caching

@EduardDurech
Copy link

EduardDurech commented Mar 18, 2024

This issue seems to be happening for some files as well only with RTC

Document session error
Error initializing: foofile.ipynb.
You need to close the document.

whenever I open with RTC:
Here is the log
2024-03-17.18-52-35.mp4

These files were working before in RTC so not sure what caused them to stop working but the nbformat log is fixed by shutting it down (important, as it seems to overwrite the fixed file if open) and running

python3 -c "import nbformat; nb = nbformat.read(open('foofile.ipynb'), as_version=4); nbformat.write(nb, open('foofile.ipynb', 'w'))"

then it works, for anyone looking for a fix

Update: After restarting the error is back again..... I checked the file and the nbformat is still 4 and nbformat_minor still 5, so there is something else causing this issue, the re-saving is only a temporary fix for the life that you have the server open, just duplicating the file makes the new one work but not the old one, so some problem with caching

@kl00z
Copy link

kl00z commented Apr 23, 2024

Still getting this on,

jupyter-collaboration     2.0.11             pyhd8ed1ab_0    conda-forge
jupyter-lsp               2.2.5              pyhd8ed1ab_0    conda-forge
jupyter_client            8.6.1              pyhd8ed1ab_0    conda-forge
jupyter_core              5.7.2           py312h7900ff3_0    conda-forge
jupyter_events            0.10.0             pyhd8ed1ab_0    conda-forge
jupyter_server            2.14.0             pyhd8ed1ab_0    conda-forge
jupyter_server_fileid     0.9.1              pyhd8ed1ab_0    conda-forge
jupyter_server_terminals  0.5.3              pyhd8ed1ab_0    conda-forge
jupyter_ydoc              2.0.1              pyhd8ed1ab_0    conda-forge
jupyterlab                4.1.6              pyhd8ed1ab_0    conda-forge
jupyterlab_pygments       0.3.0              pyhd8ed1ab_1    conda-forge
jupyterlab_server         2.27.0             pyhd8ed1ab_0    conda-forge
jupyterlab_widgets        3.0.10             pyhd8ed1ab_0    conda-forge

When I opened a notebook (ipynb/analysis_2.ipynb), close it, even logging out before, then come back and the message Two collaborative sessions are accessing the file xxxxxxxxxxxxxx simultaneously. Opening a document with multiple views simultaneously is not supported. Please close one view; otherwise, you might lose some of your progress. still pops up. With,

[I 2024-04-23 17:07:55.908 YDocExtension] Processed 0 Y patches in one minute
[I 2024-04-23 17:07:55.908 YDocExtension] Connected Y users: 0
[I 2024-04-23 17:07:56.006 ServerApp] 302 GET / (@127.0.0.1) 0.85ms
[I 2024-04-23 17:07:59.417 ServerApp] Connecting to kernel 6e25ff5f-e48a-4399-b956-b6dcd9073269.
[I 2024-04-23 17:08:00.322 LabApp] Build is up to date
[I 2024-04-23 17:08:00.555 ServerApp] Starting buffering for 6e25ff5f-e48a-4399-b956-b6dcd9073269:b2ef7006-4dad-4e9b-b533-b3ff25001004
[I 2024-04-23 17:08:00.745 ServerApp] Request for Y document 'ipynb/analysis_2.ipynb' with room ID: 483ff7ba-a7b4-478e-8827-1fda9fbab785
[I 2024-04-23 17:08:01.274 YDocExtension] Creating FileLoader for: ipynb/analysis_2.ipynb
[E 2024-04-23 17:08:01.276 ServerApp] Uncaught exception GET /api/collaboration/room/json:notebook:483ff7ba-a7b4-478e-8827-1fda9fbab785?sessionId=84b5572c-b644-408a-ae69-9046f271dce8 (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/api/collaboration/room/json:notebook:483ff7ba-a7b4-478e-8827-1fda9fbab785?sessionId=84b5572c-b644-408a-ae69-9046f271dce8', version='HTTP/1.1', remote_ip='127.0.0.1')
    Traceback (most recent call last):
      File "/home/barri/miniconda3/envs/active-galton/lib/python3.12/site-packages/tornado/web.py", line 1769, in _execute
        result = await result  # type: ignore
                 ^^^^^^^^^^^^
      File "/home/barri/miniconda3/envs/active-galton/lib/python3.12/site-packages/jupyter_collaboration/handlers.py", line 112, in prepare
        await self._websocket_server.start_room(self.room)
      File "/home/barri/miniconda3/envs/active-galton/lib/python3.12/site-packages/pycrdt_websocket/websocket_server.py", line 88, in start_room
        await self._task_group.start(room.start)
      File "/home/barri/miniconda3/envs/active-galton/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 775, in start
        task = self._spawn(func, args, name, future)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/barri/miniconda3/envs/active-galton/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 730, in _spawn
        raise RuntimeError(
    RuntimeError: This task group is not active; no new tasks can be started.
[E 2024-04-23 17:08:01.293 ServerApp] Uncaught exception in write_error
    Traceback (most recent call last):
      File "/home/barri/miniconda3/envs/active-galton/lib/python3.12/site-packages/tornado/web.py", line 1769, in _execute
        result = await result  # type: ignore
                 ^^^^^^^^^^^^
      File "/home/barri/miniconda3/envs/active-galton/lib/python3.12/site-packages/jupyter_collaboration/handlers.py", line 112, in prepare
        await self._websocket_server.start_room(self.room)
      File "/home/barri/miniconda3/envs/active-galton/lib/python3.12/site-packages/pycrdt_websocket/websocket_server.py", line 88, in start_room
        await self._task_group.start(room.start)
      File "/home/barri/miniconda3/envs/active-galton/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 775, in start
        task = self._spawn(func, args, name, future)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/barri/miniconda3/envs/active-galton/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 730, in _spawn
        raise RuntimeError(
    RuntimeError: This task group is not active; no new tasks can be started.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/home/barri/miniconda3/envs/active-galton/lib/python3.12/site-packages/tornado/web.py", line 1298, in send_error
        self.write_error(status_code, **kwargs)
      File "/home/barri/miniconda3/envs/active-galton/lib/python3.12/site-packages/jupyter_server/base/handlers.py", line 739, in write_error
        html = self.render_template("%s.html" % status_code, **ns)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/barri/miniconda3/envs/active-galton/lib/python3.12/site-packages/jupyter_server/base/handlers.py", line 665, in render_template
        ns.update(self.template_namespace)
                  ^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/barri/miniconda3/envs/active-galton/lib/python3.12/site-packages/jupyter_server/base/handlers.py", line 675, in template_namespace
        logged_in=self.logged_in,
                  ^^^^^^^^^^^^^^
      File "/home/barri/miniconda3/envs/active-galton/lib/python3.12/site-packages/jupyter_server/base/handlers.py", line 198, in logged_in
        user = self.current_user
               ^^^^^^^^^^^^^^^^^
      File "/home/barri/miniconda3/envs/active-galton/lib/python3.12/site-packages/tornado/web.py", line 1424, in current_user
        self._current_user = self.get_current_user()
                             ^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/barri/miniconda3/envs/active-galton/lib/python3.12/site-packages/jupyter_server/base/handlers.py", line 177, in get_current_user
        raise RuntimeError(msg)
    RuntimeError: Calling `YDocWebSocketHandler.get_current_user()` directly is deprecated in jupyter-server 2.0. Use `self.current_user` instead (works in all versions).
[E 2024-04-23 17:08:01.296 ServerApp] {
      "Host": "localhost:8888",
      "Accept": "*/*",
      "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113.0"
    }
[E 2024-04-23 17:08:01.296 ServerApp] 500 GET /api/collaboration/room/json:notebook:483ff7ba-a7b4-478e-8827-1fda9fbab785?sessionId=84b5572c-b644-408a-ae69-9046f271dce8 (@127.0.0.1) 30.98ms referer=None

Best,

@nsauerwein
Copy link

Hey all, I am observing the same. I am also running on 2.0.11. Is there any solution for this? Is this fixed by 2.1.0?

@pablo-fernandez-IGZ
Copy link

I post this here in case someone has a similar problem and might be related
I was finding this with message and not being able to open notebooks. However, apparently I was having two seperate issues.

My storage was full, therefore notebooks were not opening. But because I was receiving the message Two collaborative sessions are accessing the file xxxxxxxxxxxxxx simultaneously. Opening a document with multiple views simultaneously is not supported. Please close one view; otherwise, you might lose some of your progress I was not receiving the message about my storage being full.

I am still receiving the error message, but clearing cache allowed me to open notebooks (I saw that in cache there was a huge hugging face model from a previous notebook)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests