-
Notifications
You must be signed in to change notification settings - Fork 161
Debugging fails to start when Visual Studio Code Remote automatically forwards ports from a GitHub Codespace #506
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
Comments
This is sort of expected when VSCode remote server forwards all ports, since debugpy uses a bunch of them for local connections. It appears that there's now a (as yet unstable) VSCode API that extensions can use to tell the port forwarder to ignore some addresses: microsoft/vscode#11561; the Jupyter extension is already using it, so the core Python extension might have to start doing that, as well. For launch, this should be fairly easy, since only the adapter process opens listener ports, and the extension spawns it directly, so it knows its PID - so For attach, it's trickier because the adapter gets spawned by the debuggee in that scenario, and the extension doesn't know its PID or port numbers. It looks like the port provider API has an optional command line argument - if it's reliable enough, it could be used to filter anything matching @karthiknadig, what do you think? |
In the attach case since it is not really spawned by a process under VS Code process tree will the ports be forwarded at all? |
@jarrodldavis Does this still reproduce for you? Debugging a web app in a Codespace seems to be working fine for me. |
Please re-open if this issue is still relevant. |
Maybe this solution posted on StackOverFlow helps you. It seems to be a similar problem. |
Environment data
import debugpy; print(debugpy.__version__)
if uncertain) [this didn't work, I getModuleNotFoundError: No module named 'debugpy'
]Actual behavior
Debugging fails with connection refused errors (similar to #84) when ports are automatically forward from a Codespace (default behavior of Visual Studio Code).
Expected behavior
Debugging a Django app starts fine even when ports are (automatically) forwarded, or Visual Studio Code doesn't automatically forward ports important for Python debugging.
Steps to reproduce:
Connection refused
errorI was able to work around this issue by disabling automatic port forwarding (setting
remote.autoForwardPorts
tofalse
) and reloading Visual Studio Code.The text was updated successfully, but these errors were encountered: