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

notebook and lab can't open in RTC #390

Open
xiang2002 opened this issue Oct 30, 2024 · 13 comments
Open

notebook and lab can't open in RTC #390

xiang2002 opened this issue Oct 30, 2024 · 13 comments
Labels
bug Something isn't working

Comments

@xiang2002
Copy link

Can't Use RTC in jupyter notebook and jupyterlab

Error

image

image

It only be loading at all time.

Context

  • Operating System and version: Linux Ubuntu 24 for jupyter and open jupyter webpage in my windows PC.
  • Browser : Chrome
  • Jupyter version: jupyterlab:4.2.5,notebook:7.2.2
@xiang2002 xiang2002 added the bug Something isn't working label Oct 30, 2024
@ellisonbg
Copy link

I am seeing the same thing on an upgraded JupyterLab 4.3.0 and jupyter-collaboration 3.0.0.

@ellisonbg
Copy link

Uninstalling jupyter-collaboration resolves the problem.

@ellisonbg
Copy link

Here is a screenshot of the browser Console when I try to create a new notebook with collaboration enabled.

Screenshot 2024-11-05 at 10 41 56 AM

@martinRenou
Copy link
Member

Could you try removing some local .jupyter_ystore.db file, then try again?

@ellisonbg
Copy link

Do you remember which Jupyter path that is under?

@martinRenou
Copy link
Member

It should be local to where you start jupyter lab I believe

@ellisonbg
Copy link

Thanks, confirming for others that deleting the .jupyter_ystore.db in the directory where I started the server does fix the issue. Would be great if jupyter-collaboration can auto-detect when this file needs to be deleted.

@davidbrochart
Copy link
Collaborator

I tried creating a notebook with jupyter-collaboration v2, then upgrading to v3 and opening the notebook again, without issue.
There is some logic to check the store file, that should create a new file in case of version mismatch. We should make sure it works fine.

@ellisonbg
Copy link

Anything else that would cause this?

@davidbrochart
Copy link
Collaborator

Not that I can think of, and without a reproducer it's hard to go further.

@brichet
Copy link
Contributor

brichet commented Dec 3, 2024

I can reproduce it when updating a package that depends on jupyterlab_collaboration 3 instead of 2 before.
The jupyter_server_ydoc server extension is not installed.

For example with jupyterlab_chat on main (depends on jupyter_collaboration<3), the server extensions are:

    jupyter_lsp enabled
    - Validating jupyter_lsp...
      jupyter_lsp 2.2.5 OK
    jupyter_collaboration enabled
    - Validating jupyter_collaboration...
      jupyter_collaboration 2.1.4 OK
    jupyter_server_fileid enabled
    - Validating jupyter_server_fileid...
      jupyter_server_fileid 0.9.3 OK
    jupyter_server_terminals enabled
    - Validating jupyter_server_terminals...
      jupyter_server_terminals 0.5.3 OK
    jupyterlab enabled
    - Validating jupyterlab...
Extension package jupyterlab took 0.1392s to import
      jupyterlab 4.2.5 OK
    jupyterlab_chat enabled
    - Validating jupyterlab_chat...
      jupyterlab_chat 0.6.2 OK
    notebook_shim enabled
    - Validating notebook_shim...
      notebook_shim  OK

Installing again the package from that PR (depends on jupyter_collaboration>=3) leads to:

     jupyter_lsp enabled
    - Validating jupyter_lsp...
      jupyter_lsp 2.2.5 OK
    jupyter_server_fileid enabled
    - Validating jupyter_server_fileid...
      jupyter_server_fileid 0.9.3 OK
    jupyter_server_terminals enabled
    - Validating jupyter_server_terminals...
      jupyter_server_terminals 0.5.3 OK
    jupyterlab enabled
    - Validating jupyterlab...
Extension package jupyterlab took 0.1640s to import
      jupyterlab 4.2.5 OK
    jupyterlab_chat enabled
    - Validating jupyterlab_chat...
      jupyterlab_chat 0.6.0 OK
    notebook_shim enabled
    - Validating notebook_shim...
      notebook_shim  OK

The jupyter_server_ydoc server extension is not installed, but the package is.

This can be tried running ./scripts/dev_install.sh from the sources of jupyter-chat.

Of note, the installation works well when starting from a new environment.

@ellisonbg
Copy link

Thanks for reproducing this @brichet !

@andrii-i
Copy link
Contributor

andrii-i commented Jan 15, 2025

I can reliably and easily reproduce this problem by updating from jupyterlab-chat version that uses jupyter-collaboration v2 to one that uses jupyter-collaboration v3 as so:

  1. Create new conda environment
  2. Run pip install jupyterlab-chat==0.6.2 (depends on jupyter-collaboration<3, v2.1.5 in my case)
  3. Create a new folder and run jupyterlab in it, create a chat which would create a chat file
  4. Run pip install jupyterlab-chat==0.7.1(depends on jupyter-collaboration>3, v3.1.0 in my case)
  5. Attempt to open previously created chat file in jupyterlab and see spinning circle

Next I looked into .jupyter_ystore.db and PRAGMA user_version is still 2 so old .jupyter_ystore.db is not getting detected as old and moved by db check logic in _init_db logic function as it is supposed (referenced in #414 (comment))

@davidbrochart, could you please look into this comment and why _init_db is not detecting db as old in this reproduction path?

Theory of mine is that in version check codemove_db flag is set to true only if pragma user_version doesn't match self.version . So if one of them is not set correctly or if they don't match (for example, db schema is different or pragma was not set or self.version is not set), db would not be moved. Instead create_db logic would attempt to create an already existing table, error out, and rollback the transaction invalidating all following transactions including the one that is supposed to set version to 3.

SQLite commands that I used / are used in `_init_db` function:
  1. Open .jupyter_ystore.db file in terminal
sqlite3 .jupyter_ystore.db
  1. Check existence of yupdates table
SELECT count(name)
FROM sqlite_master
WHERE type='table'
  AND name='yupdates';
  1. Check pragma user_version
PRAGMA user_version;

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

6 participants