Open ykazakov opened 2 weeks ago
Actually, exactly the same problem takes place even without jupyterhub
if one changes the default base_url
(which jupyterhub
does):
jupyter lab --ServerApp.base_url='/user/bob'
When Jupyter Lab starts with a custom base_url
, the document timeline widget uses an incorrect url, which can be seen from the browser console when clicking on the timeline icon:
As can be seen from this screenshot, the url has the fragment /collaboration/timeline
two times.
If I manually change the url by removing one duplicate and open it in a browser, it appears to be working fine:
{"roomId": "json:notebook:6ac6ac6d-7495-48cc-a50b-079b716639b6", "timestamps": [1730991797.4978712, 1730991823.8297029, 1730991841.182337], "forkRoom": "dcbf793c2a554d11bcb811537ed539e8", "sessionId": "48f278d7-0dd0-4617-b81e-bc3a6198e682"}
conda install -c conda-forge jupyterlab jupyter-collaboration
jupyter lab --ServerApp.base_url='/user/bob'
A slider should appear next to the timeline icon.
% pip list | grep jupyter
jupyter_client 8.6.3
jupyter-collaboration 3.0.0
jupyter-collaboration-ui 1.0.0
jupyter_core 5.7.2
jupyter-docprovider 1.0.0
jupyter-events 0.10.0
jupyter-lsp 2.2.5
jupyter_server 2.14.2
jupyter_server_fileid 0.9.2
jupyter_server_terminals 0.5.3
jupyter-server-ydoc 1.0.0
jupyter-ydoc 3.0.0
jupyterlab 4.3.0
jupyterlab_pygments 0.3.0
jupyterlab_server 2.27.3
% jupyter lab --ServerApp.base_url='/user/bob' [I 2024-11-07 16:16:01.969 ServerApp] jupyter_lsp | extension was successfully linked. [I 2024-11-07 16:16:01.971 ServerApp] jupyter_server_fileid | extension was successfully linked. [I 2024-11-07 16:16:01.972 ServerApp] jupyter_server_terminals | extension was successfully linked. [I 2024-11-07 16:16:01.974 ServerApp] jupyter_server_ydoc | extension was successfully linked. [I 2024-11-07 16:16:01.976 ServerApp] jupyterlab | extension was successfully linked. [I 2024-11-07 16:16:02.182 ServerApp] notebook_shim | extension was successfully linked. [I 2024-11-07 16:16:02.225 ServerApp] notebook_shim | extension was successfully loaded. [I 2024-11-07 16:16:02.227 ServerApp] jupyter_lsp | extension was successfully loaded. [I 2024-11-07 16:16:02.227 FileIdExtension] Configured File ID manager: ArbitraryFileIdManager [I 2024-11-07 16:16:02.227 FileIdExtension] ArbitraryFileIdManager : Configured root dir: /private/tmp/2 [I 2024-11-07 16:16:02.227 FileIdExtension] ArbitraryFileIdManager : Configured database path: /Users/ecull/Library/Jupyter/file_id_manager.db [I 2024-11-07 16:16:02.229 FileIdExtension] ArbitraryFileIdManager : Successfully connected to database file. [I 2024-11-07 16:16:02.229 FileIdExtension] ArbitraryFileIdManager : Creating File ID tables and indices with journal_mode = DELETE [I 2024-11-07 16:16:02.229 FileIdExtension] Attached event listeners. [I 2024-11-07 16:16:02.230 ServerApp] jupyter_server_fileid | extension was successfully loaded. [I 2024-11-07 16:16:02.230 ServerApp] jupyter_server_terminals | extension was successfully loaded. [I 2024-11-07 16:16:02.233 ServerApp] jupyter_server_ydoc | extension was successfully loaded. [I 2024-11-07 16:16:02.234 LabApp] JupyterLab extension loaded from /opt/homebrew/Caskroom/miniconda/base/envs/jc/lib/python3.13/site-packages/jupyterlab [I 2024-11-07 16:16:02.234 LabApp] JupyterLab application directory is /opt/homebrew/Caskroom/miniconda/base/envs/jc/share/jupyter/lab [I 2024-11-07 16:16:02.234 LabApp] Extension Manager is 'pypi'. [I 2024-11-07 16:16:02.244 ServerApp] jupyterlab | extension was successfully loaded. [I 2024-11-07 16:16:02.245 ServerApp] Serving notebooks from local directory: /private/tmp/2 [I 2024-11-07 16:16:02.245 ServerApp] Jupyter Server 2.14.2 is running at: [I 2024-11-07 16:16:02.245 ServerApp] http://localhost:8888/user/bob/lab?token=bf0b13662ad05739f3df0a59bdd549cc497547156a52c91f [I 2024-11-07 16:16:02.245 ServerApp] http://127.0.0.1:8888/user/bob/lab?token=bf0b13662ad05739f3df0a59bdd549cc497547156a52c91f [I 2024-11-07 16:16:02.245 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 2024-11-07 16:16:02.249 ServerApp] To access the server, open this file in a browser: file:///Users/ecull/Library/Jupyter/runtime/jpserver-89216-open.html Or copy and paste one of these URLs: http://localhost:8888/user/bob/lab?token=bf0b13662ad05739f3df0a59bdd549cc497547156a52c91f http://127.0.0.1:8888/user/bob/lab?token=bf0b13662ad05739f3df0a59bdd549cc497547156a52c91f [I 2024-11-07 16:16:02.261 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server [W 2024-11-07 16:16:04.171 LabApp] Could not determine jupyterlab build status without nodejs [I 2024-11-07 16:16:04.379 ServerApp] Request for Y document 'Untitled.ipynb' with room ID: 6ac6ac6d-7495-48cc-a50b-079b716639b6 /opt/homebrew/Caskroom/miniconda/base/envs/jc/bin/jupyter-lab:10: DeprecationWarning: Parsing dates involving a day of month without a year specified is ambiguious and fails to parse leap day. The default behavior will change in Python 3.15 to either always raise an exception or to use a different default year (TBD). To avoid trouble, add a specific year to the input & format. See https://github.com/python/cpython/issues/70647. sys.exit(main()) [I 2024-11-07 16:16:04.510 YDocExtension] Creating FileLoader for: Untitled.ipynb [I 2024-11-07 16:16:04.522 YDocExtension] Watching file: Untitled.ipynb [I 2024-11-07 16:16:04.523 ServerApp] Initializing room json:notebook:6ac6ac6d-7495-48cc-a50b-079b716639b6 [I 2024-11-07 16:16:04.560 ServerApp] Content in room json:notebook:6ac6ac6d-7495-48cc-a50b-079b716639b6 loaded from the ystore SQLiteYStore [I 2024-11-07 16:16:04.660 ServerApp] Kernel started: 81f4f380-8fb5-4ca1-9767-cb4aa2ccd5ac [I 2024-11-07 16:16:05.021 ServerApp] Connecting to kernel 81f4f380-8fb5-4ca1-9767-cb4aa2ccd5ac. [I 2024-11-07 16:16:05.022 ServerApp] Connecting to kernel 81f4f380-8fb5-4ca1-9767-cb4aa2ccd5ac. [I 2024-11-07 16:16:05.023 ServerApp] Connecting to kernel 81f4f380-8fb5-4ca1-9767-cb4aa2ccd5ac. [I 2024-11-07 16:16:05.569 ServerApp] Saving the content from room json:notebook:6ac6ac6d-7495-48cc-a50b-079b716639b6 [I 2024-11-07 16:16:05.572 YDocExtension] Saving file: Untitled.ipynb [W 2024-11-07 16:16:22.906 ServerApp] 404 GET /user/bob/api/collaboration/timeline/collaboration/timeline/Untitled.ipynb?format=json&&type=notebook&1730992582902 (b9b4d0dcbdf84761a74507d9e38d5727@::1) 1.37ms referer=http://localhost:8888/user/bob/lab
[Warning] Unsatisfied version 3.0.0 from @jupyterlab/application-top of shared singleton module @jupyter/ydoc (required ^2.0.1) (remoteEntry.df025193a26e76919ed8.js, line 1) [Warning] Language pack 'en_US' not installed! (jlab_core.30ac71af4fabafb542d8.js, line 1) [Debug] Starting application in workspace: "default" (jlab_core.30ac71af4fabafb542d8.js, line 1) [Debug] Starting WebSocket: ws://localhost:8888/user/bob/api/kernels/81f4f380-8fb5-4ca1-9767-cb4aa2ccd5ac (jlab_core.30ac71af4fabafb542d8.js, line 1) [Debug] Starting WebSocket: ws://localhost:8888/user/bob/api/kernels/81f4f380-8fb5-4ca1-9767-cb4aa2ccd5ac (jlab_core.30ac71af4fabafb542d8.js, line 1) [Debug] Starting WebSocket: ws://localhost:8888/user/bob/api/kernels/81f4f380-8fb5-4ca1-9767-cb4aa2ccd5ac (jlab_core.30ac71af4fabafb542d8.js, line 1) [Error] Failed to load resource: the server responded with a status of 404 (Not Found) [(Untitled.ipynb, line 0)](http://localhost:8888/user/bob/api/collaboration/timeline/collaboration/timeline/Untitled.ipynb?format=json&&type=notebook&1730992582902) [Error] Error fetching data: – Error: Not found — 618.28407d2343b911e61b63.js:0 Error: Not found — 618.28407d2343b911e61b63.js:0 (anonymous function) (618.28407d2343b911e61b63.js:1:15066)
See below for an updated report
OLD Description
When Jupyter Lab is started as as single-user server in Jupyter Hub, the document timeline widget uses an incorrect url, which can be seen from the browser console when clicking on the timeline icon:
As can be seen from this screenshot, the url has the part
/collaboration/timeline
two times.If I manually change the url by removing one duplicate and open it in a browser, it appears to be working fine:
Reproduce
conda install -c conda-forge jupyterhub jupyterlab jupyter-collaboration
jupyterhub --JupyterHub.authenticator_class='dummy' --JupyterHub.spawner_class='simple'
http://localhost:8000
and enter any user name, e.g.,bob
Expected behavior
A slider should appear next to the timeline icon.
Context
Command Line Output
Browser Output