-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Description
Summary
When using the debugpy adapter, the ["connect"]["host"] value is ignored and "127.0.0.1" is used instead.
Description
Steps to trigger the problem:
- Run
python3 -m debugpy --listen 0.0.0.0:5678 --wait-for-client script.pyon another machine with port 5678 exposed. - Place the following in .zed/debug.json:
[
{
"adapter": "Debugpy",
"label": "External Python",
"request": "attach",
"connect": { "host": "<hostname-of-server>", "port": 5678 }
}
]
- Press the debug icon and select "External Python", that we just made.
Expected Behavior:
The debugger should attach to the debugpy on the hostname of the server we specified.
Actual Behavior:
The console outputs
error:
error: process exited before debugger attached.
and nothings happens.
When tested in vscode, it works as expected, so I know it is not my environment or the setup on the server.
Inspecting the logs reveal that it is trying to go to 127.0.0.1:5678 instead of hostname-of-server:5678.
Because of this, I tried with ssh port forwarding:
ssh <username>@<hostname-of-server> -L 5678:127.0.0.1:5678
and that worked - even if I keep the host as "hostname-of-server", indicating that it is indeed using "127.0.0.1" instead of what I specified.
Zed Version and System Specs
Zed: v0.212.5 (Zed)
OS: Linux X11 ubuntu 24.04
Memory: 31.1 GiB
Architecture: x86_64
GPU: NVIDIA GeForce RTX 2060 || NVIDIA || 580.95.05
If applicable, attach your Zed.log file to this issue.
Zed.log
2025-11-14T15:13:57+01:00 INFO [dap::transport] Debug adapter has connected to TCP server 127.0.0.1:5678
2025-11-14T15:13:57+01:00 ERROR [debugger_ui::debugger_panel]
error: process exited before debugger attached.