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

Breakpoint in external py deactivates when debugging a Jupyter cell #16014

Open lenyabloko opened 1 month ago

lenyabloko commented 1 month ago

Applies To

What happened?

Debugging a notebook running on a remote Jupyter server accessed by Windows 11 VScode via WSL2 localhost kernel. Expected debugger to stop at the breakpoint set in external py file called from a Jupyter cell. Before pressing a 'Debug Cell', the external py files is listed under BREAKPOINTS in Debug window and shows the red dot before its name. As soon as 'Debug Cell' pressed, the red dot disappears and shows a tooltip message when mouse over the py file name: Breakpoint is set in file that does not exists Debug console shows error attaching to process Id

Screenshot 2024-09-07 214356

VS Code Version

1.93.0

Jupyter Extension Version

v2024.7.0

Jupyter logs

21:44:58.182 [debug] [Debug] to kernel: {"command":"continue","arguments":{"threadId":1},"type":"request","seq":45}
21:44:58.182 [debug] [Debug] to kernel, mapped: {"command":"continue","arguments":{"threadId":1},"type":"request","seq":45}
21:44:58.352 [debug] [Debug] response: {"seq":46,"type":"response","request_seq":45,"success":true,"command":"continue","body":{"allThreadsContinued":true}}
21:44:58.380 [debug] [Debug] event: {"header":{"msg_id":"9bdb5892-c157b44627c33ad0b9efe3b5_936_525","msg_type":"debug_event","username":"username","session":"9bdb5892-c157b44627c33ad0b9efe3b5","date":"2024-09-08T01:44:58.367890Z","version":"5.3"},"msg_id":"9bdb5892-c157b44627c33ad0b9efe3b5_936_525","msg_type":"debug_event","parent_header":{"date":"2024-09-08T01:44:58.183000Z","msg_id":"e90f92ea-afc5-401e-add3-c6b905b23102","msg_type":"debug_request","session":"a72bd563-25d6-48da-bd0e-1fc247de24f9","username":"","version":"5.2"},"metadata":{},"content":{"seq":47,"type":"event","event":"continued","body":{"threadId":1,"allThreadsContinued":true}},"buffers":[],"channel":"iopub"

Coding Language and Runtime Version

Python and/or Anaconda version: Python 3.11.2

Language Extension Version (if applicable)

Python Extension version: v2024.12.2

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

Remote

DonJayamanne commented 2 days ago

@lenyabloko thank you for filing this issue and sorry for the delay in getting back to you. Please can you update to the latest version of VS Code insiders & latest pre-release version of Jupyter, Python and DebugPy extensions and let me know if you still run into the same issue

Based on the errors, debugger is failing to attach, and I suspect this may have been fixed in the latest pre-release version, hence the suggestion to retry.