Skip to content

Unable to attach to remote. No error, just a prompt to open launch.json #701

Open
@jimklo

Description

@jimklo

I'm currently trying to remote debug some code running in a docker container. I've rebuilt the container to install debugpy as well as launching the container with debugpy and exposing both web (8080) and debug (5678) ports to the host. When trying to start the debug, I just get a pop-up window that just opens up the dialog prompting be to open launch.json. I would expect it to try and attach to the process via port 5678 to debug. No apparent errors are logged, even when log detail is set to TRACE.

Image

This issue seems very similar to #564

Here's the details:

VS Code Version info:

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 hardware and os:
Image

I am using a Workspace in VS Code that has 4 different sub projects that are located in different places on the drive. The launch.json is located within one of the sub-projects and not globally at the workspace. I've tried this same config in both places, same result. I've also tried created a config without a workspace with unchanged behavior.

Here's the launch.json config:

{
    "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. Here is the output of the logs once I click the button to initiate debugging...

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 .

Other things I've done is grant VS Code full disk access, which shouldn't be the issue, however changing this configuration does nothing.

To prove ports are exposed, here's docker ps:

$ docker ps
CONTAINER ID   IMAGE                        COMMAND                  CREATED         STATUS         PORTS                                            NAMES
2305d24b6acc   hivalc-reports-back:latest   "python3 -m debugpy …"   9 seconds ago   Up 8 seconds   0.0.0.0:5678->5678/tcp, 0.0.0.0:8080->8080/tcp   reports-reports-back-1

And here's the command that is used inside the container to start the process for debugging process:

python3 -m debugpy --listen 0.0.0.0:5678 --wait-for-client reporter_server --debug

Metadata

Metadata

Assignees

Labels

info-neededIssue requires more information from postertriage-neededNeeds assignment to the proper sub-team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions