Python Debugging failing
See original GitHub issue- Add breakpoint to a python test case or (in any python file)
- Select debug test
- Debugging fails with the following error
- Tests run successfully without debugging
Debugging was working without any issues. Stopped working all of a sudden. The only thing that I had done was a Git merge. But it cannot be the issue as I tried to debug a completely different plain hello world Python file with the same issue. I did not add any extensions or in any way change the setup of VS Code.
The error in the Python Test Log Output
window is:
Error: TypeError: Cannot read property 'testsuites' of null
The traceback in the Debug Console
is:
Traceback (most recent call last):
File "/Users/ar/.pyenv/versions/3.8.10/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/Users/ar/.pyenv/versions/3.8.10/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/Users/ar/.vscode/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/__main__.py", line 45, in <module>
cli.main()
File "/Users/ar/.vscode/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 444, in main
run()
File "/Users/ar/.vscode/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 267, in run_file
start_debugging(target)
File "/Users/ar/.vscode/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 257, in start_debugging
debugpy.connect(options.address, access_token=options.adapter_access_token)
File "/Users/ar/.vscode/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/../debugpy/common/compat.py", line 208, in kwonly_f
return f(*args, **kwargs)
File "/Users/ar/.vscode/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/../debugpy/__init__.py", line 135, in connect
return api.connect(address, access_token=access_token)
File "/Users/ar/.vscode/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/../debugpy/server/api.py", line 143, in debug
log.reraise_exception("{0}() failed:", func.__name__, level="info")
File "/Users/ar/.vscode/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/../debugpy/server/api.py", line 141, in debug
return func(address, settrace_kwargs, **kwargs)
File "/Users/ar/.vscode/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/../debugpy/server/api.py", line 276, in connect
_settrace(host=host, port=port, client_access_token=access_token, **settrace_kwargs)
File "/Users/ar/.vscode/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/../debugpy/server/api.py", line 47, in _settrace
return pydevd.settrace(*args, **kwargs)
File "/Users/ar/.vscode/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/_vendored/pydevd/pydevd.py", line 2696, in settrace
_locked_settrace(
File "/Users/ar/.vscode/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/_vendored/pydevd/pydevd.py", line 2819, in _locked_settrace
py_db.enable_tracing(py_db.trace_dispatch, apply_to_all_threads=True)
File "/Users/ar/.vscode/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/_vendored/pydevd/pydevd.py", line 1039, in enable_tracing
pydevd_tracing.SetTrace(thread_trace_func)
File "/Users/ar/.vscode/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/_vendored/pydevd/pydevd_tracing.py", line 83, in SetTrace
if set_trace_to_threads(tracing_func, thread_idents=[thread.get_ident()], create_dummy_thread=False) == 0:
File "/Users/ar/.vscode/extensions/ms-python.python-2021.7.1053846006/pythonFiles/lib/python/debugpy/_vendored/pydevd/pydevd_tracing.py", line 349, in set_trace_to_threads
result = lib.AttachDebuggerTracing(
File "/Users/ar/.pyenv/versions/3.8.10/lib/python3.8/ctypes/__init__.py", line 386, in __getattr__
func = self.__getitem__(name)
File "/Users/ar/.pyenv/versions/3.8.10/lib/python3.8/ctypes/__init__.py", line 391, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(RTLD_DEFAULT, AttachDebuggerTracing): symbol not found
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Can't run Debugger - 'Connection to Python debugger failed
I'm trying to debug within pytest. Adding `PYDEVD_USE_CYTHON=NO` to the configuration stops the socket crashing, but the debugger is broken.
Read more >Errors and Debugging | Python Data Science Handbook
This debugger lets the user step through the code line by line in order to see what might be causing a more difficult...
Read more >python - My PyCharm run is working but debugging is failing
After a hell lot of searching and experimenting, found the solution for my issue. My repo consists of a module named code in...
Read more >Starting python debugger automatically on error - Stack Overflow
If I run a script and I come across, let's say an IndexError, python prints the line, location and quick description of the...
Read more >VS Code Debugger not working for python - Microsoft Q&A
Clicking on "Debug Python File" now does nothing. ... This has been a problem since I first installed VSCode -- I keep looking...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I rolled back to the previous version of the Python extension - v2021.7.1050252941 and the debug started working again.
This is duplicate of https://github.com/microsoft/debugpy/issues/669