microsoft / vscode-jupyter-hub

Jupyter Hub Support in VS Code
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter-hub
MIT License
9 stars 7 forks source link

Wrong DNS resolution #56

Closed michalkahle closed 3 months ago

michalkahle commented 6 months ago

Environment data

Expected behaviour

Connect to JupyterHub running at 172.17.63.10.

Actual behaviour

Tries to connect to a wrong IP (172.16.99.211). Times out. Error sending request to https://horus.ikem.cz/hub/api FetchError: request to https://horus.ikem.cz/hub/api failed, reason: connect ETIMEDOUT 172.16.99.211:443

Attempts to diagnose/fix the problem:

  1. I've tested in the browser that https://horus.ikem.cz/hub/api returns json {"version": "1.5.1"}
  2. I've tried to flush DNS cache with sudo resolvectl flush-caches
  3. I've tried to add the correct IP address to /etc/hosts
  4. I've tested connection from node:
    node -e 'fetch("https://horus.ikem.cz/hub/api").then(resp => { console.log(resp.status, resp.statusText); })'
    200 OK

Logs

Output for Jupyter in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Jupyter)

``` 18:40:59.930 [error] Error sending request to https://horus.ikem.cz/hub/api FetchError: request to https://horus.ikem.cz/hub/api failed, reason: connect ETIMEDOUT 172.16.99.211:443 > at ClientRequest. (/home/mkah/.vscode-server/extensions/ms-toolsai.jupyter-hub-2023.10.1003012305/dist/extension.node.js:63581:18) > type = system > errno = ETIMEDOUT > code = ETIMEDOUT 18:43:11.001 [error] Error sending request to https://horus.ikem.cz/hub/api FetchError: request to https://horus.ikem.cz/hub/api failed, reason: connect ETIMEDOUT 172.16.99.211:443 > at ClientRequest. (/home/mkah/.vscode-server/extensions/ms-toolsai.jupyter-hub-2023.10.1003012305/dist/extension.node.js:63581:18) > type = system > errno = ETIMEDOUT > code = ETIMEDOUT 18:43:11.002 [error] Failed to determine base url for https://horus.ikem.cz Error: Unable to determine base url of Jupyter Hub Server > at getJupyterHubBaseUrl (/home/mkah/.vscode-server/extensions/ms-toolsai.jupyter-hub-2023.10.1003012305/dist/extension.node.js:64314:9) ```

DonJayamanne commented 3 months ago

Sorry for not getting back to you on this, please can you try the following

ms-toolsai-jupyter-hub-insiders.vsix.zip

Screenshot for enabling logging

Image

To get to the logs, please open the bottom output panel (use the command Outupt: Focus Output View) & then select JupyterHub

Image

michalkahle commented 3 months ago

Hi @DonJayamanne, thanks for support! I've loaded the vsix (v2024.5.100) and indeed was able to connect to our JupyterHub server. However, the Jupyter extension seems broken now:

Visual Studio Code (1.92.0, undefined, desktop)
Jupyter Extension Version: 2024.7.0.
Python Extension Version: 2024.12.1.
Pylance Extension Version: 2024.7.1.
Platform: linux (x64).
Workspace folder /, Home = /home/mkah
10:25:17.980 [warn] No interpreter with path ~/miniconda3/envs/py3.10/bin/python found in Python API, will convert Uri path to string as Id ~/miniconda3/envs/py3.10/bin/python
10:28:46.383 [warn] Disposing old controller startUsingPythonInterpreter:'.jvsc74a57bd031f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6./usr/bin/python3./usr/bin/python3.-m#ipykernel_launcher' for view = 'jupyter-notebook'
10:28:46.386 [warn] Disposing old controller startUsingPythonInterpreter:'.jvsc74a57bd031f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6./usr/bin/python3./usr/bin/python3.-m#ipykernel_launcher (Interactive)' for view = 'interactive'
10:30:19.241 [info] Starting Kernel (py3.11m) for 'Untitled-1.ipynb' (disableUI=false)
10:30:19.444 [info] https://horus.ikem.cz/user/~/: Kernel started: ea327278-a088-4211-9f5a-6372ebd3066a
10:30:20.830 [info] Started session for kernel startUsingRemoteKernelSpec:19a3488393a47caa2aee7e727482d7329de6e52a2b5a825773555b207f1f4112..py3.11m./home/~/mf3/envs/py3.11m/python./.-m#ipykernel_launcher
10:30:20.957 [info] Kernel successfully started
10:30:21.015 [error] Exception while handling messages: TypeError: First argument to DataView constructor must be an ArrayBuffer
10:30:21.016 [error] Exception while handling messages: TypeError: First argument to DataView constructor must be an ArrayBuffer
10:30:21.017 [error] Exception while handling messages: TypeError: First argument to DataView constructor must be an ArrayBuffer
10:30:21.018 [error] Exception while handling messages: TypeError: First argument to DataView constructor must be an ArrayBuffer
10:30:21.026 [error] Exception while handling messages: TypeError: First argument to DataView constructor must be an ArrayBuffer
10:30:21.028 [error] Exception while handling messages: TypeError: First argument to DataView constructor must be an ArrayBuffer
10:30:21.028 [error] Exception while handling messages: TypeError: First argument to DataView constructor must be an ArrayBuffer
10:30:21.029 [error] Exception while handling messages: TypeError: First argument to DataView constructor must be an ArrayBuffer
michalkahle commented 3 months ago

I have tried to switch to release version of JupyterHub extension (v2023.10.1003012305) and both connection and communicating with the kernel seem to work. I used the remembered connection to JupyterHub.

DonJayamanne commented 3 months ago

Exception while handling messages: TypeError: First argument to DataView constructor must be an ArrayBuffer 10:30:21.017 [error] Exception w

Duplicate of #64

DonJayamanne commented 3 months ago

I have tried to switch to release version of JupyterHub extension (v2023.10.1003012305) and both connection and communicating with the kernel seem to work. I used the remembered connection to JupyterHub.

Sorry you are running into this issue, We've identified an issue with execution of cells against Jupyter Hub.