microsoft / vscode-jupyter

VS Code Jupyter extension
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
MIT License
1.28k stars 290 forks source link

Jupyter notebooks not running #13187

Closed jerrylin96 closed 1 year ago

jerrylin96 commented 1 year ago

Type: Bug

The would just have an infinite spinning loop where nothing would run. Interrupting and restarting the notebook wouldn't work (wouldn't let me do either). Persists when restarting.

VS Code version: Code 1.76.2 (Universal) (ee2b180d582a7f601fa6ecfdad8d9fd269ab1884, 2023-03-14T17:54:09.061Z) OS version: Darwin arm64 22.3.0 Modes: Sandboxed: No Remote OS version: Linux x64 4.18.0-193.28.1.el8_2.x86_64

System Info |Item|Value| |---|---| |CPUs|Apple M1 (8 x 24)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|2, 2, 2| |Memory (System)|16.00GB (1.09GB free)| |Process Argv|--crash-reporter-id e2493ef2-63f6-4853-8d76-bd91aaff010d| |Screen Reader|no| |VM|0%| |Item|Value| |---|---| |Remote|SSH: bridges2.psc.edu| |OS|Linux x64 4.18.0-193.28.1.el8_2.x86_64| |CPUs|AMD EPYC 7742 64-Core Processor (256 x 3309)| |Memory (System)|251.09GB (77.65GB free)| |VM|0%|
Extensions (31) Extension|Author (truncated)|Version ---|---|--- remotehub|Git|0.52.0 jupyter-keymap|ms-|1.1.0 remote-containers|ms-|0.282.0 remote-ssh|ms-|0.98.0 remote-ssh-edit|ms-|0.84.0 remote-wsl|ms-|0.76.1 vscode-remote-extensionpack|ms-|0.24.0 azure-repos|ms-|0.28.0 remote-explorer|ms-|0.3.2023032309 remote-repositories|ms-|0.30.0 remote-server|ms-|1.0.0 linter-gfortran|for|3.2.0 copilot|Git|1.78.9758 vscode-docker|ms-|1.24.0 vscode-kubernetes-tools|ms-|1.3.11 isort|ms-|2022.8.0 python|ms-|2023.4.1 vscode-pylance|ms-|2023.3.30 jupyter|ms-|2023.2.1200692131 jupyter-keymap|ms-|1.1.0 jupyter-renderers|ms-|1.0.15 vscode-jupyter-cell-tags|ms-|0.1.8 vscode-jupyter-powertoys|ms-|0.0.6 vscode-jupyter-slideshow|ms-|0.1.5 cmake-tools|ms-|1.13.45 cpptools|ms-|1.14.5 cpptools-extension-pack|ms-|1.3.0 powershell|ms-|2023.2.1 vscode-yaml|red|1.12.2 intellicode-api-usage-examples|Vis|0.2.7 vscodeintellicode|Vis|1.2.30 (4 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 pythonvspyl392:30443607 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscorecescf:30445987 pythondataviewer:30285071 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593cf:30376535 pythonvs932:30410667 cppdebug:30492333 vsclangdf:30486550 c4g48928:30535728 dsvsc012:30540252 pynewext54:30695312 azure-dev_surveyone:30548225 vscccc:30610679 pyindex848:30662994 nodejswelcome1cf:30587006 3biah626:30602489 pyind779:30671433 89544117:30613380 pythonsymbol12:30671437 a9j8j154:30646983 showlangstatbar:30672706 vsccsb:30677849 pythonb192cf:30669361 azdwalk:30687957 pythonms35cf:30686773 ```
DonJayamanne commented 1 year ago

Thank you for filing this issue, I believe this has been resolved in the latest version of the jupyter extension (which will be released some time this week)

You can try this out now, please let me know how this goes

Screenshot 2023-02-04 at 09 24 37
jerrylin96 commented 1 year ago

Somehow everything was working until I updated to the newest version today. When I tunnel into the remote notebook where by tunneling I essentially mean this:

1.) When logged into the HPC I will access a compute node with something like this: interact -n 32 -p node-shared -t 1:00:00

The HPC will give me the name of the node, let's say it's r177.

2.) On another terminal on my desktop I will tunnel into HPC with a port number, say 8765: ssh -L localhost:8765:localhost:8765 username@hpc.university.edu

3.) On this same terminal, I will tunnel into the compute node using that port number and the name of the node: ssh -L localhost:8765:localhost:8765 r177

4.) Back on the original HPC window in VScode I will tunnel into the notebook conda activate myenvironment jupyter lab --port=8765 --no-browser --ip=0.0.0.0

Basically following directions here: https://github.com/microsoft/vscode-jupyter/wiki/Connecting-to-a-remote-Jupyter-server-from-vscode.dev

For whatever reason, I'm having issue getting connected period. I get the following error when I "Select a Jupyter Server" and enter the URL:

"A Server with this URL already exists"

However, it won't let me locate or connect to any existing jupyter server...

DonJayamanne commented 1 year ago

This is a duplicate of https://github.com/microsoft/vscode-jupyter/issues/13240

Tibiritabara commented 1 year ago

Same issue here. In my scenario I am just trying to launch a local docker container with jupyter and connect the WSL VSCode to the server.

When pressing the button 'Select kernel' and putting the local jupyter URL works for the first time. Then closing VSCode, killing the container, and when launching a new container with Jupyter and trying the same steps once again, it asks for the URL of the remote kernel twice, and the second time it says the same message reported "A Server with this URL already exists".

Additionally, there is a process in the background still trying to connect to the old container that I have not found anyways to cleanup, as it is constantly saying "Forbidden" in the logs (the token was updated with the new container).

To reproduce the issue is simple:

  1. Create a local container with Jupyter:

    FROM python:3.10
    RUN apt update && apt upgrade -y 
    ARG USER
    RUN useradd -ms /bin/bash ${USER}
    USER ${USER}:${USER}
    RUN python3 -m pip install --no-cache-dir --upgrade --user pip
    ENV PATH="$PATH:/home/${USER}/.local/bin"
    WORKDIR /app
    RUN python3 -m pip install --user jupyterlab
    CMD ["jupyter", "lab", "--ip='0.0.0.0'", "--no-browser", "--ServerApp.allow_origin='*'", "--NotebookApp.directory='/app'"] 
  2. Use the select kernel button to connect to the generated url by that container.

  3. Restart the container. It will require a new token

  4. Use the select kernel button again

From there on, the forbidden error is going to be permanently on the logs, and the connection to the remote kernel is permanently damaged.