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

jupyter lab is stuck when opening a new notebook #16985

Open
nonZero opened this issue Nov 21, 2024 · 13 comments
Open

jupyter lab is stuck when opening a new notebook #16985

nonZero opened this issue Nov 21, 2024 · 13 comments

Comments

@nonZero
Copy link

nonZero commented Nov 21, 2024

Description

jupyter lab is stuck when opening a new notebook

image

Reproduce

reproduced in firefox and chrome, including incognito.

does not reproduce with jupyter lab --core-mode !!!

Context

  • Operating System and version: arch linux
  • Browser and version: latest chrome+firefox
  • JupyterLab version: 4.3.1

running in many ways, including
uv tool run --python 3.12 --from jupyterlab python -m jupyterlab

Troubleshoot Output
sys.version:
	3.13.0 (main, Oct 16 2024, 03:23:02) [Clang 18.1.8 ]

platform.platform():
Linux-6.11.9-arch1-1-x86_64-with-glibc2.40

@nonZero nonZero added the bug label Nov 21, 2024
@jupyterlab-probot jupyterlab-probot bot added the status:Needs Triage Applied to new issues that need triage label Nov 21, 2024
@andrii-i
Copy link
Contributor

Hi @nonZero. Thank you for creating this issue. Could you please advise on the simplest way to reproduce this, if you are seeing this when launching JupyterLab with just jupyter lab? Do you see any browser console errors? Please copy them here if yes.

@felrugo
Copy link

felrugo commented Dec 2, 2024

I have the same bug.
For me it was the RTC: When i open a notebook in Lab then it will open it with an url containig "RTC%3A".
If I remove it from the URL and reload the page, the notebook opens normally.

@nonZero
Copy link
Author

nonZero commented Dec 2, 2024

I have the same bug. For me it was the RTC: When i open a notebook in Lab then it will open it with an url containig "RTC%3A". If I remove it from the URL and reload the page, the notebook opens normally.

Bingo! same here!
I think RTC stands for Real Time Collaboation - but I don't think I have anything related installed.
@andrii-i is this enough info?

@krassowski
Copy link
Member

So this is likely:

Can you update jupyter_ydoc locally to 3.0.2 and confirm that this helps?

@felrugo
Copy link

felrugo commented Dec 2, 2024

Can you update jupyter_ydoc locally to 3.0.2 and confirm that this helps?

For me it does not. It keeps adding RTC in the url and hangs at loading.
Also if I replace the RTC part, after some time it stops loading new cells.
Only the cell I edited and its neighbours are loaded. If I scroll up it is just empty space...

@nonZero
Copy link
Author

nonZero commented Dec 3, 2024 via email

@krassowski
Copy link
Member

Is there a way to disable rtc completely as a workaround?

Yes, but first, can you post the version of jupyter-collaboration that you have installed? Maybe the problem is in incompatible version of jupyter-collaboration? To check run:

pip show jupyter-collaboration

To disable it, assuming latest version and installation via pip, you can uninstall jupyter-collaboration and it's dependencies:

pip uninstall jupyter-collaboration jupyter-docprovider jupyter-server-ydoc jupyter-collaboration-ui

@nonZero
Copy link
Author

nonZero commented Dec 3, 2024

I believe that the problem is a little harder...

I don't have jupyter-collaboration installed in my virtualenv:

(my_venv) $ pip freeze | grep jupyter
jupyter-events==0.10.0
jupyter-lsp==2.2.5
jupyter-server-mathjax==0.2.6
jupyter_client==8.6.1
jupyter_core==5.7.2
jupyter_server==2.14.0
jupyter_server_fileid==0.9.2
jupyter_server_terminals==0.5.3
jupyterlab==4.3.1
jupyterlab_pygments==0.3.0
jupyterlab_server==2.27.1
jupyterlab_widgets==3.0.10

I am using archlinux and my system' python have:

$ pip freeze | grep jupyter
jupyter-collaboration-ui==1.0.0
jupyter-console==6.6.3
jupyter-docprovider==1.0.0
jupyter-events==0.10.0
jupyter-server-ydoc==1.0.0
jupyter-ydoc==3.0.1
jupyter_client==8.6.3
jupyter_core==5.7.2
jupyter_packaging==0.12.3
jupyter_server==2.14.2
jupyter_server_fileid==0.9.3
jupyter_server_terminals==0.5.3
jupyterlab_pygments==0.3.0

again, --core-mode runs correctly.

a new venv does not run correctly:
uv tool run --python 3.12 --from jupyterlab python -m jupyterlab

jupyter from docker runs correctly.

@krassowski
Copy link
Member

But you have jupyter-server-ydoc installed:

jupyter-server-ydoc==1.0.0

And you have old version of jupyter-ydoc:

jupyter-ydoc==3.0.1

As per above, the issue should be fixed by 3.0.2.

@nonZero
Copy link
Author

nonZero commented Dec 3, 2024

Those versions are on my System's python (/usr/bin/python, /usr/lib...).
They should not be used or detected by my virualenv's python+jupyter that i am running.

@felrugo
Copy link

felrugo commented Dec 3, 2024

I am using Manjaro and created a virtualenv (venv) and installed jupyterlab with pip.
I did not have jupyter-collaboration installed, but now I installed it directly from pip.
Now jupyter seems to be working fine, opening notebook with the RTC url instantly.

I think my problem was that the jupyterlab package did not require jupyter-collaboration therefore the RTC protocoll did not work properly. I dont know how does it work on other platforms, but I think the solution should be that jupyterlab should install the collaboration package as well as I see it is its default opening mode now. Or have it in the docs that one should install the collaboration package as well.

Anyways thank you @krassowski for mentioning the collaboration package. I will test whether the "dissapearing cells" bug solved as well.

@nonZero
Copy link
Author

nonZero commented Dec 3, 2024

running
pip install jupyter-collaboration
inside the virtualenv solves the problem.

i.e. in my case jupyterlab inside a venv requires jupyter-collaboration to work properly.

@nonZero
Copy link
Author

nonZero commented Dec 3, 2024

To easily reproduce:

Runs correctly:
uv tool run --from jupyterlab --with jupyter-collaboration jupyter lab

Does not run correctly:
uv tool run --from jupyterlab jupyter lab

@JasonWeill JasonWeill added status:Needs Discussion and removed status:Needs Info status:Needs Triage Applied to new issues that need triage labels Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants