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

Breakpoint in Notebook Cell doesn't stop when VSCode is running on Windows and Kernel running on Linux #15934

Open
1 of 2 tasks
jersonchua opened this issue Aug 12, 2024 · 3 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug notebook-debugging

Comments

@jersonchua
Copy link

Applies To

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

What happened?

I'm facing is the same issue reported in #11396
with slightly different setup. My kernel is running in a linux container specifically https://hub.docker.com/layers/amazon/aws-glue-libs/glue_libs_4.0.0_image_01/images/sha256-bd642d06ee69c7eac710080091c5c76dfbf28005bb81541d475ab5846851368c?context=explore

ipykernel: 6.20.2
debugpy: 1.80
python: 3.10.2

VS Code Version

1.88.1

Jupyter Extension Version

v2023.11.1003402403

Jupyter logs

sourcePath in dumpCell has forward slash

2024-08-09 15:01:14.644 info: < {"header": {"msg_id": "491ec245-2cadc611fe3575525aa4b73a_338_103", "msg_type": "debug_reply", "username": "glue_user", "session": "491ec245-2cadc611fe3575525aa4b73a", "date": "2024-08-09T19:01:14.570370Z", "version": "5.3"}, "msg_id": "491ec245-2cadc611fe3575525aa4b73a_338_103", "msg_type": "debug_reply", "parent_header": {"date": "2024-08-09T19:01:14.093000Z", "msg_id": "21d47a00-7e31-4fea-b50b-b03e371a1bc5", "msg_type": "debug_request", "session": "bdc61c4a-6655-4165-bfc7-0e1360b7751e", "username": "", "version": "5.2"}, "metadata": {}, "content": {"type": "response", "request_seq": 15, "success": true, "command": "dumpCell", "body": {"sourcePath": "/tmp/ipykernel_338/2523026605.py"}}, "buffers": [], "channel": "control"}

path in setBreakpoints has back slash. I think this is caused by the path normalization logic in the extension.

2024-08-09 15:01:14.662 info: > {"buffers":[],"channel":"control","content":{"seq":10,"type":"request","command":"setBreakpoints","arguments":{"source":{"name":"Untitled-1.ipynb","path":"\tmp\ipykernel_338\2523026605.py"},"lines":[2],"breakpoints":[{"line":2}],"sourceModified":false}},"header":{"date":"2024-08-09T19:01:14.662Z","msg_id":"c5f0353e-a3d8-4cdf-b14c-df854ef4c0ae","msg_type":"debug_request","session":"bdc61c4a-6655-4165-bfc7-0e1360b7751e","username":"","version":"5.2"},"metadata":{},"parent_header":{}}

And because the path has the back slash, the debugger returned "Breakpoint in file that does not exist"
2024-08-09 15:01:14.737 info: < {"header": {"msg_id": "491ec245-2cadc611fe3575525aa4b73a_338_109", "msg_type": "debug_reply", "username": "glue_user", "session": "491ec245-2cadc611fe3575525aa4b73a", "date": "2024-08-09T19:01:14.669487Z", "version": "5.3"}, "msg_id": "491ec245-2cadc611fe3575525aa4b73a_338_109", "msg_type": "debug_reply", "parent_header": {"date": "2024-08-09T19:01:14.662000Z", "msg_id": "c5f0353e-a3d8-4cdf-b14c-df854ef4c0ae", "msg_type": "debug_request", "session": "bdc61c4a-6655-4165-bfc7-0e1360b7751e", "username": "", "version": "5.2"}, "metadata": {}, "content": {"seq": 25, "type": "response", "request_seq": 10, "success": true, "command": "setBreakpoints", "body": {"breakpoints": [{"verified": false, "id": 1, "message": "Breakpoint in file that does not exist.", "source": {"name": "Untitled-1.ipynb", "path": "\tmp\ipykernel_338\2523026605.py"}, "line": 2}]}}, "buffers": [], "channel": "control"}

Coding Language and Runtime Version

No response

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

None

@jersonchua jersonchua added the bug Issue identified by VS Code Team member as probable bug label Aug 12, 2024
@jersonchua jersonchua mentioned this issue Aug 12, 2024
9 tasks
@DonJayamanne
Copy link
Contributor

DonJayamanne commented Aug 12, 2024

Thank you for filing this issue, are you able to update ipykernel & debugpyto the latest version and see if this repros
Also, please update your version of VS Code, Jupyter and Python extensions to the latest versions (as you have some fairly old versions).

@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster notebook-debugging labels Aug 12, 2024
@jersonchua
Copy link
Author

@DonJayamanne I upgraded to debugpy1.8.5 and ipykernel 6.29.5. Breakpoint still doesn't stop and I'm also seeing the same "Breakpoint in file that does not exist." response back to the extension.

2024-08-12 16:27:52.939 info: < {"header": {"msg_id": "92864651-d7ccc49aafaa8fea48fc6f90_890_199", "msg_type": "debug_reply", "username": "glue_user", "session": "92864651-d7ccc49aafaa8fea48fc6f90", "date": "2024-08-12T20:27:52.918384Z", "version": "5.3"}, "msg_id": "92864651-d7ccc49aafaa8fea48fc6f90_890_199", "msg_type": "debug_reply", "parent_header": {"date": "2024-08-12T20:27:52.879000Z", "msg_id": "2980f59e-2749-4adb-8057-8c203786dd59", "msg_type": "debug_request", "session": "a9817bd4-ad93-4961-9ff0-67ccdd12bbd8", "username": "", "version": "5.2"}, "metadata": {}, "content": {"seq": 26, "type": "response", "request_seq": 10, "success": true, "command": "setBreakpoints", "body": {"breakpoints": [{"verified": false, "id": 0, "message": "Breakpoint in file that does not exist.", "source": {"name": "Untitled-1.ipynb", "path": "\tmp\ipykernel_890\3773950048.py"}, "line": 1}]}}, "buffers": [], "channel": "control"}

@jersonchua
Copy link
Author

Looking at the latest version of the code, I see that path.normalize is still getting called for sourcePath. From I understand in the code, path.normalize is the one flipping / to \ in the sourcePath. @adam-zlatniczki tried to fix this before as you can see in #11396

const norm = path.normalize((response as IDumpCellResponse).sourcePath);

const norm = path.normalize((response as IDumpCellResponse).sourcePath);

@DonJayamanne DonJayamanne removed the info-needed Issue requires more information from poster label Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug notebook-debugging
Projects
None yet
Development

No branches or pull requests

2 participants