microsoft / vscode-jupyter

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

Unable to connect to a Jupyter Lab server in a Docker container in a remote SSH host #15741

Closed mothguib closed 1 month ago

mothguib commented 3 months ago

Environment data

Expected behaviour

VS Code should connect to the Jupyter Server running in a Docker container on a SSH remote without returning 404 errors, allowing seamless interaction with Jupyter notebooks within the editor.

Actual behaviour

VS Code fails to connect to the Jupyter Server, returning 404 errors for /hub/api and /tree? endpoints, despite the server being accessible through a browser.

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Run a Jupyter Server inside a Docker container on a remote SSH host.
  2. Ensure the Jupyter Server is accessible via a browser.
  3. Attempt to connect to the Jupyter Server using VS Code with the correct URI.

Logs

When entering the http://localhost:8888 or http://localhost:8888/lab URL of the Jupyter Lab, in its Docker container the Jupyter Lab returns, and VS Code asks for a password:

``` myproject | [W 2024-06-04 13:59:37.422 ServerApp] 404 GET /hub/api (8e7c766ca67041518bbe56aca79a13c2@172.27.0.1) 8.93ms referer=None myproject| [W 2024-06-04 13:59:37.425 ServerApp] 404 GET /tree? (30e563cbea704f87976dd231cc23ad1b@172.27.0.1) 0.70ms referer=None ```

Docker Compose Configuration

``` networks: myproject-net: driver: bridge services: ############################ # Jupyter Lab container ############################ jupyter-myproject: build: jupyter container_name: myproject restart: always entrypoint: jupyter lab --allow-root --ip="0.0.0.0" --NotebookApp.token='' --NotebookApp.disable_check_xsrf=True # --NotebookApp.password='' # --NotebookApp.iopub_data_rate_limit=10000000000 # --NotebookApp.iopub_msg_rate_limit=10000000000 # --NotebookApp.rate_limit_window=3.0 # --NotebookApp.open_browser=False environment: - JUPYTER_ENABLE_LAB=yes runtime: nvidia # network_mode: "host" networks: - myproject-net # ############################## # Customizable settings # ############################## ports: # This port is to connect to the debugger. Port 5684 is random and can be changed. It needs to be the same as the port number defined in .vscode/launch.json - 5684:5678 # Port 8888 is used to connect to jupyter lab. It can be changed (just make sure to use the proper port to connect to jupyter later) - 8888:8888 volumes: # /workspace points to the root directory of your project # Other volumes (directory for data, logs, etc. can be added here) - ${PWD}/..:/workspace ```

DonJayamanne commented 1 month ago

Please could you enable logging as follows:

vs-code-engineering[bot] commented 1 month ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!