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

Second instance of Jupyter-Lab with similar state as the first instance #16210

Closed
chbrandt opened this issue Apr 20, 2024 · 9 comments
Closed

Comments

@chbrandt
Copy link
Contributor

Description

  • The situation involves multiple (different) instances of JupyterLab (different ports, different tokens).
  • I am testing Jupyter in a multi-environment setup (with ipykernel).

After starting a few kernels in the first Jupyter-Lab instance (let's call it "8888"), I start another instance (8889).
The second instance, though, will start the same number of console, terminal, and notebook tabs as the first one.

  • Screenshot of instance "8888" (the first one):
    image

  • Screenshot of instance "8889" (the second one):
    image

Reproduce

  1. Run first instance of Jupyter-Lab

    $ jupyter lab
    Will start an instance at port 8888

  2. Open one or more console, terminal, or notebook tabs/kernels. (Leave them open)
  3. Run second instance of Jupyter-Lab

    $ jupyter lab
    Will start an instance at port 8889

  4. Go to your browser where the second instance is (port 8889), notice the automatically created/started tabs resembling the other (first, 8888) instance.

Expected behavior

I would expect a new instance of Jupyter-Lab to start fresh, with only the (default) "Launcher" tab open.

Context

  • Operating System and version: MacOS (Intel) 14.4.1 (Sonoma; Darwin Kernel Version 23.4.0, x86_64)
  • Browser and version: Safari 17.4.1 & Chrome 124.0.6367.61
  • JupyterLab version: 4.1.6

This a completely fresh install of Jupyter (and Conda) in a fresh install of the OS. None (Jupyter) extensions were installed.

Troubleshoot Output
$PATH:
	/opt/miniconda3/envs/jupyter/bin
	/opt/miniconda3/condabin
	/usr/local/bin
	/usr/local/sbin
	/System/Cryptexes/App/usr/bin
	/usr/bin
	/bin
	/usr/sbin
	/sbin
	/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin
	/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin
	/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin

sys.path:
/opt/miniconda3/envs/jupyter/bin
/opt/miniconda3/envs/jupyter/lib/python312.zip
/opt/miniconda3/envs/jupyter/lib/python3.12
/opt/miniconda3/envs/jupyter/lib/python3.12/lib-dynload
/opt/miniconda3/envs/jupyter/lib/python3.12/site-packages

sys.executable:
/opt/miniconda3/envs/jupyter/bin/python

sys.version:
3.12.3 | packaged by conda-forge | (main, Apr 15 2024, 18:50:49) [Clang 16.0.6 ]

platform.platform():
macOS-14.4.1-x86_64-i386-64bit

which -a jupyter:
/opt/miniconda3/envs/jupyter/bin/jupyter

pip list:
Package Version
------------------------- --------------
anyio 4.3.0
appnope 0.1.4
argon2-cffi 23.1.0
argon2-cffi-bindings 21.2.0
arrow 1.3.0
asttokens 2.4.1
async-lru 2.0.4
attrs 23.2.0
Babel 2.14.0
beautifulsoup4 4.12.3
bleach 6.1.0
Brotli 1.1.0
cached-property 1.5.2
certifi 2024.2.2
cffi 1.16.0
charset-normalizer 3.3.2
comm 0.2.2
debugpy 1.8.1
decorator 5.1.1
defusedxml 0.7.1
entrypoints 0.4
exceptiongroup 1.2.0
executing 2.0.1
fastjsonschema 2.19.1
fqdn 1.5.1
h11 0.14.0
h2 4.1.0
hpack 4.0.0
httpcore 1.0.5
httpx 0.27.0
hyperframe 6.0.1
idna 3.7
importlib_metadata 7.1.0
importlib_resources 6.4.0
ipykernel 6.29.3
ipython 8.22.2
isoduration 20.11.0
jedi 0.19.1
Jinja2 3.1.3
json5 0.9.25
jsonpointer 2.4
jsonschema 4.21.1
jsonschema-specifications 2023.12.1
jupyter_client 8.6.1
jupyter_core 5.7.2
jupyter-events 0.10.0
jupyter-lsp 2.2.5
jupyter_server 2.14.0
jupyter_server_terminals 0.5.3
jupyterlab 4.1.6
jupyterlab_pygments 0.3.0
jupyterlab_server 2.26.0
MarkupSafe 2.1.5
matplotlib-inline 0.1.7
mistune 3.0.2
nbclient 0.10.0
nbconvert 7.16.3
nbformat 5.10.4
nest_asyncio 1.6.0
notebook_shim 0.2.4
overrides 7.7.0
packaging 24.0
pandocfilters 1.5.0
parso 0.8.4
pexpect 4.9.0
pickleshare 0.7.5
pip 24.0
pkgutil_resolve_name 1.3.10
platformdirs 4.2.0
prometheus_client 0.20.0
prompt-toolkit 3.0.42
psutil 5.9.8
ptyprocess 0.7.0
pure-eval 0.2.2
pycparser 2.22
Pygments 2.17.2
pyobjc-core 10.2
pyobjc-framework-Cocoa 10.2
PySocks 1.7.1
python-dateutil 2.9.0
python-json-logger 2.0.7
pytz 2024.1
PyYAML 6.0.1
pyzmq 26.0.0
referencing 0.34.0
requests 2.31.0
rfc3339-validator 0.1.4
rfc3986-validator 0.1.1
rpds-py 0.18.0
Send2Trash 1.8.3
setuptools 69.5.1
six 1.16.0
sniffio 1.3.1
soupsieve 2.5
stack-data 0.6.2
terminado 0.18.1
tinycss2 1.2.1
tomli 2.0.1
tornado 6.4
traitlets 5.14.2
types-python-dateutil 2.9.0.20240316
typing_extensions 4.11.0
typing-utils 0.1.0
uri-template 1.3.0
urllib3 2.2.1
wcwidth 0.2.13
webcolors 1.13
webencodings 0.5.1
websocket-client 1.7.0
wheel 0.43.0
zipp 3.17.0

conda list:
# packages in environment at /opt/miniconda3/envs/jupyter:
#
# Name Version Build Channel
anyio 4.3.0 pyhd8ed1ab_0 conda-forge
appnope 0.1.4 pyhd8ed1ab_0 conda-forge
argon2-cffi 23.1.0 pyhd8ed1ab_0 conda-forge
argon2-cffi-bindings 21.2.0 py312h104f124_4 conda-forge
arrow 1.3.0 pyhd8ed1ab_0 conda-forge
asttokens 2.4.1 pyhd8ed1ab_0 conda-forge
async-lru 2.0.4 pyhd8ed1ab_0 conda-forge
attrs 23.2.0 pyh71513ae_0 conda-forge
babel 2.14.0 pyhd8ed1ab_0 conda-forge
beautifulsoup4 4.12.3 pyha770c72_0 conda-forge
bleach 6.1.0 pyhd8ed1ab_0 conda-forge
brotli-python 1.1.0 py312heafc425_1 conda-forge
bzip2 1.0.8 h10d778d_5 conda-forge
ca-certificates 2024.2.2 h8857fd0_0 conda-forge
cached-property 1.5.2 hd8ed1ab_1 conda-forge
cached_property 1.5.2 pyha770c72_1 conda-forge
certifi 2024.2.2 pyhd8ed1ab_0 conda-forge
cffi 1.16.0 py312h38bf5a0_0 conda-forge
charset-normalizer 3.3.2 pyhd8ed1ab_0 conda-forge
comm 0.2.2 pyhd8ed1ab_0 conda-forge
debugpy 1.8.1 py312hede676d_0 conda-forge
decorator 5.1.1 pyhd8ed1ab_0 conda-forge
defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge
entrypoints 0.4 pyhd8ed1ab_0 conda-forge
exceptiongroup 1.2.0 pyhd8ed1ab_2 conda-forge
executing 2.0.1 pyhd8ed1ab_0 conda-forge
fqdn 1.5.1 pyhd8ed1ab_0 conda-forge
h11 0.14.0 pyhd8ed1ab_0 conda-forge
h2 4.1.0 pyhd8ed1ab_0 conda-forge
hpack 4.0.0 pyh9f0ad1d_0 conda-forge
httpcore 1.0.5 pyhd8ed1ab_0 conda-forge
httpx 0.27.0 pyhd8ed1ab_0 conda-forge
hyperframe 6.0.1 pyhd8ed1ab_0 conda-forge
idna 3.7 pyhd8ed1ab_0 conda-forge
importlib-metadata 7.1.0 pyha770c72_0 conda-forge
importlib_metadata 7.1.0 hd8ed1ab_0 conda-forge
importlib_resources 6.4.0 pyhd8ed1ab_0 conda-forge
ipykernel 6.29.3 pyh3cd1d5f_0 conda-forge
ipython 8.22.2 pyh707e725_0 conda-forge
isoduration 20.11.0 pyhd8ed1ab_0 conda-forge
jedi 0.19.1 pyhd8ed1ab_0 conda-forge
jinja2 3.1.3 pyhd8ed1ab_0 conda-forge
json5 0.9.25 pyhd8ed1ab_0 conda-forge
jsonpointer 2.4 py312hb401068_3 conda-forge
jsonschema 4.21.1 pyhd8ed1ab_0 conda-forge
jsonschema-specifications 2023.12.1 pyhd8ed1ab_0 conda-forge
jsonschema-with-format-nongpl 4.21.1 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 py312hb401068_0 conda-forge
jupyter_events 0.10.0 pyhd8ed1ab_0 conda-forge
jupyter_server 2.14.0 pyhd8ed1ab_0 conda-forge
jupyter_server_terminals 0.5.3 pyhd8ed1ab_0 conda-forge
jupyterlab 4.1.6 pyhd8ed1ab_0 conda-forge
jupyterlab_pygments 0.3.0 pyhd8ed1ab_1 conda-forge
jupyterlab_server 2.26.0 pyhd8ed1ab_0 conda-forge
libcxx 16.0.6 hd57cbcb_0 conda-forge
libexpat 2.6.2 h73e2aa4_0 conda-forge
libffi 3.4.2 h0d85af4_5 conda-forge
libsodium 1.0.18 hbcb3906_1 conda-forge
libsqlite 3.45.3 h92b6c6a_0 conda-forge
libzlib 1.2.13 h8a1eda9_5 conda-forge
markupsafe 2.1.5 py312h41838bb_0 conda-forge
matplotlib-inline 0.1.7 pyhd8ed1ab_0 conda-forge
mistune 3.0.2 pyhd8ed1ab_0 conda-forge
nbclient 0.10.0 pyhd8ed1ab_0 conda-forge
nbconvert-core 7.16.3 pyhd8ed1ab_1 conda-forge
nbformat 5.10.4 pyhd8ed1ab_0 conda-forge
ncurses 6.4.20240210 h73e2aa4_0 conda-forge
nest-asyncio 1.6.0 pyhd8ed1ab_0 conda-forge
notebook-shim 0.2.4 pyhd8ed1ab_0 conda-forge
openssl 3.2.1 hd75f5a5_1 conda-forge
overrides 7.7.0 pyhd8ed1ab_0 conda-forge
packaging 24.0 pyhd8ed1ab_0 conda-forge
pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge
parso 0.8.4 pyhd8ed1ab_0 conda-forge
pexpect 4.9.0 pyhd8ed1ab_0 conda-forge
pickleshare 0.7.5 py_1003 conda-forge
pip 24.0 pyhd8ed1ab_0 conda-forge
pkgutil-resolve-name 1.3.10 pyhd8ed1ab_1 conda-forge
platformdirs 4.2.0 pyhd8ed1ab_0 conda-forge
prometheus_client 0.20.0 pyhd8ed1ab_0 conda-forge
prompt-toolkit 3.0.42 pyha770c72_0 conda-forge
psutil 5.9.8 py312h41838bb_0 conda-forge
ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge
pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge
pycparser 2.22 pyhd8ed1ab_0 conda-forge
pygments 2.17.2 pyhd8ed1ab_0 conda-forge
pyobjc-core 10.2 py312h74abf1d_0 conda-forge
pyobjc-framework-cocoa 10.2 py312h74abf1d_0 conda-forge
pysocks 1.7.1 pyha2e5f31_6 conda-forge
python 3.12.3 h1411813_0_cpython conda-forge
python-dateutil 2.9.0 pyhd8ed1ab_0 conda-forge
python-fastjsonschema 2.19.1 pyhd8ed1ab_0 conda-forge
python-json-logger 2.0.7 pyhd8ed1ab_0 conda-forge
python_abi 3.12 4_cp312 conda-forge
pytz 2024.1 pyhd8ed1ab_0 conda-forge
pyyaml 6.0.1 py312h104f124_1 conda-forge
pyzmq 26.0.0 py312hb81df1d_0 conda-forge
readline 8.2 h9e318b2_1 conda-forge
referencing 0.34.0 pyhd8ed1ab_0 conda-forge
requests 2.31.0 pyhd8ed1ab_0 conda-forge
rfc3339-validator 0.1.4 pyhd8ed1ab_0 conda-forge
rfc3986-validator 0.1.1 pyh9f0ad1d_0 conda-forge
rpds-py 0.18.0 py312h1b0e595_0 conda-forge
send2trash 1.8.3 pyh31c8845_0 conda-forge
setuptools 69.5.1 pyhd8ed1ab_0 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
sniffio 1.3.1 pyhd8ed1ab_0 conda-forge
soupsieve 2.5 pyhd8ed1ab_1 conda-forge
stack_data 0.6.2 pyhd8ed1ab_0 conda-forge
terminado 0.18.1 pyh31c8845_0 conda-forge
tinycss2 1.2.1 pyhd8ed1ab_0 conda-forge
tk 8.6.13 h1abcd95_1 conda-forge
tomli 2.0.1 pyhd8ed1ab_0 conda-forge
tornado 6.4 py312h41838bb_0 conda-forge
traitlets 5.14.2 pyhd8ed1ab_0 conda-forge
types-python-dateutil 2.9.0.20240316 pyhd8ed1ab_0 conda-forge
typing-extensions 4.11.0 hd8ed1ab_0 conda-forge
typing_extensions 4.11.0 pyha770c72_0 conda-forge
typing_utils 0.1.0 pyhd8ed1ab_0 conda-forge
tzdata 2024a h0c530f3_0 conda-forge
uri-template 1.3.0 pyhd8ed1ab_0 conda-forge
urllib3 2.2.1 pyhd8ed1ab_0 conda-forge
wcwidth 0.2.13 pyhd8ed1ab_0 conda-forge
webcolors 1.13 pyhd8ed1ab_0 conda-forge
webencodings 0.5.1 pyhd8ed1ab_2 conda-forge
websocket-client 1.7.0 pyhd8ed1ab_0 conda-forge
wheel 0.43.0 pyhd8ed1ab_1 conda-forge
xz 5.2.6 h775f41a_0 conda-forge
yaml 0.2.5 h0d85af4_2 conda-forge
zeromq 4.3.5 h93d8f39_0 conda-forge
zipp 3.17.0 pyhd8ed1ab_0 conda-forge

conda env:
name: jupyter
channels:
- conda-forge
- defaults
dependencies:
- anyio=4.3.0=pyhd8ed1ab_0
- appnope=0.1.4=pyhd8ed1ab_0
- argon2-cffi=23.1.0=pyhd8ed1ab_0
- argon2-cffi-bindings=21.2.0=py312h104f124_4
- arrow=1.3.0=pyhd8ed1ab_0
- asttokens=2.4.1=pyhd8ed1ab_0
- async-lru=2.0.4=pyhd8ed1ab_0
- attrs=23.2.0=pyh71513ae_0
- babel=2.14.0=pyhd8ed1ab_0
- beautifulsoup4=4.12.3=pyha770c72_0
- bleach=6.1.0=pyhd8ed1ab_0
- brotli-python=1.1.0=py312heafc425_1
- bzip2=1.0.8=h10d778d_5
- ca-certificates=2024.2.2=h8857fd0_0
- cached-property=1.5.2=hd8ed1ab_1
- cached_property=1.5.2=pyha770c72_1
- certifi=2024.2.2=pyhd8ed1ab_0
- cffi=1.16.0=py312h38bf5a0_0
- charset-normalizer=3.3.2=pyhd8ed1ab_0
- comm=0.2.2=pyhd8ed1ab_0
- debugpy=1.8.1=py312hede676d_0
- decorator=5.1.1=pyhd8ed1ab_0
- defusedxml=0.7.1=pyhd8ed1ab_0
- entrypoints=0.4=pyhd8ed1ab_0
- exceptiongroup=1.2.0=pyhd8ed1ab_2
- executing=2.0.1=pyhd8ed1ab_0
- fqdn=1.5.1=pyhd8ed1ab_0
- h11=0.14.0=pyhd8ed1ab_0
- h2=4.1.0=pyhd8ed1ab_0
- hpack=4.0.0=pyh9f0ad1d_0
- httpcore=1.0.5=pyhd8ed1ab_0
- httpx=0.27.0=pyhd8ed1ab_0
- hyperframe=6.0.1=pyhd8ed1ab_0
- idna=3.7=pyhd8ed1ab_0
- importlib-metadata=7.1.0=pyha770c72_0
- importlib_metadata=7.1.0=hd8ed1ab_0
- importlib_resources=6.4.0=pyhd8ed1ab_0
- ipykernel=6.29.3=pyh3cd1d5f_0
- ipython=8.22.2=pyh707e725_0
- isoduration=20.11.0=pyhd8ed1ab_0
- jedi=0.19.1=pyhd8ed1ab_0
- jinja2=3.1.3=pyhd8ed1ab_0
- json5=0.9.25=pyhd8ed1ab_0
- jsonpointer=2.4=py312hb401068_3
- jsonschema=4.21.1=pyhd8ed1ab_0
- jsonschema-specifications=2023.12.1=pyhd8ed1ab_0
- jsonschema-with-format-nongpl=4.21.1=pyhd8ed1ab_0
- jupyter-lsp=2.2.5=pyhd8ed1ab_0
- jupyter_client=8.6.1=pyhd8ed1ab_0
- jupyter_core=5.7.2=py312hb401068_0
- jupyter_events=0.10.0=pyhd8ed1ab_0
- jupyter_server=2.14.0=pyhd8ed1ab_0
- jupyter_server_terminals=0.5.3=pyhd8ed1ab_0
- jupyterlab=4.1.6=pyhd8ed1ab_0
- jupyterlab_pygments=0.3.0=pyhd8ed1ab_1
- jupyterlab_server=2.26.0=pyhd8ed1ab_0
- libcxx=16.0.6=hd57cbcb_0
- libexpat=2.6.2=h73e2aa4_0
- libffi=3.4.2=h0d85af4_5
- libsodium=1.0.18=hbcb3906_1
- libsqlite=3.45.3=h92b6c6a_0
- libzlib=1.2.13=h8a1eda9_5
- markupsafe=2.1.5=py312h41838bb_0
- matplotlib-inline=0.1.7=pyhd8ed1ab_0
- mistune=3.0.2=pyhd8ed1ab_0
- nbclient=0.10.0=pyhd8ed1ab_0
- nbconvert-core=7.16.3=pyhd8ed1ab_1
- nbformat=5.10.4=pyhd8ed1ab_0
- ncurses=6.4.20240210=h73e2aa4_0
- nest-asyncio=1.6.0=pyhd8ed1ab_0
- notebook-shim=0.2.4=pyhd8ed1ab_0
- openssl=3.2.1=hd75f5a5_1
- overrides=7.7.0=pyhd8ed1ab_0
- packaging=24.0=pyhd8ed1ab_0
- pandocfilters=1.5.0=pyhd8ed1ab_0
- parso=0.8.4=pyhd8ed1ab_0
- pexpect=4.9.0=pyhd8ed1ab_0
- pickleshare=0.7.5=py_1003
- pip=24.0=pyhd8ed1ab_0
- pkgutil-resolve-name=1.3.10=pyhd8ed1ab_1
- platformdirs=4.2.0=pyhd8ed1ab_0
- prometheus_client=0.20.0=pyhd8ed1ab_0
- prompt-toolkit=3.0.42=pyha770c72_0
- psutil=5.9.8=py312h41838bb_0
- ptyprocess=0.7.0=pyhd3deb0d_0
- pure_eval=0.2.2=pyhd8ed1ab_0
- pycparser=2.22=pyhd8ed1ab_0
- pygments=2.17.2=pyhd8ed1ab_0
- pyobjc-core=10.2=py312h74abf1d_0
- pyobjc-framework-cocoa=10.2=py312h74abf1d_0
- pysocks=1.7.1=pyha2e5f31_6
- python=3.12.3=h1411813_0_cpython
- python-dateutil=2.9.0=pyhd8ed1ab_0
- python-fastjsonschema=2.19.1=pyhd8ed1ab_0
- python-json-logger=2.0.7=pyhd8ed1ab_0
- python_abi=3.12=4_cp312
- pytz=2024.1=pyhd8ed1ab_0
- pyyaml=6.0.1=py312h104f124_1
- pyzmq=26.0.0=py312hb81df1d_0
- readline=8.2=h9e318b2_1
- referencing=0.34.0=pyhd8ed1ab_0
- requests=2.31.0=pyhd8ed1ab_0
- rfc3339-validator=0.1.4=pyhd8ed1ab_0
- rfc3986-validator=0.1.1=pyh9f0ad1d_0
- rpds-py=0.18.0=py312h1b0e595_0
- send2trash=1.8.3=pyh31c8845_0
- setuptools=69.5.1=pyhd8ed1ab_0
- six=1.16.0=pyh6c4a22f_0
- sniffio=1.3.1=pyhd8ed1ab_0
- soupsieve=2.5=pyhd8ed1ab_1
- stack_data=0.6.2=pyhd8ed1ab_0
- terminado=0.18.1=pyh31c8845_0
- tinycss2=1.2.1=pyhd8ed1ab_0
- tk=8.6.13=h1abcd95_1
- tomli=2.0.1=pyhd8ed1ab_0
- tornado=6.4=py312h41838bb_0
- traitlets=5.14.2=pyhd8ed1ab_0
- types-python-dateutil=2.9.0.20240316=pyhd8ed1ab_0
- typing-extensions=4.11.0=hd8ed1ab_0
- typing_extensions=4.11.0=pyha770c72_0
- typing_utils=0.1.0=pyhd8ed1ab_0
- tzdata=2024a=h0c530f3_0
- uri-template=1.3.0=pyhd8ed1ab_0
- urllib3=2.2.1=pyhd8ed1ab_0
- wcwidth=0.2.13=pyhd8ed1ab_0
- webcolors=1.13=pyhd8ed1ab_0
- webencodings=0.5.1=pyhd8ed1ab_2
- websocket-client=1.7.0=pyhd8ed1ab_0
- wheel=0.43.0=pyhd8ed1ab_1
- xz=5.2.6=h775f41a_0
- yaml=0.2.5=h0d85af4_2
- zeromq=4.3.5=h93d8f39_0
- zipp=3.17.0=pyhd8ed1ab_0
prefix: /opt/miniconda3/envs/jupyter

Command Line Output
  • First instance output:
$ jupyter lab
[I 2024-04-18 16:46:17.985 ServerApp] jupyter_lsp | extension was successfully linked.
[I 2024-04-18 16:46:17.989 ServerApp] jupyter_server_terminals | extension was successfully linked.
[I 2024-04-18 16:46:17.993 ServerApp] jupyterlab | extension was successfully linked.
[I 2024-04-18 16:46:17.996 ServerApp] Writing Jupyter server cookie secret to /Users/chbrandt/Library/Jupyter/runtime/jupyter_cookie_secret
[I 2024-04-18 16:46:18.301 ServerApp] notebook_shim | extension was successfully linked.
[I 2024-04-18 16:46:18.340 ServerApp] notebook_shim | extension was successfully loaded.
[I 2024-04-18 16:46:18.342 ServerApp] jupyter_lsp | extension was successfully loaded.
[I 2024-04-18 16:46:18.344 ServerApp] jupyter_server_terminals | extension was successfully loaded.
[I 2024-04-18 16:46:18.345 LabApp] JupyterLab extension loaded from /opt/miniconda3/envs/jupyter/lib/python3.12/site-packages/jupyterlab
[I 2024-04-18 16:46:18.346 LabApp] JupyterLab application directory is /opt/miniconda3/envs/jupyter/share/jupyter/lab
[I 2024-04-18 16:46:18.346 LabApp] Extension Manager is 'pypi'.
[I 2024-04-18 16:46:18.394 ServerApp] jupyterlab | extension was successfully loaded.
[I 2024-04-18 16:46:18.395 ServerApp] Serving notebooks from local directory: /Users/chbrandt
[I 2024-04-18 16:46:18.395 ServerApp] Jupyter Server 2.14.0 is running at:
[I 2024-04-18 16:46:18.395 ServerApp] http://localhost:8888/lab?token=c666e684c3c51216812ed546b1638cb3ba53c198e0d24702
[I 2024-04-18 16:46:18.395 ServerApp]     http://127.0.0.1:8888/lab?token=c666e684c3c51216812ed546b1638cb3ba53c198e0d24702
[I 2024-04-18 16:46:18.395 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2024-04-18 16:46:18.406 ServerApp] 
    
    To access the server, open this file in a browser:
        file:///Users/chbrandt/Library/Jupyter/runtime/jpserver-72268-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/lab?token=c666e684c3c51216812ed546b1638cb3ba53c198e0d24702
        http://127.0.0.1:8888/lab?token=c666e684c3c51216812ed546b1638cb3ba53c198e0d24702
[I 2024-04-18 16:46:18.435 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-04-18 16:46:20.769 LabApp] Could not determine jupyterlab build status without nodejs
[I 2024-04-20 08:40:23.880 ServerApp] Kernel started: a2c78e2c-d9ea-43cb-aa1d-4f46d3fd7808
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
[I 2024-04-20 08:40:24.786 ServerApp] Connecting to kernel a2c78e2c-d9ea-43cb-aa1d-4f46d3fd7808.
[I 2024-04-20 08:40:24.788 ServerApp] Connecting to kernel a2c78e2c-d9ea-43cb-aa1d-4f46d3fd7808.
[I 2024-04-20 08:40:24.790 ServerApp] Connecting to kernel a2c78e2c-d9ea-43cb-aa1d-4f46d3fd7808.
[I 2024-04-20 08:43:09.989 ServerApp] Kernel started: 532d0852-e677-4db7-9736-27cb7ca9e6f8
[I 2024-04-20 08:43:10.671 ServerApp] Connecting to kernel 532d0852-e677-4db7-9736-27cb7ca9e6f8.
[I 2024-04-20 08:43:10.673 ServerApp] Connecting to kernel 532d0852-e677-4db7-9736-27cb7ca9e6f8.
[I 2024-04-20 08:43:10.675 ServerApp] Connecting to kernel 532d0852-e677-4db7-9736-27cb7ca9e6f8.
[I 2024-04-20 08:44:00.543 ServerApp] Kernel started: 10a3f0b2-627f-4d69-a4b4-bf21b0d97c5e
[I 2024-04-20 08:44:01.138 ServerApp] Connecting to kernel 10a3f0b2-627f-4d69-a4b4-bf21b0d97c5e.
[I 2024-04-20 08:44:01.140 ServerApp] Connecting to kernel 10a3f0b2-627f-4d69-a4b4-bf21b0d97c5e.
[I 2024-04-20 08:44:01.142 ServerApp] Connecting to kernel 10a3f0b2-627f-4d69-a4b4-bf21b0d97c5e.
[I 2024-04-20 08:56:35.535 ServerApp] New terminal with automatic name: 1
[I 2024-04-20 09:28:43.181 ServerApp] Connecting to kernel a2c78e2c-d9ea-43cb-aa1d-4f46d3fd7808.
[I 2024-04-20 09:28:43.204 ServerApp] Connecting to kernel 532d0852-e677-4db7-9736-27cb7ca9e6f8.
[I 2024-04-20 09:28:43.230 ServerApp] Connecting to kernel 10a3f0b2-627f-4d69-a4b4-bf21b0d97c5e.
[W 2024-04-20 09:28:43.265 LabApp] Could not determine jupyterlab build status without nodejs
[I 2024-04-20 09:28:43.799 ServerApp] Connecting to kernel 532d0852-e677-4db7-9736-27cb7ca9e6f8.
[I 2024-04-20 09:28:43.813 ServerApp] Connecting to kernel 10a3f0b2-627f-4d69-a4b4-bf21b0d97c5e.
[I 2024-04-20 09:28:43.838 ServerApp] Connecting to kernel a2c78e2c-d9ea-43cb-aa1d-4f46d3fd7808.
  • Second instance output:
$ jupyter lab
[I 2024-04-20 08:57:32.560 ServerApp] jupyter_lsp | extension was successfully linked.
[I 2024-04-20 08:57:32.564 ServerApp] jupyter_server_terminals | extension was successfully linked.
[I 2024-04-20 08:57:32.567 ServerApp] jupyterlab | extension was successfully linked.
[I 2024-04-20 08:57:32.766 ServerApp] notebook_shim | extension was successfully linked.
[I 2024-04-20 08:57:32.797 ServerApp] notebook_shim | extension was successfully loaded.
[I 2024-04-20 08:57:32.799 ServerApp] jupyter_lsp | extension was successfully loaded.
[I 2024-04-20 08:57:32.800 ServerApp] jupyter_server_terminals | extension was successfully loaded.
[I 2024-04-20 08:57:32.801 LabApp] JupyterLab extension loaded from /opt/miniconda3/envs/jupyter/lib/python3.12/site-packages/jupyterlab
[I 2024-04-20 08:57:32.801 LabApp] JupyterLab application directory is /opt/miniconda3/envs/jupyter/share/jupyter/lab
[I 2024-04-20 08:57:32.802 LabApp] Extension Manager is 'pypi'.
[I 2024-04-20 08:57:32.818 ServerApp] jupyterlab | extension was successfully loaded.
[I 2024-04-20 08:57:32.819 ServerApp] The port 8888 is already in use, trying another port.
[I 2024-04-20 08:57:32.819 ServerApp] Serving notebooks from local directory: /Users/chbrandt
[I 2024-04-20 08:57:32.819 ServerApp] Jupyter Server 2.14.0 is running at:
[I 2024-04-20 08:57:32.819 ServerApp] http://localhost:8889/lab?token=3d0e29bf3a91552d02d300f137291e9522b75ac448075a71
[I 2024-04-20 08:57:32.819 ServerApp]     http://127.0.0.1:8889/lab?token=3d0e29bf3a91552d02d300f137291e9522b75ac448075a71
[I 2024-04-20 08:57:32.819 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2024-04-20 08:57:32.828 ServerApp] 
    
    To access the server, open this file in a browser:
        file:///Users/chbrandt/Library/Jupyter/runtime/jpserver-85957-open.html
    Or copy and paste one of these URLs:
        http://localhost:8889/lab?token=3d0e29bf3a91552d02d300f137291e9522b75ac448075a71
        http://127.0.0.1:8889/lab?token=3d0e29bf3a91552d02d300f137291e9522b75ac448075a71
[I 2024-04-20 08:57:32.913 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-04-20 08:57:34.937 LabApp] Could not determine jupyterlab build status without nodejs
[I 2024-04-20 08:57:35.377 ServerApp] New terminal with automatic name: 1
[I 2024-04-20 08:57:35.530 ServerApp] Kernel started: 88f81c6e-7f43-4128-8950-953df335fb6e
[I 2024-04-20 08:57:35.532 ServerApp] Kernel started: 82ff477d-9f48-463a-9874-05bbabb6613d
[I 2024-04-20 08:57:35.541 ServerApp] Kernel started: c8e74a4f-5494-4185-a454-2fa9db4b21ae
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
[I 2024-04-20 08:57:36.275 ServerApp] Connecting to kernel 88f81c6e-7f43-4128-8950-953df335fb6e.
[I 2024-04-20 08:57:36.281 ServerApp] Connecting to kernel 82ff477d-9f48-463a-9874-05bbabb6613d.
[I 2024-04-20 08:57:36.287 ServerApp] Connecting to kernel c8e74a4f-5494-4185-a454-2fa9db4b21ae.
[I 2024-04-20 08:57:36.288 ServerApp] Connecting to kernel c8e74a4f-5494-4185-a454-2fa9db4b21ae.
[I 2024-04-20 08:57:36.290 ServerApp] Connecting to kernel c8e74a4f-5494-4185-a454-2fa9db4b21ae.
[I 2024-04-20 09:28:55.046 ServerApp] Connecting to kernel 88f81c6e-7f43-4128-8950-953df335fb6e.
[I 2024-04-20 09:28:55.071 ServerApp] Connecting to kernel 82ff477d-9f48-463a-9874-05bbabb6613d.
[W 2024-04-20 09:28:55.080 LabApp] Could not determine jupyterlab build status without nodejs
[I 2024-04-20 09:28:55.089 ServerApp] Connecting to kernel c8e74a4f-5494-4185-a454-2fa9db4b21ae.
[I 2024-04-20 09:28:55.487 ServerApp] Connecting to kernel c8e74a4f-5494-4185-a454-2fa9db4b21ae.
[I 2024-04-20 09:28:55.503 ServerApp] Connecting to kernel 88f81c6e-7f43-4128-8950-953df335fb6e.
[I 2024-04-20 09:28:55.519 ServerApp] Connecting to kernel 82ff477d-9f48-463a-9874-05bbabb6613d.
@chbrandt chbrandt added the bug label Apr 20, 2024
@jupyterlab-probot jupyterlab-probot bot added the status:Needs Triage Applied to new issues that need triage label Apr 20, 2024
Copy link

welcome bot commented Apr 20, 2024

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! 🎉

@krassowski
Copy link
Member

@chbrandt it appears that your instances might share the workspaces directory:
https://jupyterlab.readthedocs.io/en/stable/user/directories.html#jupyterlab-workspaces-directory (and probably also settings directory, https://jupyterlab.readthedocs.io/en/stable/user/directories.html#jupyterlab-user-settings-directory).

If you want them independent you need to configure the paths to be in different places. For example, JupyterLab Desktop does it for users automatically.

@chbrandt
Copy link
Contributor Author

Hi @krassowski , thanks for this answer. While workspaces are a great feature (besides being necessary, afaiu), it felt strange to me, to have the same workspace being used by two different instances. Is this the expected behaviour?

@JasonWeill
Copy link
Contributor

I think it may be the expected behavior when you run two servers from the same root directory, although I agree with you that it seems surprising.

@chbrandt
Copy link
Contributor Author

chbrandt commented May 3, 2024

Hi @JasonWeill . That was a nice observation (ie, "when running servers from the same root directory"), I went to check that; The same behaviour happens when starting the servers from different directories.

Check below the four screenshots representing the four servers I instantiated.

  • The first two, "8888" and "8889", are instances started from the same directory, "~/tmp".

    • The directory (tmp/) was initially empty
      1. I created a notebook (Untitled.ipynb) and a text (untitled.txt) file from the first server (8888), I also started a Console session as well as a Terminal session.
      2. Then, I instantiated the second server (8889) to reproduce and check the behaviour initially reported. As expected, the workspace from "8888" (the first server), was restored: Untitled.ipynb, untitled.txt, Console, and Terminal sessions.
  • The third server, "8890", was started from my user's home directory, "~/". Notice that the Console and Terminal sessions were restored (sure enough, the corresponding files were not open because they are not there from this server perspective).

  • The fourth server, "8891", is then launched from yet another directory, now under "tmp/", from "~/tmp/anothe_tmp" just to double check the behaviour. Again, Console and Terminal sessions were restored.

  • 1st server
    image

  • 2nd server
    image

  • 3rd server
    image

  • 4th server
    image

@krassowski
Copy link
Member

"when running servers from the same root directory"), I went to check that; The same behaviour happens when starting the servers from different directories.

Yes, because by default the workspaces directory, a.k.a JUPYTERLAB_WORKSPACES_DIR is defined as $HOME/.jupyter/lab/workspaces/ so it is indifferent to the root directory from which you start JupyterLab from (again, unless you are using JupyterLab Desktop which sets it per root directory).

This would be solved by implementing #12916 Project support via a hidden directory (which is what JupyterLab Desktop does).

Should we close this issue as a duplicate of #11120?

@krassowski
Copy link
Member

This would be solved by implementing #12916 (which is what JupyterLab Desktop does).

Separately, maybe worth asking: if JupyterLab Desktop solves it well, should we just recommend it to users over installation of barebone JupyterLab for this kind of a local use case? What are the key pain points that prevent users from using JupyterLab Desktop?

@chbrandt
Copy link
Contributor Author

chbrandt commented May 3, 2024

Closing this in favour of the discussion in #11120 (same issue) and the proposal in #12916 (project folder).

How can I help to make 12916 happen, @krassowski? I would be happy to put my hands on the code around it, but I would need some guidance.

@chbrandt chbrandt closed this as completed May 3, 2024
@krassowski
Copy link
Member

krassowski commented May 3, 2024

#12916 would probably need to be implemented in jupyterlab-server and jupyterlab, we would need :

  • a new level to the current settings levels (sys_prefix = virtual env, local = user directory, system - OS-wide); it would work similar to overrides.json but would pick up a file discovered by directory traversal
  • a new default search location for workspaces (which could still be overridden by JUPYTERLAB_WORKSPACES_DIR)

Its a deep dive across the core of the application, but it should not be too time-consuming because the codebase is actually small here (just need to flip back and forth between jupyterlab-server and jupyterlab).

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

3 participants