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

debug cell in jupyter notebook never executes or reaches breakpoint #9316

Closed
ybagdasa opened this issue Mar 2, 2022 · 12 comments
Closed

debug cell in jupyter notebook never executes or reaches breakpoint #9316

ybagdasa opened this issue Mar 2, 2022 · 12 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug notebook-debugging

Comments

@ybagdasa
Copy link

ybagdasa commented Mar 2, 2022

Issue Type: Bug

The debug cell feature has stopped working in jupyter notebooks, while still working in python scripts. I've observed this with different breakpoints in different source files.

For jupyter cells, the execution just hangs with the options to step over, step into... etc grayed out. Only options to pause, reset, and disconnect debugger are available. Upon disconnecting, nothing is output from the cell.
Screenshot from 2022-03-02 11-43-42

Additionally I've noticed that sometimes when the notebook is first opened there is no option to debug the cell. After executing the cell, the option appears.
Screenshot from 2022-03-02 12-15-34

VS Code version: Code 1.64.2 (f80445acd5a3dadef24aa209168452a3d97cc326, 2022-02-09T22:02:29.527Z)
OS version: Linux x64 5.13.0-30-generic snap
Restricted Mode: No
Remote OS version: Linux x64 5.4.0-97-generic

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz (8 x 2000)
GPU Status 2d_canvas: unavailable_software
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: disabled_off
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
Load (avg) 1, 1, 1
Memory (System) 15.52GB (5.42GB free)
Process Argv --no-sandbox --force-user-env --unity-launch --crash-reporter-id 09889aea-dff4-45a4-8c0b-7ecc3bf3592e
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE x11
Item Value
Remote Container 10.0.0.95:5000/ybagdasa/pytorch1.10.0-cuda11.1-cudnn8-devel:detectron2 (ybdetectron2) @ ssh://10.158.62.106
OS Linux x64 5.4.0-97-generic
CPUs AMD EPYC 7302 16-Core Processor (32 x 1463)
Memory (System) 188.77GB (97.93GB free)
VM 0%
Extensions (20)
Extension Author (truncated) Version
jupyter-keymap ms- 1.0.0
remote-containers ms- 0.224.2
remote-ssh ms- 0.74.0
remote-ssh-edit ms- 0.74.0
remote-wsl ms- 0.64.2
vscode-remote-extensionpack ms- 0.21.0
preview-tiff ana 1.0.1
gitkraken-authentication git 1.0.3
kite kit 0.147.0
vscode-docker ms- 1.20.0
anaconda-extension-pack ms- 1.0.1
python ms- 2022.0.1814523869
vscode-pylance ms- 2022.2.4
jupyter ms- 2022.1.1301854968
jupyter-keymap ms- 1.0.0
jupyter-renderers ms- 1.0.6
autodocstring njp 0.6.1
vscode-commons red 0.0.6
vscode-yaml red 1.4.0
pdf tom 1.2.0
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392:30443607
pythontb:30283811
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805cf:30301675
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30433507
vsclayoutctrc:30437038
vsrem710:30416614
dsvsc009:30440023
pythonvsnew555cf:30442237
vsbas813:30436447
vscscmwlcmt:30438805
helix:30440343
vscaac:30438847
vsnot107:30443614

@ybagdasa
Copy link
Author

ybagdasa commented Mar 2, 2022

May be my mistake...I will look into this further and reopen if this is not my error.

@ybagdasa ybagdasa closed this as completed Mar 2, 2022
@ybagdasa ybagdasa changed the title debug cell in python script and debug cell in jupyter notebook never reaches breakpoint debug cell in jupyter notebook never executes or reaches breakpoint Mar 2, 2022
@ybagdasa
Copy link
Author

ybagdasa commented Mar 2, 2022

I made a mistake when testing the python script cell debugging--python script cell debugging works as expected. However the jupyter cell debugging does appear to be broken to me.

@ybagdasa ybagdasa reopened this Mar 2, 2022
@ybagdasa
Copy link
Author

ybagdasa commented Mar 2, 2022

In the debugging tab, everything appears to be empty (nothing in the call stack?)
Screenshot from 2022-03-02 12-22-58

@rebornix rebornix assigned roblourens and unassigned rebornix Mar 2, 2022
@roblourens
Copy link
Member

Can you check which version of ipykernel you have?

And can you set "jupyter.logging.level": "verbose" and share the log from the Jupyter output channel?

@ybagdasa
Copy link
Author

ybagdasa commented Mar 8, 2022

@roblourens Not sure how to set the logging info...I just set it in the launch.json file.

Selected Jupyter core packages...
IPython : 7.31.1
ipykernel : 6.8.0
ipywidgets : 7.6.5
jupyter_client : 7.1.2
jupyter_core : 4.9.1
jupyter_server : not installed
jupyterlab : not installed
nbclient : 0.5.11
nbconvert : 6.3.0
nbformat : 5.1.3
notebook : 6.4.8
qtconsole : not installed
traitlets : 5.1.1
``
Logging...
When I try to debug a cell I get:

Info 22:49:51: Executing silently Code (idle) = import ipykernel\nprint(ipykernel.version)
Info 22:49:51: Executing silently Code (completed) = import ipykernel\nprint(ipykernel.version)

Nothing is shown on the call stack, and when I "disconnect" nothing else is logged.

@roblourens
Copy link
Member

It goes in your settings, and when that's present there will be some logs telling us what happened when we tried to start debugging

@roblourens roblourens transferred this issue from microsoft/vscode Mar 10, 2022
@rchiodo rchiodo added notebook-debugging bug Issue identified by VS Code Team member as probable bug and removed needs-triage labels Mar 10, 2022
@dmho418
Copy link

dmho418 commented Mar 11, 2022

Same issue.
When I click "Debug cell" the left panel switches "Run and Debug" but nothing happens.
On the top it shows the wrong target configuration ("No configuration" in my case), the debug tool bar shows up (so the debugger did attach to something?), the "run by line" button gets grayed out, very similar to ybagdasa's screenshot.
image

I running on Windows with WSL, could be a bug in the remote.

VS Code: 1.65.2
OS: Windows_NT x64 10.0.19044
WSL Ubuntu 20.04 LTS
python 3.8.10
ipykernel 6.8.0
jupyter-client 7.1.2
jupyter-core 4.9.1

@Don-Felice
Copy link

Had the same problem:
grafik

VS Code: 1.65.2
Windows 10 Pro 10.0.19044
Python 3.8.10
ipykernel 6.8.0

Updating ipykernel to version 6.9.2 fixed it for me.

@IanMatthewHuff
Copy link
Member

@ybagdasa and @dmho418 We've had some issues recently with the version of ipykernel / debugpy in use. Can you try updating those and see if that helps? Looks like that update helped @Don-Felice .

ipython/ipykernel#841
#9130

If you are still reproing I'd love the versions of ipykernel and debugpy that are in use.

@dmho418
Copy link

dmho418 commented Apr 1, 2022

@IanMatthewHuff upgraded to ipykernel 6.11.0, the debugger is working now. Thanks!

@IanMatthewHuff
Copy link
Member

@ybagdasa Given that this update helped both @dmho418 and @Don-Felice I'm going to close down this issue. If you are still seeing the problem with an updated ipykernel just message back here and I can reopen the issue.

@ybagdasa
Copy link
Author

@IanMatthewHuff Confirming, that was indeed the issue. Working now with upgraded ipykernel.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 11, 2023
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 notebook-debugging
Projects
None yet
Development

No branches or pull requests

7 participants