Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot debug #14958

Closed
1 of 2 tasks
szmcdull opened this issue Dec 29, 2023 · 8 comments
Closed
1 of 2 tasks

Cannot debug #14958

szmcdull opened this issue Dec 29, 2023 · 8 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster notebook-debugging

Comments

@szmcdull
Copy link

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

Suddenly debugging does not work anymore. All notebooks, all cells. It was working before. And I didn't do anything.

image

It cannot hit even the first line. Just counting time but nothing starts.

VS Code Version

Version: 1.85.1 (user setup) Commit: 0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2 Date: 2023-12-13T09:49:37.021Z Electron: 25.9.7 ElectronBuildId: 25551756 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Windows_NT x64 10.0.19045

Jupyter Extension Version

Jupyter v2023.11.1003402403

Jupyter logs

Visual Studio Code (1.85.1, undefined, desktop)
Jupyter Extension Version: 2023.11.1003402403.
Python Extension Version: 2023.22.1.
Pylance Extension not installed.
Platform: win32 (x64).
Workspace folder ~\Desktop\temp, Home = c:\Users\mugi
06:41:53.696 [info] Start refreshing Kernel Picker (1703889713696)
06:41:53.698 [info] Using Pylance
06:41:53.811 [info] Start refreshing Interpreter Kernel Picker
06:41:55.672 [info] Starting Kernel startUsingPythonInterpreter, .jvsc74a57bd01fa163922eb0b3709bbb5d8082b2465c9de796dbaacca80cbaa600e7fff3e4fe.d:\Python310\python.exe.d:\Python310\python.exe.-m#ipykernel_launcher  (Python Path: d:\Python310\python.exe, Unknown, 3.10.11) for 'd:\OneDrive\code\candle\candle.ipynb' (disableUI=true)
06:41:55.674 [info] Starting Kernel startUsingPythonInterpreter, .jvsc74a57bd01fa163922eb0b3709bbb5d8082b2465c9de796dbaacca80cbaa600e7fff3e4fe.d:\Python310\python.exe.d:\Python310\python.exe.-m#ipykernel_launcher  (Python Path: d:\Python310\python.exe, Unknown, 3.10.11) for 'd:\OneDrive\code\candle\candleYear.ipynb' (disableUI=true)
06:41:56.134 [warn] Failed to get activated env vars for d:\Python310\python.exe in 676ms
06:41:56.202 [info] Process Execution: d:\Python310\python.exe -c "import site;print("USER_BASE_VALUE");print(site.USER_SITE);print("USER_BASE_VALUE");"
06:41:56.403 [info] Process Execution: d:\Python310\python.exe -m pip list
06:41:56.504 [warn] Failed to get activated env vars for d:\Python310\python.exe in 774ms
06:41:56.511 [info] Process Execution: d:\Python310\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
06:41:56.519 [info] Process Execution: d:\Python310\python.exe ~\.vscode\extensions\ms-toolsai.jupyter-2023.11.1003402403-win32-x64\pythonFiles\vscode_datascience_helpers\kernel_interrupt_daemon.py --ppid 17612
    > cwd: ~\.vscode\extensions\ms-toolsai.jupyter-2023.11.1003402403-win32-x64\pythonFiles\vscode_datascience_helpers
06:41:56.524 [warn] Failed to get activated env vars for d:\Python310\python.exe in 767ms
06:41:56.531 [info] Process Execution: d:\Python310\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
06:41:56.707 [info] Process Execution: d:\Python310\python.exe -m ipykernel_launcher --f=~\AppData\Roaming\jupyter\runtime\kernel-v2-17612MWqthQzef056.json
    > cwd: d:\OneDrive\code\candle
06:41:56.719 [info] Process Execution: d:\Python310\python.exe -m ipykernel_launcher --f=~\AppData\Roaming\jupyter\runtime\kernel-v2-176125dE8xawcbwGy.json
    > cwd: d:\OneDrive\code\candle
06:41:57.738 [info] End refreshing Kernel Picker (1703889713696)
06:41:58.028 [info] Process Execution: d:\Python310\python.exe ~\.vscode\extensions\ms-toolsai.jupyter-2023.11.1003402403-win32-x64\pythonFiles\printJupyterDataDir.py
06:42:19.541 [info] Handle Execution of Cells 0 for Untitled-1.ipynb
06:42:19.543 [info] Starting Kernel startUsingPythonInterpreter, .jvsc74a57bd01fa163922eb0b3709bbb5d8082b2465c9de796dbaacca80cbaa600e7fff3e4fe.d:\Python310\python.exe.d:\Python310\python.exe.-m#ipykernel_launcher  (Python Path: d:\Python310\python.exe, Unknown, 3.10.11) for 'Untitled-1.ipynb' (disableUI=false)
06:42:19.591 [warn] Failed to get activated env vars for d:\Python310\python.exe in 46ms
06:42:19.595 [info] Process Execution: d:\Python310\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
06:42:19.600 [info] Process Execution: d:\Python310\python.exe -m ipykernel_launcher --f=~\AppData\Roaming\jupyter\runtime\kernel-v2-17612yGVeBkkZO3fB.json
    > cwd: ~\Desktop\temp
06:42:20.492 [info] Kernel acknowledged execution of cell 0 @ 1703889740492
06:42:20.498 [info] End cell 0 execution after 0.006s, completed @ 1703889740498, started @ 1703889740492
06:42:38.890 [info] Disposing kernel .jvsc74a57bd01fa163922eb0b3709bbb5d8082b2465c9de796dbaacca80cbaa600e7fff3e4fe.d:\Python310\python.exe.d:\Python310\python.exe.-m#ipykernel_launcher for notebook Untitled-1.ipynb due to selection of another kernel or closing of the notebook
06:42:38.890 [info] Dispose Kernel 'Untitled-1.ipynb' associated with 'Untitled-1.ipynb'
06:42:38.891 [info] Dispose Kernel process 20660.
06:42:38.896 [info] Process Execution: c:\Windows\System32\taskkill.exe /F /T /PID 20660
06:42:39.197 [info] Starting Kernel startUsingPythonInterpreter, .jvsc74a57bd01fa163922eb0b3709bbb5d8082b2465c9de796dbaacca80cbaa600e7fff3e4fe.d:\Python310\python.exe.d:\Python310\python.exe.-m#ipykernel_launcher  (Python Path: d:\Python310\python.exe, Unknown, 3.10.11) for 'd:\OneDrive\code\candle\test.ipynb' (disableUI=true)
06:42:39.249 [warn] Failed to get activated env vars for d:\Python310\python.exe in 49ms
06:42:39.254 [info] Process Execution: d:\Python310\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
06:42:39.261 [info] Process Execution: d:\Python310\python.exe -m ipykernel_launcher --f=~\AppData\Roaming\jupyter\runtime\kernel-v2-17612umTwLTvUX3P5.json
    > cwd: d:\OneDrive\code\candle
06:42:42.262 [info] Starting debugging with mode 1
06:42:43.289 [info] Handle Execution of Cells 0 for d:\OneDrive\code\candle\test.ipynb
06:42:43.297 [info] Kernel acknowledged execution of cell 0 @ 1703889763296
06:42:43.311 [info] End cell 0 execution after 0.015s, completed @ 1703889763311, started @ 1703889763296
06:42:43.366 [info] Ending debug session ae44b1aa-acac-4ca6-8bfb-c64efe07ae71
06:42:43.404 [warn] StdErr from Kernel Process [IPKernelApp] ERROR | Exception in control handler:
Traceback (most recent call last):
  File "d:\Python310\lib\site-packages\ipykernel\kernelbase.py", line 354, in process_control
    await result
  File "d:\Python310\lib\site-packages\ipykernel\kernelbase.py", line 1028, in debug_request
    reply_content = await reply_content
  File "d:\Python310\lib\site-packages\ipykernel\ipkernel.py", line 511, in do_debug_request
    return await self.debugger.process_request(msg)
  File "d:\Python310\lib\site-packages\ipykernel\debugger.py", line 740, in process_request
    self.stop()
  File "d:\Python310\lib\site-packages\ipykernel\debugger.py", line 445, in stop
    self.debugpy_client.disconnect_tcp_socket()
  File "d:\Python310\lib\site-packages\ipykernel\debugger.py", line 280, in disconnect_tcp_socket
    self.debugpy_stream.socket.disconnect(self._get_endpoint())
  File "zmq\backend\cython\socket.pyx", line 668, in zmq.backend.cython.socket.Socket.disconnect
zmq.error.ZMQError: No such file or directory
06:42:45.867 [error] Canceled: Canceled
    at o.Q (vscode-file://vscode-app/c:/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:920:38833)
    at vscode-file://vscode-app/c:/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:920:38760
06:42:45.905 [info] Ending debug session ae44b1aa-acac-4ca6-8bfb-c64efe07ae71
06:42:45.905 [info] Ending debug session ae44b1aa-acac-4ca6-8bfb-c64efe07ae71
06:42:46.243 [info] Starting debugging with mode 1
06:42:46.543 [info] Handle Execution of Cells 0 for d:\OneDrive\code\candle\test.ipynb
06:42:46.549 [info] Kernel acknowledged execution of cell 0 @ 1703889766549

Coding Language and Runtime Version

Python 3.10.11

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

Local

@szmcdull szmcdull added the bug Issue identified by VS Code Team member as probable bug label Dec 29, 2023
@nataziel
Copy link

nataziel commented Jan 3, 2024

I've done some further looking into this after running into the problem myself and it appears to be related to ipykernel v6.28. I can successfully run the debugger when using python 3.11.7 & ipykernel 6.26, and when using python 3.12.1 & ipykernel 6.28, but NOT python 6.11.7 & ipykernel 6.28.

VSCode version:

Version: 1.85.1 (user setup)
Commit: 0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2
Date: 2023-12-13T09:49:37.021Z
Electron: 25.9.7
ElectronBuildId: 25551756
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.22000

Jupyter Extension version:
v2023.11.1003402403

The only seemingly relevant change I could find in ipykernel 6.28 is discussed here: ipython/ipykernel#1184

Looks to be some further discussion around the change (in relation to jupyter & tornado apps which I think vscode is?) here: jupyter/jupyter_core#382

@DonJayamanne
Copy link
Contributor

@nataziel @szmcdull Can you debug the same code using the debugger in Jupyter Lab
I.e. plese try installing Jupyter Lab into the same python environment you are using for testing (using python -m pip install jupyterlab) and then see if it works.
Let me know how this goes.

@nataziel Thanks for the analysis, please let me know if this repros in JupyterLab as well.

@DonJayamanne DonJayamanne added the info-needed Issue requires more information from poster label Jan 3, 2024
@szmcdull
Copy link
Author

szmcdull commented Jan 6, 2024

@DonJayamanne yes i can debug in jupyterlab

@nataziel
Copy link

nataziel commented Jan 6, 2024

@DonJayamanne yep I can confirm that debugging worked fine for me with all previously metioned combinations in JupyterLab, but still fails in VSCode with python=3.11.7 & ipykernel=6.28

@quantfreedom
Copy link

I can also confirm there seems to be a problem with the ipykernel hanging with debug when i use anything above ipykernel 6.26 ... i am using python 3.10.10 ... i had to downgrade to 6.25 and it works again

@DonJayamanne
Copy link
Contributor

DonJayamanne commented Jan 28, 2024

@QuantFreedom1022 @nataziel @szmcdull

  • Are you all on windows?
  • Please can you try using IPyKernel 6.29.0 and ipython 8.20.0
    I've tested this at my end and it works with python=3.11.7 & ipykernel=6.28
    Perhaps some other package is causing issues.
    Please can you try a vanialla Python environment (python -m venv .venv) or similar.
    Then install the relevant packages and test again, if it still doesn't work, then list pip list to see what versions you have and I can try taht at my end as well.

@quantfreedom
Copy link

@DonJayamanne I just checked with python 3.10.10 with the package versions you suggested and the debug seems to be working now

@DonJayamanne
Copy link
Contributor

Is most likely an issue with the ipykernel package
Closing as resolved
Please update to the latest version

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster notebook-debugging
Projects
None yet
Development

No branches or pull requests

5 participants