question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Breakpoint ignored when debugging a cell

See original GitHub issue

Testing #141223, followed the steps in https://github.com/microsoft/vscode/issues/131469 to set up Jupyter debugging

Environment: macOS 11.6.2, Python 3.10.1, ipykernel==6.7.0 Jupyter extension version 2022.1.1001744497, VS Code 1.64.0-insider commit f93c696

Tried setting a breakpoint in a cell, and the cell would just get executed normally, the breakpoint was ignored.

The cell:

d = "no"
print(f"What is the value of d? {d}")
d = "yes"
print(f"What is the value of d now? {d}")

Content of the Jupyter output channel after I click on the Debug Cell button:

Info 11:52:11: Executing (status idle) silently Code = import ipykernel\nprint(ipykernel.__version__)
Info 11:52:11: Executing silently Code (completed) = import ipykernel\nprint(ipykernel.__version__)
Info 11:52:12: Executing (status idle) silently Code = import debugpy\ndebugpy.debug_this_thread()
Info 11:52:12: Executing silently Code (completed) = import debugpy\ndebugpy.debug_this_thread()
Info 11:52:12: Execute Cells request 3
Info 11:52:12: Execute Cell 3 ~/Documents/Sandbox/notebooks/notebook.ipynb
Info 11:52:12: Cell 3 executed with state Success
Warn 11:52:12: StdErr from Kernel Process [IPKernelApp] ERROR | Exception in control handler:

Warn 11:52:12: StdErr from Kernel Process Traceback (most recent call last):

Warn 11:52:12: StdErr from Kernel Process   File "/Users/kimiguel/Documents/Sandbox/notebooks/.othervenv/lib/python3.10/site-packages/ipykernel/kernelbase.py", line 281, in process_control

Warn 11:52:12: StdErr from Kernel Process     else:

Warn 11:52:12: StdErr from Kernel Process   File "/Users/kimiguel/Documents/Sandbox/notebooks/.othervenv/lib/python3.10/site-packages/ipykernel/kernelbase.py", line 856, in debug_request

Warn 11:52:12: StdErr from Kernel Process     async def debug_request(self, stream, ident, parent):

Warn 11:52:12: StdErr from Kernel Process   File "/Users/kimiguel/Documents/Sandbox/notebooks/.othervenv/lib/python3.10/site-packages/ipykernel/ipkernel.py", line 426, in do_debug_request

Warn 11:52:12: StdErr from Kernel Process     return await self.debugger.process_request(msg)

Warn 11:52:12: StdErr from Kernel Process   File "/Users/kimiguel/Documents/Sandbox/notebooks/.othervenv/lib/python3.10/site-packages/ipykernel/debugger.py", line 606, in process_request

Warn 11:52:12: StdErr from Kernel Process     elif self.is_started:

Warn 11:52:12: StdErr from Kernel Process   File "/Users/kimiguel/Documents/Sandbox/notebooks/.othervenv/lib/python3.10/site-packages/ipykernel/debugger.py", line 348, in stop

Warn 11:52:12: StdErr from Kernel Process     cleanup_transforms = get_ipython().input_transformer_manager.cleanup_transforms

Warn 11:52:12: StdErr from Kernel Process   File "/Users/kimiguel/Documents/Sandbox/notebooks/.othervenv/lib/python3.10/site-packages/ipykernel/debugger.py", line 232, in disconnect_tcp_socket

Warn 11:52:12: StdErr from Kernel Process     def disconnect_tcp_socket(self):

Warn 11:52:12: StdErr from Kernel Process   File "zmq/backend/cython/socket.pyx", line 640, in zmq.backend.cython.socket.Socket.disconnect

Warn 11:52:12: StdErr from Kernel Process zmq.error.ZMQError: No such file or directory

image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:21 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
greazercommented, Jan 31, 2022

I have an environment with IPython 8 and debugging (hitting bps) is working just fine. Turns out that if I set a bp on the first line, then subsequent breakpoints seem to be hit. For example if I have this:

image

Breakpoints post the first one will be hit: image

This would explain why run-by-line continues to work.

1reaction
rchiodocommented, Feb 18, 2022

Thanks @fabioz

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot Breakpoints in the Visual Studio Debugger
If you're debugging optimized code, make sure the function where your breakpoint is set isn't being inlined into another function. The Debugger.
Read more >
C++ breakpoints are ignored / missed - Stack Overflow
In Release builds, many breakpoints cannot be hit, because that code is inlined. Either debug a Debug build (or non-optimized Release, if that...
Read more >
Solve “Breakpoint ignored” with Visual Studio code (vscode ...
To solve this, either restart the debugger after it has initially loaded (keep Chrome open).
Read more >
Jupyter - Breakpoints not working? : r/vscode - Reddit
When I set breakpoints in VSCode Jupyter cells, the breakpoints are ignored. How can I get them to stop code execution at the...
Read more >
Python unittests cannot be debugged. Breakpoints ignored
The Python debugger seems to ignore breakpoints when attemping to debug unittests (Right click on a testcase in testexplorer, debug). The ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found