Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cannot attach debug for python #564

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

Closed
SpaceBob22 opened this issue Jan 22, 2025 · 5 comments
Closed

Cannot attach debug for python #564

SpaceBob22 opened this issue Jan 22, 2025 · 5 comments
Assignees
Labels
info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team

Comments

@SpaceBob22
Copy link

SpaceBob22 commented Jan 22, 2025

Type: Bug

Behaviour

When clicking the Python Debugger: Remote Attach from the choices offered, it constantly pops up a dialog with no text and 2 buttons:
Open 'launch.json'
Cancel

The launch.json is properly set as intructed in the VSCode online documentation

Steps to reproduce:

  1. Installed debugpy with pip
  2. Added import and setup in my module to listen, with proper address and port, to remote debuggin requests.
  3. created launch.json in .vscode folder of the project with all the usual settings from the online documentation.
  4. launch the script from the software's python interpreter. I do get the output from debugpy saying it's listening to connection in the output logs.
  5. click on the Python Debugger: Remote Attach from the choices offered in VSCode.
  6. get the dialog.

Diagnostic data

launch.json configuration

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python Debugger: Remote Attach Unreal",
            "type": "debugpy",
            "request": "attach",
            "connect": {
                "host": "localhost",
                "port": 5678
            },
            "pathMappings": [
                {
                    "localRoot": "${workspaceFolder}",
                    "remoteRoot": "${workspaceFolder}"
                }
            ]
        }
    ]
}

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

Nothing

Output for Python Debugger in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python Debugger)

Nothing

Extension version: 2024.14.0
VS Code version: Code 1.96.4 (cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba, 2025-01-16T00:16:19.038Z)
OS version: Windows_NT x64 10.0.26100
Modes:

  • Python version (& distribution if applicable, e.g. Anaconda): 3.11.8
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Unknown
System Info
Item Value
CPUs 13th Gen Intel(R) Core(TM) i7-13700 (24 x 2112)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 63.75GB (36.16GB free)
Process Argv --crash-reporter-id d15e58b0-cba1-4fd1-af31-8677d45bb75e
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
a9j8j154:30646983
962ge761:30959799
pythonnoceb:30805159
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
dvdeprecation:31068756
dwnewjupyter:31046869
2f103344:31071589
nativerepl1:31139838
pythonrstrctxt:31112756
nativeloc1:31192215
cf971741:31144450
iacca1:31171482
notype1cf:31157160
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31184530
6074i472:31201624
dwoutputs:31217127
hdaa2157:31222309
copilot_t_ci:31222730

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jan 22, 2025
@eleanorjboyd
Copy link
Member

Can you send a screenshot of this dialog? Also in the run and debug tab, does anything change / appear under the "call stack"?

@eleanorjboyd eleanorjboyd added the info-needed Issue requires more information from poster label Jan 24, 2025
@hu9o
Copy link

hu9o commented Feb 6, 2025

Having the exact same issue -- here's a screenshot of the dialog:

Image

Also, the "call stack" section of the "RUN AND DEBUG" pane remains empty.

@eleanorjboyd
Copy link
Member

Can you set your log level to trace and see if that makes a different on if there are any logs in your output? I have no idea what is going on especially since there is not messages / more information given the blank popup. You can set your log level by using "Developer: set log level..." in the command palette.

Copy link

Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.

Happy Coding!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 17, 2025
@jimklo
Copy link

jimklo commented Apr 29, 2025

@eleanorjboyd

I'm having this exact same experience on MacOS.

Version: 1.96.4 (Universal)
Commit: cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba
Date: 2025-01-16T00:16:19.038Z
Electron: 32.2.6
ElectronBuildId: 10629634
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Darwin arm64 24.4.0

Here's my launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Attach to Reports Server",
            "type": "debugpy",
            "request": "attach",
            "connect": {
                "host": "localhost",
                "port": 5678
            },
            "pathMappings": [
                {
                    "localRoot": "/Users/e27574/projects/SIBIS/source/hivalc-data-integration/webtools/reporter_server",
                    "remoteRoot": "/usr/src/app"
                }
            ]
        }
    ]

Logs set to Trace. I click to start debug...

2025-04-28 21:30:54.479 [debug] [context keys] Window state change. Needs offline check: false, active: true, focused: true.

==> window1/renderer.log <==
2025-04-28 21:30:54.489 [trace] writeTextAreaState(reason: selection changed)
2025-04-28 21:30:54.489 [trace] [text file model] resolve() - enter file:///Users/e27574/projects/SIBIS/source/hivalc-data-integration/.vscode/launch.json
2025-04-28 21:30:54.489 [trace] [text file model] resolveFromFile() file:///Users/e27574/projects/SIBIS/source/hivalc-data-integration/.vscode/launch.json

==> main.log <==
2025-04-28 21:30:54.726 [trace] menubarService#updateMenubar 1

==> window1/renderer.log <==
2025-04-28 21:30:59.292 [trace] CommandService#executeCommand workbench.action.debug.start
2025-04-28 21:30:59.309 [trace] Error while resolving configuration file 'vscode-userdata:/Users/e27574/Library/Application%20Support/Code/User/profiles/-13ad7d60/tasks.json': Unable to read file 'vscode-userdata:/Users/e27574/Library/Application Support/Code/User/profiles/-13ad7d60/tasks.json' (Error: Unable to resolve nonexistent file 'vscode-userdata:/Users/e27574/Library/Application Support/Code/User/profiles/-13ad7d60/tasks.json')
2025-04-28 21:30:59.312 [trace] Error while resolving configuration file 'file:///Users/e27574/projects/SIBIS/source/sibispy/.vscode/settings.json': Unable to read file '/Users/e27574/projects/SIBIS/source/sibispy/.vscode/settings.json' (Error: Unable to resolve nonexistent file '/Users/e27574/projects/SIBIS/source/sibispy/.vscode/settings.json')
2025-04-28 21:30:59.315 [trace] Error while resolving configuration file 'file:///Users/e27574/projects/SIBIS/source/sibispy/.vscode/tasks.json': Unable to read file '/Users/e27574/projects/SIBIS/source/sibispy/.vscode/tasks.json' (Error: Unable to resolve nonexistent file '/Users/e27574/projects/SIBIS/source/sibispy/.vscode/tasks.json')
2025-04-28 21:30:59.315 [trace] Error while resolving configuration file 'file:///Users/e27574/projects/SIBIS/source/sibispy/.vscode/launch.json': Unable to read file '/Users/e27574/projects/SIBIS/source/sibispy/.vscode/launch.json' (Error: Unable to resolve nonexistent file '/Users/e27574/projects/SIBIS/source/sibispy/.vscode/launch.json')
2025-04-28 21:30:59.315 [trace] Error while resolving configuration file 'file:///Users/e27574/projects/SIBIS/source/hivalc-data-integration/.vscode/settings.json': Unable to read file '/Users/e27574/projects/SIBIS/source/hivalc-data-integration/.vscode/settings.json' (Error: Unable to resolve nonexistent file '/Users/e27574/projects/SIBIS/source/hivalc-data-integration/.vscode/settings.json')
2025-04-28 21:30:59.315 [trace] Error while resolving configuration file 'file:///Users/e27574/projects/SIBIS/source/hivalc-data-integration/.vscode/tasks.json': Unable to read file '/Users/e27574/projects/SIBIS/source/hivalc-data-integration/.vscode/tasks.json' (Error: Unable to resolve nonexistent file '/Users/e27574/projects/SIBIS/source/hivalc-data-integration/.vscode/tasks.json')
2025-04-28 21:30:59.315 [trace] Error while resolving configuration file 'file:///Users/e27574/projects/SIBIS/source/hivalc-operations/.vscode/settings.json': Unable to read file '/Users/e27574/projects/SIBIS/source/hivalc-operations/.vscode/settings.json' (Error: Unable to resolve nonexistent file '/Users/e27574/projects/SIBIS/source/hivalc-operations/.vscode/settings.json')
2025-04-28 21:30:59.315 [trace] Error while resolving configuration file 'file:///Users/e27574/projects/SIBIS/source/hivalc-operations/.vscode/launch.json': Unable to read file '/Users/e27574/projects/SIBIS/source/hivalc-operations/.vscode/launch.json' (Error: Unable to resolve nonexistent file '/Users/e27574/projects/SIBIS/source/hivalc-operations/.vscode/launch.json')
2025-04-28 21:30:59.315 [trace] Error while resolving configuration file 'file:///Users/e27574/projects/SIBIS/source/hivalc-operations/.vscode/tasks.json': Unable to read file '/Users/e27574/projects/SIBIS/source/hivalc-operations/.vscode/tasks.json' (Error: Unable to resolve nonexistent file '/Users/e27574/projects/SIBIS/source/hivalc-operations/.vscode/tasks.json')
2025-04-28 21:30:59.315 [trace] Error while resolving configuration file 'file:///Users/e27574/projects/SIBIS/data/.vscode/settings.json': Unable to read file '/Users/e27574/projects/SIBIS/data/.vscode/settings.json' (Error: Unable to resolve nonexistent file '/Users/e27574/projects/SIBIS/data/.vscode/settings.json')
2025-04-28 21:30:59.315 [trace] Error while resolving configuration file 'file:///Users/e27574/projects/SIBIS/data/.vscode/tasks.json': Unable to read file '/Users/e27574/projects/SIBIS/data/.vscode/tasks.json' (Error: Unable to resolve nonexistent file '/Users/e27574/projects/SIBIS/data/.vscode/tasks.json')
2025-04-28 21:30:59.315 [trace] Error while resolving configuration file 'file:///Users/e27574/projects/SIBIS/data/.vscode/launch.json': Unable to read file '/Users/e27574/projects/SIBIS/data/.vscode/launch.json' (Error: Unable to resolve nonexistent file '/Users/e27574/projects/SIBIS/data/.vscode/launch.json')
2025-04-28 21:30:59.354 [trace] onWillActivateByEvent:  onDebugResolve
2025-04-28 21:30:59.354 [trace] onWillActivateByEvent:  onDebugResolve:debugpy

==> window1/exthost/extensionTelemetry.log <==
2025-04-28 21:30:59.361 [trace] ms-python.debugpy/DEBUGGER {"properties":{"trigger":"attach","hasEnvVars":"false","django":"false","fastapi":"false","flask":"false","hasArgs":"false","isLocalhost":"false","isModule":"false","isSudo":"false","jinja":"false","pyramid":"false","stopOnEntry":"false","showReturnValue":"true","subProcess":"false","autoStartBrowser":"true","watson":"false","pyspark":"false","gevent":"false","scrapy":"false","common.os":"darwin","common.nodeArch":"arm64","common.platformversion":"24.4.0","common.telemetryclientversion":"0.8.5","common.extname":"ms-python.debugpy","common.extversion":"2025.6.0","common.vscodemachineid":"118803e7f3b49ef3d6f4a51d59833939eaddfb321d02b16239a008b8b14bcbcb","common.vscodesessionid":"0f998d96-2db9-40ca-9556-bc32a2d9b5911745900250850","common.sqmid":"","common.devDeviceId":"3aa23ca5-bbd5-499b-86d7-6e314a7317ce","common.vscodeversion":"1.96.4","common.isnewappinstall":false,"common.product":"desktop","common.uikind":"desktop","common.remotename":"none"}}

==> window1/exthost/ms-python.debugpy/Python Debugger.log <==
2025-04-28 21:30:59.361 [info] Resolving attach configuration with substituted variables

==> window1/exthost/extensionTelemetry.log <==
2025-04-28 21:30:59.363 [trace] ms-python.debugpy/DEBUG_SESSION.START {"properties":{"trigger":"attach","common.os":"darwin","common.nodeArch":"arm64","common.platformversion":"24.4.0","common.telemetryclientversion":"0.8.5","common.extname":"ms-python.debugpy","common.extversion":"2025.6.0","common.vscodemachineid":"118803e7f3b49ef3d6f4a51d59833939eaddfb321d02b16239a008b8b14bcbcb","common.vscodesessionid":"0f998d96-2db9-40ca-9556-bc32a2d9b5911745900250850","common.sqmid":"","common.devDeviceId":"3aa23ca5-bbd5-499b-86d7-6e314a7317ce","common.vscodeversion":"1.96.4","common.isnewappinstall":false,"common.product":"desktop","common.uikind":"desktop","common.remotename":"none"},"measurements":{"duration":0}}

==> window1/exthost/ms-python.debugpy/Python Debugger.log <==
2025-04-28 21:30:59.363 [info] Connecting to DAP Server at:  localhost:5678

==> window1/renderer.log <==
2025-04-28 21:30:59.365 [trace] DialogService#prompt

==> window1/exthost/exthost.log <==
2025-04-28 21:31:01.367 [debug] ProxyResolver#resolveProxy cached https://mobile.events.data.microsoft.com/OneCollector/1.0?cors=true&content-type=application/x-json-stream PROXY 127.0.0.1:9000
2025-04-28 21:31:01.367 [trace] ProxyResolver#lookupProxyAuthorization callback proxyURL:http://127.0.0.1:9000/ proxyAuthenticate:undefined proxyAuthenticateCache:undefined
2025-04-28 21:31:01.367 [trace] ProxyResolver#net.connect [{"ALPNProtocols":"http/1.1","lookupProxyAuthorization":"[Function: bound dz]","host":"127.0.0.1","port":9000}]
2025-04-28 21:31:01.368 [debug] ProxyResolver#resolveProxy cached https://mobile.events.data.microsoft.com/OneCollector/1.0?cors=true&content-type=application/x-json-stream PROXY 127.0.0.1:9000
2025-04-28 21:31:01.368 [trace] ProxyResolver#lookupProxyAuthorization callback proxyURL:http://127.0.0.1:9000/ proxyAuthenticate:undefined proxyAuthenticateCache:undefined
2025-04-28 21:31:01.368 [trace] ProxyResolver#net.connect [{"ALPNProtocols":"http/1.1","lookupProxyAuthorization":"[Function: bound dz]","host":"127.0.0.1","port":9000}]

==> window1/exthost/extensionTelemetry.log <==
2025-04-28 21:31:01.369 [trace] ms-python.debugpy/DEBUG_SESSION.STOP {"properties":{"trigger":"attach","common.os":"darwin","common.nodeArch":"arm64","common.platformversion":"24.4.0","common.telemetryclientversion":"0.8.5","common.extname":"ms-python.debugpy","common.extversion":"2025.6.0","common.vscodemachineid":"118803e7f3b49ef3d6f4a51d59833939eaddfb321d02b16239a008b8b14bcbcb","common.vscodesessionid":"0f998d96-2db9-40ca-9556-bc32a2d9b5911745900250850","common.sqmid":"","common.devDeviceId":"3aa23ca5-bbd5-499b-86d7-6e314a7317ce","common.vscodeversion":"1.96.4","common.isnewappinstall":false,"common.product":"desktop","common.uikind":"desktop","common.remotename":"none"},"measurements":{"duration":2005}}

==> window1/exthost/exthost.log <==
2025-04-28 21:31:01.441 [trace] ProxyResolver#tls.connect [{"protocol":"https:","hostname":"mobile.events.d[32 chars]","method":"POST","headers":"[object Object]","agent":"[object Object]","_defaultAgent":"[object Object]","lookupProxyAuthorization":"[Function: bound dz]","noDelay":true,"servername":"mobile.events.d[32 chars]","secureEndpoint":true,"_vscodeAdditionalCaCerts":"[119 certs]","socket":"[object Object]"}]
2025-04-28 21:31:01.452 [trace] ProxyResolver#tls.connect [{"protocol":"https:","hostname":"mobile.events.d[32 chars]","method":"POST","headers":"[object Object]","agent":"[object Object]","_defaultAgent":"[object Object]","lookupProxyAuthorization":"[Function: bound dz]","noDelay":true,"servername":"mobile.events.d[32 chars]","secureEndpoint":true,"_vscodeAdditionalCaCerts":"[119 certs]","socket":"[object Object]"}]

==> window1/renderer.log <==
2025-04-28 21:31:01.959 [trace] ChatService#onWillSaveState: Persisting 1 sessions
2025-04-28 21:31:01.960 [trace] ChatService#onWillSaveState: Persisting 51677 chars
2025-04-28 21:31:01.960 [debug] Comments: URIs of continue on comments to add to storage .

==> window1/exthost/GitHub.copilot-chat/GitHub Copilot Chat.log <==
2025-04-28 21:31:01.960 [debug] [context keys] Window state change. Needs offline check: false, active: true, focused: false.

==> window1/exthost/exthost.log <==
2025-04-28 21:31:03.373 [debug] ProxyResolver#resolveProxy cached https://mobile.events.data.microsoft.com/OneCollector/1.0?cors=true&content-type=application/x-json-stream PROXY 127.0.0.1:9000
2025-04-28 21:31:03.373 [trace] ProxyResolver#lookupProxyAuthorization callback proxyURL:http://127.0.0.1:9000/ proxyAuthenticate:undefined proxyAuthenticateCache:undefined
2025-04-28 21:31:03.373 [trace] ProxyResolver#net.connect [{"ALPNProtocols":"http/1.1","lookupProxyAuthorization":"[Function: bound dz]","host":"127.0.0.1","port":9000}]
2025-04-28 21:31:03.416 [trace] ProxyResolver#tls.connect [{"protocol":"https:","hostname":"mobile.events.d[32 chars]","method":"POST","headers":"[object Object]","agent":"[object Object]","_defaultAgent":"[object Object]","lookupProxyAuthorization":"[Function: bound dz]","noDelay":true,"servername":"mobile.events.d[32 chars]","secureEndpoint":true,"_vscodeAdditionalCaCerts":"[119 certs]","socket":"[object Object]"}]

==> window1/renderer.log <==
2025-04-28 21:31:31.339 [trace] ChatService#onWillSaveState: Persisting 1 sessions
2025-04-28 21:31:31.358 [trace] ChatService#onWillSaveState: Persisting 51677 chars
2025-04-28 21:31:31.358 [debug] Comments: URIs of continue on comments to add to storage .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

4 participants