我目前正在从 Linux 机器进行远程开发。我已成功将远程代码安装到带有 remote-ssh 扩展的 Visual Studio 代码。
当我尝试使用进程 ID 使用 Attach 进行调试时。我看到“等待调试服务器连接超时”。错误。
我已经在 VS 代码中从远程机器设置了 python2.7 解释器。当我运行调试时使用默认的launch.json,我可以看到进程ID并选择了一个。它抛出超时错误。
启动 json: Launch.json
日志片段:
I+00000.030: Injector[PID=13037] output:
0x00007f8f5e44a923 in ?? () from /lib64/libc.so.6
I+00000.030: Injector[PID=13037] output:
The target architecture is set automatically (currently i386:x86-64)
I+00000.030: Injector[PID=13037] output:
I+00000.030: Injector[PID=13037] output:
stderr: No symbol "dlopen" in current context.
I+00000.030: Injector[PID=13037] output:
No symbol "DoAttach" in current context.
I+00000.030: Injector[PID=13037] output:
I+00000.030: Injector[PID=13037] exited.
I+00000.030: All debug servers disconnected; waiting for remaining sessions...
E+00000.030: /handling #2 request "attach" from Client[1]/
Traceback (most recent call last):
File "/home/vssetup/.vscode-server/extensions/ms-python.python-2021.12.1559732655/pythonFiles/lib/python/debugpy/adapter/../../debugpy/common/messaging.py", line 1062, in __init__
raise self
MessageHandlingError: Timed out waiting for debug server to connect.
Stack where logged:
File "/usr/local/lib/python2.7/threading.py", line 783, in __bootstrap
self.__bootstrap_inner()
File "/usr/local/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/local/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/vssetup/.vscode-server/extensions/ms-python.python-2021.12.1559732655/pythonFiles/lib/python/debugpy/adapter/../../debugpy/common/messaging.py", line 1510, in _run_handlers
handler()
File "/home/vssetup/.vscode-server/extensions/ms-python.python-2021.12.1559732655/pythonFiles/lib/python/debugpy/adapter/../../debugpy/common/messaging.py", line 747, in _handle
result = handler(self)
File "/home/vssetup/.vscode-server/extensions/ms-python.python-2021.12.1559732655/pythonFiles/lib/python/debugpy/adapter/../../debugpy/adapter/components.py", line 95, in lock_and_handle
return f(self, message)
File "/home/vssetup/.vscode-server/extensions/ms-python.python-2021.12.1559732655/pythonFiles/lib/python/debugpy/adapter/../../debugpy/adapter/clients.py", line 199, in handle
f(self, request)
File "/home/vssetup/.vscode-server/extensions/ms-python.python-2021.12.1559732655/pythonFiles/lib/python/debugpy/adapter/../../debugpy/adapter/clients.py", line 514, in attach_request
sub_pid,
File "/home/vssetup/.vscode-server/extensions/ms-python.python-2021.12.1559732655/pythonFiles/lib/python/debugpy/adapter/../../debugpy/common/messaging.py", line 560, in cant_handle
return self.error(MessageHandlingError, *args, **kwargs)
File "/home/vssetup/.vscode-server/extensions/ms-python.python-2021.12.1559732655/pythonFiles/lib/python/debugpy/adapter/../../debugpy/common/messaging.py", line 546, in error
exc = exc_type(reason, self, silent) # will log it
File "/home/vssetup/.vscode-server/extensions/ms-python.python-2021.12.1559732655/pythonFiles/lib/python/debugpy/adapter/../../debugpy/common/messaging.py", line 1064, in __init__
log.swallow_exception()
File "/home/vssetup/.vscode-server/extensions/ms-python.python-2021.12.1559732655/pythonFiles/lib/python/debugpy/adapter/../../debugpy/common/log.py", line 218, in swallow_exception
_exception(format_string, *args, **kwargs)
D+00000.030: /handling #2 request "attach" from Client[1]/
Client[1] <-- {
"seq": 5,
"type": "response",
"request_seq": 2,
"success": false,
"command": "attach",
"message": "Timed out waiting for debug server to connect."
}
E+00000.030: /handling #2 request "attach" from Client[1]/
Handler 'handle' (file u'/home/vssetup/.vscode-server/extensions/ms-python.python-2021.12.1559732655/pythonFiles/lib/python/debugpy/adapter/../../debugpy/adapter/components.py', line 91)
couldn't handle #2 request "attach" from Client[1]:
Timed out waiting for debug server to connect.
D+00000.030: Client[1] --> {
"seq": 3,
"type": "request",
"command": "disconnect",
"arguments": {
"restart": false
}
}
I+00000.030: /handling #3 request "disconnect" from Client[1]/
client requested "disconnect"; finalizing Session[1].
D+00000.030: /handling #3 request "disconnect" from Client[1]/
Client[1] <-- {
"seq": 6,
"type": "event",
"event": "terminated"
}
I+00000.030: /handling #3 request "disconnect" from Client[1]/
Session[1] finalized.
D+00000.030: /handling #3 request "disconnect" from Client[1]/
Client[1] <-- {
"seq": 7,
"type": "response",
"request_seq": 3,
"success": true,
"command": "disconnect"
}