-
Notifications
You must be signed in to change notification settings - Fork 287
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
Cell debug doesn't stop at breakpoints when VSCode is run on Windows but a remote kernel runs on Unix #11396
Comments
* kernelDebugAdapter shouldn't try to convert the file path that it receives from the kernel based on the OS where VSCode is run, because it leads to files not being found on the kernel side, which in turn breaks debugging of a cell
If you want to continue working on it @adam-zlatniczki, doing it this way shouldn't be too hard, I would take a PR for that. You can send a new one or I can reopen the previous one.
Not sure which URI you are looking at - that pattern is actually formed correctly. If you are looking at the URI of the notebook itself (local, on the windows machine) then that seems correct to me.
That however shouldn't happen. If some code uses |
Sure, I enjoy tinkering with the problem, it's a nice challenge and exercise :) I'll do another fix and PR for the Jupyter notebook debugger, and keep investigating the interactive window debugger. I'll have limited time in the next two weeks, but hopefully I can dig up something useful. |
* During notebook cell debugging, apply path normalization on the path of the dumped tmp file only if the kernel runs on a Windows machine.
* During notebook cell debugging, apply path normalization on the path of the dumped tmp file only if the kernel runs on a Windows machine.
* During notebook cell debugging, apply path normalization on the path of the dumped tmp file only if the kernel runs on a Windows machine.
It seems that I might have misunderstood something up to this point. The interactive window debugger isn't even supposed to stop at the breakpoints, right? |
The IW debugger is what runs when you click "Debug Cell" in a .py notebook file (you may have to set |
* During notebook cell debugging, apply path normalization on the path of the dumped tmp file only if the kernel runs on a Windows machine.
* Fix for issue #11396 * During notebook cell debugging, apply path normalization on the path of the dumped tmp file only if the kernel runs on a Windows machine. * Rename path helper Co-authored-by: Ádám Zlatniczki <adam.zlatniczki@ericsson.com> Co-authored-by: Rob Lourens <roblourens@gmail.com>
Environment data
Expected behaviour
After setting a breakpoint in a Jupyter Notebook cell and clicking on Debug cell, the debugger should stop at the breakpoint and show runtime info.
Actual behaviour
Instead of stopping on the breakpoint, VSCode simply executes the cell. The behavior is due to a bug in the kernelDebugAdapter, see later.
Steps to reproduce:
Start VSCode on a Windows machine and connect to a kernel that runs for example on Ubuntu (or some other unix system), then try debugging a cell.
Logs
The issue was evident from the debugpy logs on the server. In a nutshell: even though the kernel was running on unix, the SetBreakpoint requests included paths of the form "\tmp\kernel_id\dumped_cell_content_id.py", and the responses were File Not Found exceptions - as it could be expected.
Solution
The problem stems from path normalization in the dumpCell function of the kernelDebugAdapter. It normalizes the path based on the OS where VSCode runs, which doesn't necessarily coincide with the OS where the kernel runs. The normalization is unnecessary, as on the VSCode side the path on the kernel is simply a key in a hashmap - it works just as fine with whatever path the kernel returned, but in return when VSCode sends the path back to the kernel this way it's guaranteed that the path exists.
I'll be sending a pull-request with the solution when the change passes the CI.
The text was updated successfully, but these errors were encountered: