Adapter bootstrap fails with ConnectionRefusedError on WSL2 VirtioProxy or hostAddressLoopback
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- devtools, networking
Direzione di ricerca
Inizia in debugpy/adapter/main.py, nella chiamata dell’adattatore a sock.connect((localhost, args.for_server)), quindi riproduci il problema con il comando uv run fornito in WSL2. Confronta il comportamento con networkingMode=VirtioProxy e hostAddressLoopback=true abilitati o disabilitati; il lavoro è completato quando debugpy.listen() si avvia senza ConnectionRefusedError con le impostazioni interessate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Before creating a new issue, please check the FAQ to see if your question is answered there.
Environment data
- debugpy version: 1.8.21
- OS and version: Windows 11 build 26200.9106, Ubuntu 24.04 on WSL2
- Python version (& distribution if applicable, e.g. Anaconda): CPython 3.14.4, installed/managed by uv
- WSL version: 2.7.12.0
- Using VS Code or Visual Studio: bash only
Actual behavior
debugpy.listen() consistently fails during its internal adapter bootstrap. The adapter immediately fails when connecting back to debugpy's temporary callback listener:
ConnectionRefusedError: [Errno 111] Connection refused
The relevant adapter log lines are:
Sending endpoints info to debug server at localhost:<port>
ConnectionRefusedError: [Errno 111] Connection refused
This occurs before the debuggee starts and without an IDE or debugger client involved.
It occurs deterministically when either networkingMode=VirtioProxy or hostAddressLoopback=true is enabled in %UserProfile%\.wslconfig. Both settings independently trigger the problem.
Adding a time.sleep(0.2) immediately before the following line in debugpy/adapter/__main__.py works around the issue:
sock.connect((localhost, args.for_server))
Expected behavior
debugpy.listen() should start normally under WSL2 with networkingMode=VirtioProxy and/or hostAddressLoopback=true enabled.
Steps to reproduce:
-
In
%UserProfile%\.wslconfig, enable either setting:[wsl2] networkingMode=VirtioProxyor:
[experimental] hostAddressLoopback=true -
Apply the configuration from Windows PowerShell:
wsl --shutdown -
Open WSL and run:
uv run python -Xfrozen_modules=off -m debugpy \ --listen 127.0.0.1:5678 \ -c "import time; time.sleep(60)" -
Observe the immediate
ConnectionRefusedErrorfrom the debugpy adapter. -
Disable the relevant
.wslconfigsetting, runwsl --shutdown, and repeat. The command succeeds.
- Lingua principale
- Python
- Stelle
- 2.5k
- Fork
- 202
- Merge medio
- 5g 1h
- PR unite (30g)
- 1
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/debugpy
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Document "rules"-option Apertadocumentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
Tutte le issue di microsoft/debugpy
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
use-agent-os/agent-os#3314 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
BasedHardware/omi#15662 · 1 commento ·
-
documentation help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
AiursoftWeb/AnduinOS-2#19 ·