microsoft / vscode-jupyter

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

Jupyter Remote kernel cell keeps loading #14701

Closed imazari closed 8 months ago

imazari commented 11 months ago

Environment data

Expected behaviour

Every cell to run successfully

Actual behaviour

Kernel cell run is hanging.

Steps to reproduce:

  1. Install Jupyter (version later than v2023.1.2010391206, with this version we can still run cells but we can't select Kernel)
  2. Connect to Remote JupyterHub Server.
  3. Select Pyspark Kernel (which is setup in Jupyterhub Server for connecting to the Spark cluster)
  4. Run first cell
  5. Run second cell (anything)

Logs

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

``` 11:29:09.732 [debug] Started running kernel initialization for ~/notebooks/notebook_name.ipynb 11:29:09.732 [debug] Executing silently Code (unknown) = try:\nimport ipywidgets as _VSCODE_ipywidgets\nprint("e976ee50-99ed-4aba-9b6b-9dcd5634d07d:IPy 11:29:09.732 [debug] Requesting Kernel info 11:29:09.732 [debug] Got Kernel info 11:29:09.732 [debug] Registering commtarget jupyter.widget 11:29:18.810 [debug] Updating cache with Remote kernels connectToLiveRemoteKernel:'fc1c16d9-e3c9-4476-8361-f313f1bf2e8c (interpreter id = )', connectToLiveRemoteKernel:'a69bfdc9-1611-4ad9-90c2-909e6819f00d (interpreter id = )', connectToLiveRemoteKernel:'bef398b4-08d7-49b6-a37f-e5782dd7777f (interpreter id = )', connectToLiveRemoteKernel:'552ae2c4-dd7e-4294-8939-84b66d73e151 (interpreter id = )', connectToLiveRemoteKernel:'69d1d15f-fc5c-44bc-8e84-1b49ef6d41ea (interpreter id = )', connectToLiveRemoteKernel:'8a4f6dec-f431-4f38-baa4-7477bb9d5093 (interpreter id = )', connectToLiveRemoteKernel:'c1856239-c45c-45c7-b2e3-e54ac4dcafca (interpreter id = )', startUsingRemoteKernelSpec:'76f01497737e741890d57951d2a383c7ada034cf3c4cd5e1457920eceaa26fb5..python3./python./.-m#ipykernel_launcher (interpreter id = )', startUsingRemoteKernelSpec:'76f01497737e741890d57951d2a383c7ada034cf3c4cd5e1457920eceaa26fb5..pysparkkernel./python./.-m#sparkmagic.kernels.pysparkkernel.pysparkkernel (interpreter id = )', Added = , Updated = , Removed = 11:29:30.126 [info] Handle Execution of Cells 1 for ~/Projects/health_check_telemetry/notebooks/run_service_scan_numbers.ipynb 11:29:30.126 [debug] start the kernel, options.disableUI=false for ~/Projects/health_check_telemetry/notebooks/run_service_scan_numbers.ipynb 11:29:30.127 [debug] Execution Request Sent to Kernel for cell 1 11:29:40.417 [debug] Executing silently Code (busy) = try:\nimport ipywidgets as _VSCODE_ipywidgets\nprint("e976ee50-99ed-4aba-9b6b-9dcd5634d07d:IPy 11:29:45.713 [debug] Executing silently Code (completed) = try:\nimport ipywidgets as _VSCODE_ipywidgets\nprint("e976ee50-99ed-4aba-9b6b-9dcd5634d07d:IPy with 5 output(s) 11:29:45.713 [debug] Determined IPyWidgets Version as undefined and event fired 11:29:45.716 [debug] Start cell 1 execution @ 1699612185716 (clear output) 11:29:45.716 [info] Kernel acknowledged execution of cell 1 @ 1699612185716 11:29:45.742 [debug] Executing silently Code (busy) = try:\nimport ipywidgets as _VSCODE_ipywidgets\nprint("e976ee50-99ed-4aba-9b6b-9dcd5634d07d:IPy 11:29:45.751 [info] End cell 1 execution @ 1699612185750, started @ 1699612185716, elapsed time = 0.034s 11:29:45.751 [debug] Cell 1 executed with state Success 11:29:45.843 [debug] Executing silently Code (completed) = try:\nimport ipywidgets as _VSCODE_ipywidgets\nprint("e976ee50-99ed-4aba-9b6b-9dcd5634d07d:IPy with 1 output(s) 11:29:45.843 [debug] Determined IPyWidgets Version as undefined and event fired 11:29:45.844 [debug] Executing silently Code (completed) = try:\nimport ipywidgets as _VSCODE_ipywidgets\nprint("e976ee50-99ed-4aba-9b6b-9dcd5634d07d:IPy with 1 output(s) 11:29:45.844 [debug] Determined IPyWidgets Version as undefined and event fired 11:29:55.887 [debug] Attempting to determine version of IPyWidgets 11:29:55.887 [debug] Waiting for IPyWidgets version 11:29:55.887 [debug] Waiting for IPyWidgets version promise 11:29:59.197 [info] Handle Execution of Cells 2 for ~/Projects/health_check_telemetry/notebooks/notebook_name.ipynb 11:29:59.197 [debug] start the kernel, options.disableUI=false for ~/Projects/health_check_telemetry/notebooks/notebook_name.ipynb 11:29:59.200 [debug] Execution Request Sent to Kernel for cell 2 ```

Old Logs (from functional version v2023.1.2010391206):

The only difference i was able to tell with looking was the interpreted id = undefined, different from the null one on the above.

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

``` debug 16:17:53.205: Updating cache with Remote kernels connectToLiveRemoteKernel:'fc1c16d9-e3c9-4476-8361-f313f1bf2e8c (interpreter id = undefined)', connectToLiveRemoteKernel:'a69bfdc9-1611-4ad9-90c2-909e6819f00d (interpreter id = undefined)', connectToLiveRemoteKernel:'bef398b4-08d7-49b6-a37f-e5782dd7777f (interpreter id = undefined)', connectToLiveRemoteKernel:'552ae2c4-dd7e-4294-8939-84b66d73e151 (interpreter id = undefined)', connectToLiveRemoteKernel:'69d1d15f-fc5c-44bc-8e84-1b49ef6d41ea (interpreter id = undefined)', connectToLiveRemoteKernel:'8a4f6dec-f431-4f38-baa4-7477bb9d5093 (interpreter id = undefined)', connectToLiveRemoteKernel:'c1856239-c45c-45c7-b2e3-e54ac4dcafca (interpreter id = undefined)', startUsingRemoteKernelSpec:'9ae7ba54e630b10274e9b9630e70454f55b8187867638219a3e67d9848f219b2..python3./python./.-m#ipykernel_launcher (interpreter id = undefined)', startUsingRemoteKernelSpec:'9ae7ba54e630b10274e9b9630e70454f55b8187867638219a3e67d9848f219b2..pysparkkernel./python./.-m#sparkmagic.kernels.pysparkkernel.pysparkkernel (interpreter id = undefined)' ```

### Tasks
DonJayamanne commented 11 months ago

Thanks for filling this issue Sorry you are running into this Please can you confirm you are using the Jupyter hub extension, if not please install that and use the Jupyterhub option to connect to a new hub server in the kernel picker (check the Jupyter hub vscode extension readme page)

If the problem still persists Please could you enable logging as follows:

imazari commented 11 months ago

Hi @DonJayamanne , i am indeed using the JupyterHub extension. The logging can be found in the issue above, or see below a last refreshed run:

09:53:10.209 [debug] Preferred Remote kernel for ~/Projects/notebooks/notebook.ipynb is undefined 09:53:10.547 [debug] Disposing Jupyter Lab Helper 09:53:10.547 [debug] SessionManager - dispose contents manager 09:53:10.547 [debug] ShutdownSessionAndConnection - dispose session manager 09:53:10.547 [debug] Finished disposing Jupyter Lab Helper 09:53:11.886 [info] Handle Execution of Cells 1 for ~/Projects/notebooks/notebook.ipynb 09:53:11.887 [debug] start the kernel, options.disableUI=false for ~/Projects/notebooks/notebook.ipynb 09:53:11.889 [info] Starting Kernel startUsingRemoteKernelSpec, 76f01497737e741890d57951d2a383c7ada034cf3c4cd5e1457920eceaa26fb5..pysparkkernel./python./.-m#sparkmagic.kernels.pysparkkernel.pysparkkernel for '~/Projects/notebooks/notebook.ipynb' (disableUI=false) 09:53:11.950 [debug] KernelProvider switched kernel to id = 76f01497737e741890d57951d2a383c7ada034cf3c4cd5e1457920eceaa26fb5..pysparkkernel./python./.-m#sparkmagic.kernels.pysparkkernel.pysparkkernel 09:53:11.950 [debug] Initialize notebook communications for editor ~/Projects/notebooks/notebook.ipynb 09:53:11.950 [debug] Resolving notebook UI Comms (resolve) for ~/Projects/notebooks/notebook.ipynb 09:53:11.950 [debug] initialize CommonMessageCoordinator 09:53:11.950 [debug] Registering commtarget jupyter.widget 09:53:11.950 [debug] IPyWidgetMessageDispatcher.initialize 09:53:11.951 [debug] Attempting to determine version of IPyWidgets 09:53:11.951 [debug] Controller selection change completed 09:53:11.951 [debug] Waiting for IPyWidgets version 09:53:11.951 [debug] Waiting for IPyWidgets version promise 09:53:12.203 [debug] createNewKernelSession 76f01497737e741890d57951d2a383c7ada034cf3c4cd5e1457920eceaa26fb5..pysparkkernel./python./.-m#sparkmagic.kernels.pysparkkernel.pysparkkernel 09:53:12.516 [info] https://jupyterhub.acc.hfc-ingress.aa.vfziggo.com/user//: Kernel started: 9db86546-f090-4bae-8222-22730a1d84f2 09:53:12.517 [debug] Waiting for 60000ms idle on (kernel): 9db86546-f090-4bae-8222-22730a1d84f2 -> unknown 09:53:13.783 [debug] Got status idle in waitForIdleOnSession 09:53:13.783 [debug] Finished waiting for idle on (kernel): 9db86546-f090-4bae-8222-22730a1d84f2 -> idle 09:53:13.783 [info] Started session for kernel startUsingRemoteKernelSpec:76f01497737e741890d57951d2a383c7ada034cf3c4cd5e1457920eceaa26fb5..pysparkkernel./python./.-m#sparkmagic.kernels.pysparkkernel.pysparkkernel 09:53:13.784 [debug] Started running kernel initialization for ~/Projects/notebooks/notebook.ipynb 09:53:13.785 [debug] Executing silently Code (idle) = try:\nimport ipywidgets as _VSCODE_ipywidgets\nprint("e976ee50-99ed-4aba-9b6b-9dcd5634d07d:IPy 09:53:14.602 [info] Handle Execution of Cells 0 for ~/Projects/notebooks/notebook.ipynb 09:53:14.603 [debug] start the kernel, options.disableUI=false for ~/Projects/notebooks/notebook.ipynb 09:53:46.491 [debug] Executing silently Code (completed) = try:\nimport ipywidgets as _VSCODE_ipywidgets\nprint("e976ee50-99ed-4aba-9b6b-9dcd5634d07d:IPy with 5 output(s) 09:53:46.492 [debug] Determined IPyWidgets Version as undefined and event fired 09:53:46.493 [debug] Executing silently Code (idle) = vsc_ipynb_file = "~/Projects/notebooks/notebook.ipynb" 09:53:46.576 [debug] Executing silently Code (completed) = vsc_ipynb_file = "~/Projects/notebooks/notebook.ipynb" with 2 output(s) 09:53:46.576 [debug] Requesting Kernel info 09:53:46.577 [debug] Got Kernel info 09:53:46.577 [debug] End running kernel initialization, now waiting for idle 09:53:46.577 [debug] Waiting for 60000ms idle on (kernel): 9db86546-f090-4bae-8222-22730a1d84f2 -> idle 09:53:46.579 [debug] Finished waiting for idle on (kernel): 9db86546-f090-4bae-8222-22730a1d84f2 -> idle 09:53:46.579 [debug] End running kernel initialization, session is idle 09:53:46.581 [debug] Updating preferred kernel for remote notebook 9db86546-f090-4bae-8222-22730a1d84f2 09:53:46.583 [info] Start refreshing Kernel Picker (1699865626583) 09:53:46.584 [debug] IPyWidgetScriptSource.initialize 09:53:46.584 [debug] IPyWidgetMessageDispatcher.initialize 09:53:46.588 [debug] Storing Preferred remote kernel for ~/Projects/notebooks/notebook.ipynb is 9db86546-f090-4bae-8222-22730a1d84f2 09:53:46.627 [debug] Execution Request Sent to Kernel for cell 1 09:53:46.656 [debug] Executing silently Code (idle) = # Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n# Sou 09:53:46.926 [debug] Disposing Jupyter Lab Helper 09:53:46.926 [debug] SessionManager - dispose contents manager 09:53:46.926 [debug] ShutdownSessionAndConnection - dispose session manager 09:53:46.926 [debug] Finished disposing Jupyter Lab Helper 09:53:46.926 [debug] UniversalRemoteKernelFinder: Writing 6 remote kernel connection metadata to cache 09:53:46.951 [info] End refreshing Kernel Picker (1699865626583) 09:53:47.563 [debug] Start cell 1 execution @ 1699865627561 (clear output) 09:53:47.564 [info] Kernel acknowledged execution of cell 1 @ 1699865627561 09:53:47.603 [info] End cell 1 execution @ 1699865627602, started @ 1699865627561, elapsed time = 0.041s 09:53:47.606 [debug] Execution Request Sent to Kernel for cell 0 09:53:47.606 [debug] Cell 1 executed with state Success 09:53:47.614 [debug] Attempting to determine version of IPyWidgets 09:53:47.614 [debug] Waiting for IPyWidgets version 09:53:47.614 [debug] Waiting for IPyWidgets version promise 09:53:47.648 [debug] Executing silently Code (completed) = # Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n# Sou with 2 output(s) 09:53:56.451 [info] Handle Execution of Cells 1 for ~/Projects/notebooks/notebook.ipynb 09:53:56.452 [debug] start the kernel, options.disableUI=false for ~/Projects/notebooks/notebook.ipynb 09:53:58.511 [info] Handle Execution of Cells 2 for ~/Projects/notebooks/notebook.ipynb 09:53:58.511 [debug] start the kernel, options.disableUI=false for ~/Projects/notebooks/notebook.ipynb 09:54:01.956 [debug] Updating cache with Remote kernels connectToLiveRemoteKernel:'2c42e765-db3c-4767-b65c-084cd156e1ed (interpreter id = )', connectToLiveRemoteKernel:'60884ab6-77cf-4198-95dd-4149760f6d0c (interpreter id = )', connectToLiveRemoteKernel:'bf402db8-efac-484d-916a-a17ebbec8e95 (interpreter id = )', connectToLiveRemoteKernel:'9db86546-f090-4bae-8222-22730a1d84f2 (interpreter id = )', startUsingRemoteKernelSpec:'76f01497737e741890d57951d2a383c7ada034cf3c4cd5e1457920eceaa26fb5..python3./python./.-m#ipykernel_launcher (interpreter id = )', startUsingRemoteKernelSpec:'76f01497737e741890d57951d2a383c7ada034cf3c4cd5e1457920eceaa26fb5..pysparkkernel./python./.-m#sparkmagic.kernels.pysparkkernel.pysparkkernel (interpreter id = )', Added = connectToLiveRemoteKernel:'60884ab6-77cf-4198-95dd-4149760f6d0c (interpreter id = )', connectToLiveRemoteKernel:'bf402db8-efac-484d-916a-a17ebbec8e95 (interpreter id = )', connectToLiveRemoteKernel:'9db86546-f090-4bae-8222-22730a1d84f2 (interpreter id = )', Updated = connectToLiveRemoteKernel:'2c42e765-db3c-4767-b65c-084cd156e1ed (interpreter id = )', Removed

DonJayamanne commented 10 months ago
DonJayamanne commented 9 months ago

@llk15 sorry you are running into this issue, however you are running into a different (unrelated) issue. Basically the notebook is not loading, instead of running cells) Please could you file a separate issue, else its gets confusing to deal with two different problems in the same place

vscodenpa commented 8 months 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!