-
Notifications
You must be signed in to change notification settings - Fork 1.2k
VS code remote debug connect fail. #133
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
From @papaiatis on June 27, 2017 10:49 Same problem here. |
From @joenot443 on June 28, 2017 19:1 Have had the same issue for several weeks now, would really like to see a fix. |
Please could each of you confirm that you have PTVSD version 3.0.0 installed and not the latest version of PTVSD. |
From @papaiatis on June 29, 2017 11:57 I had 3.1.0 installed. Downgraded, but did not help. Still getting the "Debug adapter process has terminated unexpectedly" message. |
From @asierralozano on July 4, 2017 4:55 Same issue here. Using PTVSD 3.0.0 too |
From @commagere on July 25, 2017 2:49 I'm seeing this exact issue as well - even with the "hello_world" test app. VS Code version: 1.14.2 |
From @marcosfede on August 24, 2017 3:44 Same here, using ptvsd 3.0.0. Devtools shows |
From @Petezah on August 29, 2017 19:46 Same. ptvsd 3.0.0 also. |
I had the same issue. I resolved it by installing PTVSD 3.0.0 on the remote environment (i.e. docker container). PTVSD on the local enviroment does not affect it. In fact, I uninstalled PTVSD from machine to confirm. I do feel like the latest version should be supported, though. |
I have the same error however I am using PTVSD 3.2.1. |
@dmk255 please use 3.0.0, anything later than that isn't currently supported. |
@DonJayamanne I didn't realize it was important to have that exact version. Is there a good place in the Docs to add this? I'm happy to write it up. |
@dmk255 It's already documented: https://code.visualstudio.com/docs/python/debugging#_remote-debugging (see step 1). |
@brettcannon the problem is the documentation indicates that later versions are supported, when this isn't the case. I've created an issue to ensure this is fixed #514. |
@AwayQuEM @papaiatis @joenot443 @asierralozano @commagere @Petezah
|
@DonJayamanne I just tried to reproduce the issue. local Environment:
remote environment:
The only way I've managed to get the remote debugger connected is by using the following configs:
#!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.local')
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is really that Django is missing to avoid masking other
# exceptions on Python 2.
try:
import django # noqa
except ImportError:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
)
raise
# This allows easy placement of apps within the interior
# backend directory.
current_path = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(current_path, 'backend'))
import ptvsd
address = ('0.0.0.0', 9000)
ptvsd.enable_attach('secret', address)
# print('waiting for attach...')
# ptvsd.wait_for_attach()
execute_from_command_line(sys.argv) startup command: launch.json configs {
"name": "Attach (Remote Debug)",
"type": "python",
"request": "attach",
"localRoot": "${workspaceRoot}",
"remoteRoot": "${workspaceRoot}",
"port": 9000,
"secret": "secret",
"host": "localhost"
} However:
let me know if you need some more information |
So, it works for you with the version 3.0.0. Thanks. I'm looking for a sample code (repo) that I could use to replicate this issue using |
Okay, finally found a minute to try this. I can still currently repro this with this command line python script (with version 3.0.0, launched with python3 on a Mac): import ptvsd
if __name__ == "__main__":
ptvsd.enable_attach("my_secret")
ptvsd.wait_for_attach()
print("hello world") with launch.json config: {
"name": "Python: Attach",
"type": "python",
"request": "attach",
"localRoot": "${workspaceFolder}",
"remoteRoot": "${workspaceFolder}",
"port": 3000,
"secret": "my_secret",
"host": "localhost"
} I get the following error:
|
@Petezah
Looks like you're the only one experiencing this issue with PTVSD 3.0.0 |
Sure thing. |
@Petezah please could you try changing the port to something else and trying once again. Thanks |
Arrrgh. Ok, I see why this wasn't working now. DEFAULT_PORT is actually 5678, not 3000. The adapter was trying to attach to 3000 (just from the boilerplate attach.json stuff). Setting the port manually works, even with port 3000. Did this change recently? I swear I was just using the default params before, and it was working for me. |
@Petezah Oh yes, I missed that too, you weren't providing a port number. Thanks. |
This seems to be resolved for most people either by providing the port number or using PTVSD 3.0.0. |
From @AwayQuEM on June 20, 2017 3:29
Environment data
VS Code version: 1.13.1 on Mac
Python Extension version: 0.6.5 on mac
Python Version: 3.5.2
OS and version: OS X 10.12.5
ptvsd version:3.0.0 on Mac
Actual behavior
I still got
'Debug adapter process has terminated unexpectedly'
with ptvsd==3.0.0Steps to reproduce:
Settings
Your launch.json (if dealing with debugger issues):
Your settings.json:
Logs
Output from
Console window
(Help->Developer Tools menu)Code
Copied from original issue: DonJayamanne/pythonVSCode#1039
The text was updated successfully, but these errors were encountered: