microsoft / vscode-jupyter

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

The kernel died: ERR_INVALID URL #15978

Closed hsm207 closed 1 week ago

hsm207 commented 2 weeks ago

Type: Bug

  1. Create a devcontainer using image mcr.microsoft.com/devcontainers/python:1-3.12-bullseye

  2. Install ipykernel package and the jupyter and python extensions

  3. Create a new notebook, select a python kernel and enter 1+1 in a cell and click run

The output from the Jupyter extension:

21:27:47.037 [error] Failed to request kernel info Canceled: Canceled
    at i.value (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:181:22014)
    at n.B (/~/~-server/bin/linux-arm64/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:83:737)
    at n.fire (/~/~-server/bin/linux-arm64/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:83:954)
    at R.cancel (/~/~-server/bin/linux-arm64/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:83:5370)
    at L.cancel (/~/~-server/bin/linux-arm64/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:83:5780)
    at Timeout._onTimeout (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:304:11746)
    at listOnTimeout (node:internal/timers:573:17)
    at processTimers (node:internal/timers:514:7)
21:27:47.047 [warn] Failed to shutdown kernel, .jvsc74a57bd0949777d72b0d2535278d3dc13498b2535136f6dfe0678499012e853ee9abcab1./usr/local/python./usr/local/python.-m#ipykernel_launcher TypeError: Failed to parse URL from /api/kernels/8fa859e5-4918-41e4-984a-ae7959f79ea0?1725139667046
    at new Request (node:internal/deps/undici/undici:4855:19)
    at Object.t [as handleRequest] (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/node_modules/@jupyterlab/services/lib/kernel/nonSerializingKernel.js:11:2054)
    ... 8 lines matching cause stack trace ...
    at Function.wrapKernelMethodImpl (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:304:82121) {
  [cause]: TypeError: Invalid URL
      at new URL (node:internal/url:797:36)
      at new Request (node:internal/deps/undici/undici:4853:25)
      at Object.t [as handleRequest] (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/node_modules/@jupyterlab/services/lib/kernel/nonSerializingKernel.js:11:2054)
      at Object.t [as makeRequest] (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/node_modules/@jupyterlab/services/lib/kernel/nonSerializingKernel.js:11:730)
      at Object.Vl [as shutdownKernel] (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/node_modules/@jupyterlab/services/lib/kernel/nonSerializingKernel.js:11:5781)
      at n.shutdown (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/node_modules/@jupyterlab/services/lib/kernel/nonSerializingKernel.js:11:89571)
      at R_.start (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:304:12333)
      at A_.startKernel (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:304:21270)
      at Ry.create (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:304:23577)
      at YD.createJupyterSession (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:285:35993)
      at YD.startJupyterSession (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:285:34001)
      at Function.wrapKernelMethodImpl (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:304:82121) {
    code: 'ERR_INVALID_URL',
    input: '/api/kernels/8fa859e5-4918-41e4-984a-ae7959f79ea0?1725139667046'
  }
}
21:27:47.053 [error] Disposing session as kernel process died ExitCode: undefined, Reason: undefined
21:27:47.085 [error] Failed to connect raw kernel session: Error: The kernel died. Error: ... View Jupyter [log](command:jupyter.viewOutput) for further details.
21:27:47.087 [warn] Error occurred while trying to start the kernel, options.disableUI=false Error: The kernel died. Error: ... View Jupyter [log](command:jupyter.viewOutput) for further details.
    > Kernel Id = .jvsc74a57bd0949777d72b0d2535278d3dc13498b2535136f6dfe0678499012e853ee9abcab1./usr/local/python./usr/local/python.-m#ipykernel_launcher
    > Interpreter Id = /usr/local/bin/python
    > at R_.<anonymous> (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:304:11641)
    > stdErr = 
21:27:47.087 [warn] Kernel Error, context = start Error: The kernel died. Error: ... View Jupyter [log](command:jupyter.viewOutput) for further details.
    > Kernel Id = .jvsc74a57bd0949777d72b0d2535278d3dc13498b2535136f6dfe0678499012e853ee9abcab1./usr/local/python./usr/local/python.-m#ipykernel_launcher
    > Interpreter Id = /usr/local/bin/python
    > at R_.<anonymous> (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:304:11641)
    > stdErr = 
21:27:47.146 [warn] Failed to get activated env vars for /usr/local/bin/python in 58ms
21:27:47.146 [error] Unable to determine site packages path for python /usr/local/bin/python (Unknown)
21:27:47.151 [info] Process Execution: /usr/local/bin/python -c "import ipykernel;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
21:27:47.256 [info] Dispose Kernel '/workspaces/graphrag/.devcontainer/scratch.ipynb' associated with '/workspaces/graphrag/.devcontainer/scratch.ipynb'
21:27:47.257 [error] Error in execution Error: The kernel died. Error: ... View Jupyter [log](command:jupyter.viewOutput) for further details.
    > Kernel Id = .jvsc74a57bd0949777d72b0d2535278d3dc13498b2535136f6dfe0678499012e853ee9abcab1./usr/local/python./usr/local/python.-m#ipykernel_launcher
    > Interpreter Id = /usr/local/bin/python
    > at R_.<anonymous> (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:304:11641)
    > stdErr = 
21:27:47.258 [error] Error in execution (get message for cell) Error: The kernel died. Error: ... View Jupyter [log](command:jupyter.viewOutput) for further details.
    > Kernel Id = .jvsc74a57bd0949777d72b0d2535278d3dc13498b2535136f6dfe0678499012e853ee9abcab1./usr/local/python./usr/local/python.-m#ipykernel_launcher
    > Interpreter Id = /usr/local/bin/python
    > at R_.<anonymous> (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:304:11641)
    > stdErr = 
21:27:47.262 [info] Process Execution: /usr/local/bin/python -c "import ipykernel;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"

Extension version: 2024.7.0 VS Code version: Code 1.92.2 (Universal) (fee1edb8d6d72a0ddff41e5f71a671c23ed924b9, 2024-08-14T17:29:30.058Z) OS version: Darwin arm64 23.6.0 Modes: Connection to 'Dev Container: Go @ desktop-linux' could not be established Canceled Connection to 'Dev Container: Default Linux Universal @ desktop-linux' could not be established Canceled Connection to 'Dev Container: Python 3 @ desktop-linux' could not be established Canceled Remote OS version: Linux arm64 6.10.4-linuxkit

System Info |Item|Value| |---|---| |CPUs|Apple M1 Max (10 x 2400)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off| |Load (avg)|5, 5, 5| |Memory (System)|32.00GB (0.07GB free)| |Process Argv|--crash-reporter-id 2a768ca4-5346-4b1b-8ddc-e1e818aac68e| |Screen Reader|no| |VM|0%| Connection to 'Dev Container: Go @ desktop-linux' could not be established Canceled Connection to 'Dev Container: Default Linux Universal @ desktop-linux' could not be established Canceled Connection to 'Dev Container: Python 3 @ desktop-linux' could not be established Canceled |Item|Value| |---|---| |Remote|Dev Container: Python 3 @ desktop-linux| |OS|Linux arm64 6.10.4-linuxkit| |CPUs|unknown (10 x 0)| |Memory (System)|31.30GB (28.83GB free)| |VM|0%|
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805cf:30301675 binariesv615:30325510 vsaa593:30376534 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 2i9eh265:30646982 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonnoceb:30805159 asynctok:30898717 pythonregdiag2:30936856 pythonmypyd1:30879173 h48ei257:31000450 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 01bff139:31013167 pythoncenvpt:31062603 a69g1124:31058053 dvdeprecation:31068756 dwnewjupytercf:31046870 newcmakeconfigv2:31071590 impr_priority:31102340 refactort:31108082 pythonrstrctxt:31112756 wkspc-onlycs-c:31111717 wkspc-ranged-t:31125599 ei213698:31121563 aajjf12562:31125793 ```
DonJayamanne commented 2 weeks ago

Please can you share the full logs

hsm207 commented 1 week ago

How do i share the full logs? Is it in a file somewhere or something?

DonJayamanne commented 1 week ago

21:27:47.037 [error] Failed to request kernel info Canceled: Canceled at i.value (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-a

The logs you have above is what we need.

hsm207 commented 1 week ago

Here is the entire output I copied from the top to the end:

Visual Studio Code (1.92.2, dev-container, desktop)
Jupyter Extension Version: 2024.7.0.
Python Extension Version: 2024.12.3.
Pylance Extension Version: 2024.8.2.
Platform: linux (arm64).
Multiple Workspace folders opened /workspaces/graphrag, /workspaces/graphrag/ragtest-local, /workspaces/graphrag/ragtest-openai
09:32:50.503 [info] Starting Kernel (Python Path: /usr/local/bin/python, Unknown, 3.11.4) for '/workspaces/graphrag/.devcontainer/scratch.ipynb' (disableUI=true)
09:32:52.175 [warn] Failed to get activated env vars for /usr/local/bin/python in 1674ms
09:32:52.183 [warn] Failed to get activated env vars for /usr/local/bin/python in 1037ms
09:32:52.235 [info] Process Execution: /usr/local/bin/python -c "import site;print("USER_BASE_VALUE");print(site.USER_BASE);print("USER_BASE_VALUE");"
09:32:52.260 [error] Unable to determine site packages path for python /usr/local/bin/python (Unknown)
09:32:52.261 [error] Unable to determine site packages path for python /usr/local/bin/python (Unknown)
09:32:52.267 [info] Process Execution: /usr/local/bin/python -m pip list
09:32:52.272 [info] Process Execution: /usr/local/bin/python -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
09:32:52.286 [info] Process Execution: /usr/local/bin/python -m ipykernel_launcher --f=/home/~/.local/share/jupyter/runtime/kernel-v2-12822yUN9kM3Zwhpz.json
    > cwd: //workspaces/graphrag/.devcontainer
09:33:52.701 [error] Failed to request kernel info Canceled: Canceled
    at i.value (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:181:22014)
    at n.B (/~/~-server/bin/linux-arm64/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:83:737)
    at n.fire (/~/~-server/bin/linux-arm64/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:83:954)
    at R.cancel (/~/~-server/bin/linux-arm64/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:83:5370)
    at L.cancel (/~/~-server/bin/linux-arm64/fee1edb8d6d72a0ddff41e5f71a671c23ed924b9/out/vs/workbench/api/node/extensionHostProcess.js:83:5780)
    at Timeout._onTimeout (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:304:11746)
    at listOnTimeout (node:internal/timers:573:17)
    at processTimers (node:internal/timers:514:7)
09:33:52.742 [warn] Failed to shutdown kernel, .jvsc74a57bd0949777d72b0d2535278d3dc13498b2535136f6dfe0678499012e853ee9abcab1./usr/local/python./usr/local/python.-m#ipykernel_launcher TypeError: Failed to parse URL from /api/kernels/6bedd0cf-cd69-4f57-aaa8-3285275e16aa?1725269632740
    at new Request (node:internal/deps/undici/undici:4855:19)
    at Object.t [as handleRequest] (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/node_modules/@jupyterlab/services/lib/kernel/nonSerializingKernel.js:11:2054)
    ... 8 lines matching cause stack trace ...
    at Function.wrapKernelMethodImpl (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:304:82121) {
  [cause]: TypeError: Invalid URL
      at new URL (node:internal/url:797:36)
      at new Request (node:internal/deps/undici/undici:4853:25)
      at Object.t [as handleRequest] (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/node_modules/@jupyterlab/services/lib/kernel/nonSerializingKernel.js:11:2054)
      at Object.t [as makeRequest] (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/node_modules/@jupyterlab/services/lib/kernel/nonSerializingKernel.js:11:730)
      at Object.Vl [as shutdownKernel] (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/node_modules/@jupyterlab/services/lib/kernel/nonSerializingKernel.js:11:5781)
      at n.shutdown (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/node_modules/@jupyterlab/services/lib/kernel/nonSerializingKernel.js:11:89571)
      at R_.start (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:304:12333)
      at A_.startKernel (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:304:21270)
      at Ry.create (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:304:23577)
      at YD.createJupyterSession (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:285:35993)
      at YD.startJupyterSession (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:285:34001)
      at Function.wrapKernelMethodImpl (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:304:82121) {
    code: 'ERR_INVALID_URL',
    input: '/api/kernels/6bedd0cf-cd69-4f57-aaa8-3285275e16aa?1725269632740'
  }
}
09:33:52.777 [error] Disposing session as kernel process died ExitCode: undefined, Reason: undefined
09:33:52.810 [error] Failed to connect raw kernel session: Error: The kernel died. Error: ... View Jupyter [log](command:jupyter.viewOutput) for further details.
09:33:52.813 [warn] Error occurred while trying to start the kernel, options.disableUI=false Error: The kernel died. Error: ... View Jupyter [log](command:jupyter.viewOutput) for further details.
    > Kernel Id = .jvsc74a57bd0949777d72b0d2535278d3dc13498b2535136f6dfe0678499012e853ee9abcab1./usr/local/python./usr/local/python.-m#ipykernel_launcher
    > Interpreter Id = /usr/local/bin/python
    > at R_.<anonymous> (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:304:11641)
    > stdErr = 
09:33:52.817 [warn] Kernel Error, context = start Error: The kernel died. Error: ... View Jupyter [log](command:jupyter.viewOutput) for further details.
    > Kernel Id = .jvsc74a57bd0949777d72b0d2535278d3dc13498b2535136f6dfe0678499012e853ee9abcab1./usr/local/python./usr/local/python.-m#ipykernel_launcher
    > Interpreter Id = /usr/local/bin/python
    > at R_.<anonymous> (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:304:11641)
    > stdErr = 
09:33:52.889 [warn] Failed to get activated env vars for /usr/local/bin/python in 64ms
09:33:52.890 [error] Unable to determine site packages path for python /usr/local/bin/python (Unknown)
09:33:52.898 [info] Process Execution: /usr/local/bin/python -c "import ipykernel;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
09:33:53.085 [info] Dispose Kernel '/workspaces/graphrag/.devcontainer/scratch.ipynb' associated with '/workspaces/graphrag/.devcontainer/scratch.ipynb'
09:33:53.088 [error] Error in execution Error: The kernel died. Error: ... View Jupyter [log](command:jupyter.viewOutput) for further details.
    > Kernel Id = .jvsc74a57bd0949777d72b0d2535278d3dc13498b2535136f6dfe0678499012e853ee9abcab1./usr/local/python./usr/local/python.-m#ipykernel_launcher
    > Interpreter Id = /usr/local/bin/python
    > at R_.<anonymous> (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:304:11641)
    > stdErr = 
09:33:53.089 [error] Error in execution (get message for cell) Error: The kernel died. Error: ... View Jupyter [log](command:jupyter.viewOutput) for further details.
    > Kernel Id = .jvsc74a57bd0949777d72b0d2535278d3dc13498b2535136f6dfe0678499012e853ee9abcab1./usr/local/python./usr/local/python.-m#ipykernel_launcher
    > Interpreter Id = /usr/local/bin/python
    > at R_.<anonymous> (/home/~/.~-server/extensions/ms-toolsai.jupyter-2024.7.0-linux-arm64/dist/extension.node.js:304:11641)
    > stdErr = 
09:33:53.096 [info] Process Execution: /usr/local/bin/python -c "import ipykernel;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
DonJayamanne commented 1 week ago

09:32:50.503 [info] Starting Kernel (Python Path: /usr/local/bin/python, Unknown, 3.11.4) for '/workspaces/graphrag/.devcontainer/scratch.ipynb' (disableUI=true) 09:32:52.175 [warn] Failed to get activated env vars for /usr/local/bin/python in 1674ms

Doesn't look like you have the latest image. Can you try creating a new folder with the container. Its supposed to have Python 3.12, however you have 3.11.4

I have tried this at my end and it works as expected. I too am using a Mac arm64 (local machine) and the dev container is linux arm64

Here are my Logs ``` Visual Studio Code - Insiders (1.93.0-insider, dev-container, desktop) Jupyter Extension Version: 2024.8.2024081201. Python Extension Version: 2024.13.2024082701. Pylance Extension Version: 2024.8.104. Platform: linux (arm64). Temp Storage folder ~/.vscode-server-insiders/data/User/globalStorage/ms-toolsai.jupyter/version-2024.8.2024081201 Workspace folder /workspaces/demo, Home = /home/vscode 05:20:24.114 [info] User belongs to experiment group 'KernelCompletions' 05:20:24.114 [info] User belongs to experiment group 'DoNotWaitForZmqPortsToBeUsed' 05:20:24.460 [debug] Start refreshing Kernel Picker (1725340824460) 05:20:25.053 [trace] Search for KernelSpecs in Interpreter /usr/local/bin/python 05:20:25.066 [trace] Search for KernelSpecs in Interpreter /usr/bin/python3 05:20:25.067 [trace] Search for KernelSpecs in Interpreter /workspaces/demo/.conda/bin/python 05:20:25.073 [debug] Get Custom Env Variables, Class name = Em, completed in 613ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunPythonCode" 05:20:25.073 [debug] Jupyter Paths /kernels: 05:20:25.073 [debug] Kernel Spec Root Paths, /usr/share/jupyter/kernels, /usr/local/share/jupyter/kernels, ~/.local/share/jupyter/kernels 05:20:25.083 [trace] Preferred Remote kernel for /workspaces/demo/sample.ipynb is undefined 05:20:25.166 [trace] No controller, hence notebook communications cannot be initialized for editor /workspaces/demo/sample.ipynb 05:20:25.170 [debug] Start refreshing Interpreter Kernel Picker 05:20:25.326 [trace] Python API env change detected, update => '/usr/local/bin/python' 05:20:25.365 [trace] Python API env change detected, update => '/usr/local/bin/python' 05:20:25.367 [trace] Kernel Spec for 'Python 3 (ipykernel)' (~/.local/share/jupyter/kernels/python3/kernel.json) is hidden. (isDefaultKernelSpec = true, language = python, registrationInfo = undefined) 05:20:25.372 [trace] Python API env change detected, update => '/usr/bin/python3' 05:20:26.121 [debug] KernelProvider switched kernel to id = .jvsc74a57bd0949777d72b0d2535278d3dc13498b2535136f6dfe0678499012e853ee9abcab1./usr/local/python./usr/local/python.-m#ipykernel_launcher 05:20:26.121 [debug] start the kernel, options.disableUI=true for /workspaces/demo/sample.ipynb 05:20:26.139 [trace] Registering commtarget jupyter.widget 05:20:26.141 [debug] Controller selection change completed 05:20:26.144 [debug] Get Custom Env Variables, Class name = Em, completed in 1ms, has a truthy return value, Arg 1: "/workspaces/demo", Arg 2: "RunPythonCode" 05:20:26.144 [info] Starting Kernel (Python Path: /usr/local/bin/python, Unknown, 3.12.4) for '/workspaces/demo/sample.ipynb' (disableUI=true) 05:20:26.145 [trace] Creating raw notebook for resource '/workspaces/demo/sample.ipynb' 05:20:26.182 [debug] Get Custom Env Variables, Class name = Em, completed in 1ms, has a truthy return value, Arg 1: "/workspaces/demo/sample.ipynb", Arg 2: "RunPythonCode" 05:20:26.391 [trace] Hiding default KernelSpec /Users/donjayamanne/demo/.conda/bin/python for interpreter /workspaces/demo/.conda/bin/python (KernelSpec file /workspaces/demo/.conda/share/jupyter/kernels/python3/kernel.json) 05:20:26.769 [debug] Launching kernel .jvsc74a57bd0949777d72b0d2535278d3dc13498b2535136f6dfe0678499012e853ee9abcab1./usr/local/python./usr/local/python.-m#ipykernel_launcher for /workspaces/demo/sample.ipynb in //workspaces/demo with ports 9001, 9000, 9004, 9002, 9003 05:20:26.773 [trace] Conda file is conda 05:20:26.828 [warn] Failed to get activated env vars for /usr/local/bin/python in 685ms 05:20:26.828 [debug] Create ProcessService, Class name = Cm (started execution), Arg 1: undefined 05:20:26.829 [warn] Failed to get activated env vars for /usr/local/bin/python in 648ms 05:20:27.008 [debug] Get Custom Env Variables, Class name = Em, completed in 179ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunNonPythonCode", Arg 3: undefined 05:20:27.008 [debug] Create ProcessService, Class name = Cm, completed in 180ms, has a truthy return value, Arg 1: undefined 05:20:27.011 [info] Process Execution: /usr/local/bin/python -c "import site;print("USER_BASE_VALUE");print(site.USER_BASE);print("USER_BASE_VALUE");" 05:20:27.018 [trace] USER_SITE for /usr/local/bin/python is /home/~/.local/bin 05:20:27.019 [error] Unable to determine site packages path for python /usr/local/bin/python (Unknown) 05:20:27.019 [trace] Prepend PATH with python bin for /usr/local/bin/python 05:20:27.020 [error] Unable to determine site packages path for python /usr/local/bin/python (Unknown) 05:20:27.020 [trace] Prepend PATH with python bin for /usr/local/bin/python 05:20:27.021 [debug] Getting activated env variables, Class name = vd, completed in 878ms, has a truthy return value, Arg 1: "/workspaces/demo", Arg 2: "/usr/local/bin/python", Arg 3: undefined 05:20:27.021 [debug] Getting activated env variables, Class name = vd, completed in 840ms, has a truthy return value, Arg 1: "/workspaces/demo/sample.ipynb", Arg 2: "/usr/local/bin/python", Arg 3: undefined 05:20:27.024 [info] Process Execution: /usr/local/bin/python -m pip list 05:20:27.027 [info] Process Execution: /usr/local/bin/python -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)" 05:20:27.030 [info] Process Execution: /usr/local/bin/python -m ipykernel_launcher --f=/home/~/.local/share/jupyter/runtime/kernel-v3a4fce2ee55c66324bab8eb8a9bde3c333ea27ddf.json > cwd: //workspaces/demo 05:20:27.030 [debug] Kernel process 3884. 05:20:27.047 [debug] Waiting for Raw Session to be ready in postStartRawSession 05:20:27.047 [debug] Waiting for Raw session to be ready, status: connected 05:20:27.047 [trace] Raw session connected 05:20:27.048 [debug] Waited for Raw session to be ready & got status: connected 05:20:27.048 [debug] Successfully waited for Raw Session to be ready in postStartRawSession 05:20:27.048 [debug] Kernel status is 'unknown' before requesting kernel info and after ready 05:20:27.048 [debug] Sending request for kernelInfo 05:20:27.249 [trace] ipykernel version & path 6.29.5, ~/.local/lib/python3.12/site-packages/ipykernel/__init__.py for /usr/local/bin/python 05:20:27.550 [trace] Did not get a response for requestKernelInfo 05:20:27.550 [debug] Sending request for kernelInfo 05:20:27.945 [debug] Interpreter for Pylance for Notebook URI "/workspaces/demo/sample.ipynb" is /usr/local/bin/python 05:20:28.051 [trace] Did not get a response for requestKernelInfo 05:20:28.052 [debug] Sending request for kernelInfo 05:20:28.289 [debug] Kernel output 3884: To connect another client to this kernel, use: --existing kernel-v3a4fce2ee55c66324bab8eb8a9bde3c333ea27ddf.json 05:20:28.553 [trace] Did not get a response for requestKernelInfo 05:20:28.554 [debug] Sending request for kernelInfo 05:20:28.720 [trace] Got response for requestKernelInfo 05:20:28.720 [debug] Successfully completed postStartRawSession after 4 attempt(s) in 1672ms 05:20:28.722 [trace] Executing silently Code (idle) = import sys as _~_sys\nprint(_~_sys.executable); del _~_sys 05:20:28.730 [trace] Executing silently Code (completed) = import sys as _~_sys\nprint(_~_sys.executable); del _~_sys with 1 output(s) 05:20:28.731 [trace] Started running kernel initialization for /workspaces/demo/sample.ipynb 05:20:28.732 [trace] Executing silently Code (idle) = try:\nimport ipywidgets as _~_ipywidgets\nprint("e976ee50-99ed-4aba-9b6b-9dcd5634d07d:IPy 05:20:28.755 [trace] Executing silently Code (completed) = try:\nimport ipywidgets as _~_ipywidgets\nprint("e976ee50-99ed-4aba-9b6b-9dcd5634d07d:IPy with 0 output(s) 05:20:28.756 [trace] Determined IPyWidgets Version as undefined 05:20:28.757 [trace] Executing silently Code (idle) = def __~_inject_module():\ndef __~_call_function(function, callback, data=None): 05:20:28.765 [trace] Executing silently Code (completed) = def __~_inject_module():\ndef __~_call_function(function, callback, data=None): with 0 output(s) 05:20:28.766 [debug] Requesting Kernel info 05:20:28.766 [trace] Got Kernel info 05:20:28.767 [trace] End running kernel initialization, now waiting for idle 05:20:28.767 [trace] Waiting for idle on (kernel): a3962367-8665-4d14-81a9-d4ccfaf87c97 -> idle 05:20:28.768 [trace] Finished waiting for idle on (kernel): a3962367-8665-4d14-81a9-d4ccfaf87c97 -> idle 05:20:28.769 [trace] End running kernel initialization, session is idle 05:20:28.770 [trace] Registering Kernel Completion Provider from kernel Python 3.12.4 for language python 05:20:28.771 [trace] IPyWidgetScriptSource.initialize 05:20:28.772 [info] Kernel successfully started 05:20:28.773 [debug] getDataDirsImpl, Class name = Mr (started execution), Arg 1: "/workspaces/demo/sample.ipynb", Arg 2: "/usr/local/bin/python" 05:20:28.774 [debug] Get Custom Env Variables, Class name = Em, completed in 1ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunPythonCode" 05:20:28.774 [debug] Jupyter Paths : 05:20:28.777 [info] Process Execution: /usr/local/bin/python /home/~/.~-server-insiders/extensions/ms-toolsai.jupyter-2024.8.2024081201-linux-arm64/pythonFiles/printJupyterDataDir.py 05:20:28.785 [debug] getDataDirsImpl, Class name = Mr, completed in 12ms, has a truthy return value, Arg 1: "/workspaces/demo/sample.ipynb", Arg 2: "/usr/local/bin/python", Return Value: , , 05:20:29.807 [trace] Python API env change detected, update => '/workspaces/demo/.conda/bin/python' 05:20:33.351 [debug] Handle Execution of Cells 5 for /workspaces/demo/sample.ipynb 05:20:33.352 [trace] Execute Notebook /workspaces/demo/sample.ipynb. Step 1 05:20:33.353 [trace] Connect to Kernel /workspaces/demo/sample.ipynb. Step 2 05:20:33.353 [trace] Connected to Kernel /workspaces/demo/sample.ipynb. Step 3 05:20:33.354 [trace] executeCell 5. Step 4 05:20:33.355 [trace] Cell Index:5 sent to kernel 05:20:33.362 [trace] Start cell 5 execution @ 1725340833362 (clear output) 05:20:33.364 [debug] Kernel acknowledged execution of cell 5 @ 1725340833362 05:20:33.367 [trace] Cell 5 completed in 0.005s (start: 1725340833362, end: 1725340833367) 05:20:33.368 [trace] Cell 5 executed successfully 05:20:35.910 [debug] Refreshed Environments 05:20:36.914 [debug] End refreshing Kernel Picker (1725340824460) ```
hsm207 commented 1 week ago

I updated to use 3.12, switch to VC Code code insiders and the pre-release extension so that it matches your environment according to the logs you shared. I still get the same error.

Could you share the image you used for the devcontainer? I'm using mcr.microsoft.com/devcontainers/python:1-3.12-bullseye with a feature ghcr.io/devcontainers/features/rust:1

DonJayamanne commented 1 week ago

I'm not using any features

hsm207 commented 1 week ago

Closing because because this is not reproducible anymore.

I removed the feature and rebuilt the container and now the error is gone. Then, I added back the feature and tested again, and the error is no longer there too....