Run remote Debug success,But restart Debug errorInfo-show: connect ECONNREFUSED ip-address:5678
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Reproduce the remote attach and restart flow using launch.json, task.json, and main.py, starting at the debugpy.listen() and debugpy.wait_for_client() calls. Check how the second attach is initiated after the first session and verify that restarting preserves the connection instead of producing ECONNREFUSED on port 5678.
Written by the indexing model from the issue text.
Description
Environment data
- OS: Ubuntu 22.04
- Python version (& distribution if applicable, e.g. Anaconda): 3.8.10
- debugpy version:1.8.1
- Using VS Code or Visual Studio: VSCode 1.88.1, Terminal
Actual behavior
I can connect normally with debugging and debugging normally,But click to re -debug, you will prompt an error and exit the debugging
Expected behavior
If I click to restart the debugging, I should continue the normal debugging process
error: connect ECONNREFUSED ip-address:5678
Steps to reproduce:
vscode:
launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "connect to remote server",
"type": "debugpy",
"request": "attach",
"preLaunchTask": "Run_Python",
"connect": {
"host": "ip-address",
"port": 5678
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "/home/xxx/py/py/"
}
],
"justMyCode": true
}
]
}
task.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "Run_Python",
"type": "shell",
"command": "ssh -tt xxx@ip-address 'python /home/xxx/py/py/main.py'",
"args": [],
"isBackground": true,
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": {
"owner": "python",
"source": "debugpy",
"fileLocation": [
"relative",
"${workspaceFolder}"
],
"pattern": [
{
"regexp": "\\s+(.*)$",
"message": 1
},
{
"regexp": "Connection to closed",
"file": 1,
"line": 1,
"column": 1
}
],
"background": {
"activeOnStart": false,
"beginsPattern": {
"regexp": "start"
},
"endsPattern": {
"regexp": "Waiting for debugger attach"
}
}
},
"presentation": {
"echo": true,
"panel": "shared",
"focus": true,
"clear": true
}
}
]
}
code:
print("start")
import debugpy
# 5678 is the default attach port in the VS Code debug configurations. Unless a host and port are specified, host defaults to 127.0.0.1
debugpy.listen(('0.0.0.0', 5678))
print("Waiting for debugger attach")
debugpy.wait_for_client()
debugpy.breakpoint()
def add_fun(a, b):
a = a * 10
b = b * 100
c = a + b
return c
if __name__ == '__main__':
a = 10
b = 78
c = add_fun(a, b)
c = c
print(f"a + b = {c}")
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 202
- Avg merge
- 5d 1h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/debugpy
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
All issues in microsoft/debugpy
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
xinnan-tech/xiaozhi-fde-talk#263 ·
-
rules
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
huggingface/Repo2RLEnv#163 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 95/100
huggingface/sentence-transformers#4074 ·
-
comp/dashboard invalid P3
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
NousResearch/hermes-agent#121143 ·