-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Timeout waiting for debugger connection when using Windows PowerShell #2732
Comments
OK, so I added settings.json in .vscode No change in the timeout behavior - still does not connect and times out |
Also, this is Windows 10 professional release 10.0.17134 |
Dug into conda location. |
Note, this is a JSON file hence back slashes need to be encoded.
|
When I loaded settings.json, the double backslashes had already been changed / fixed. "python.pythonPath": "C:\PyAna2\envs\pandas36\python.exe", Tried debugger connection - still a timeout and no connection |
Finally, I tried the insiders VSIX file, it did not load. Got this error message: /C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:2407 Sorry, something went wrong activating IntelliCode support for Python. Please check the "VS IntelliCode" output window for details. I used View:Toggle Output a couple of times but am not seeing anything in the output window that is helpful. I'm cycling through Problems / Output / Debug Console / Terminal "tabs" and also all combinations of the pulldown on the right. Tried to connect debugger again, no connection. How would I uninstall the VSIX file? |
Please send a screen shot of the contents in settings.json |
I was testing for issue #2698 and faced similar issue with in-development build vsix. F5 started the debugger for Python-Flask debug config, it gets hung. Similarly with Python-Current File debug config, if any of the module imports fails, exception is not shown on the terminal, but the debugger get hung. I pressed Ctrl+C to break, and got the below stack Traceback (most recent call last): VS Code version 1.27.2 |
Please elaborate on this. How do you know about this failure, |
Next:
Please disable Intelli-code for now (or just uninstall it). and try again. |
Disabled the Intelli-code for now. Re-ran everything is the same. I am noticing a little orange alert on the gearbox that says there is some issue with launch.json. Looks like this is present in all of the screenshots today. I had set this up before, and somehow I must have deleted it. |
After I disabled Intelli-code, I shut VScode down and restarted. It gave me a new window. When I opened a folder in my VScode root directory, I got my old files back. Interestingly, a comma had been dropped out of my launch.json file, I added the comma, saved, and re-ran the program successfully, went to activate the debugger (debugger gear now clear), same behavior: Timeout waiting for debugger connections. Likely unrelated, but also see this terminal output, which looks strange and I have not seen before. I am much more interested in the lack of debugger connection..... |
@MandarJKulkarni @F8F-Bearcat Please could you both try the following Item 1
Item 2: If previous step doesn't work
Please do send screenshots, that helps a lot. |
For Item 1: added the terminal activate parameter as false, tried debugging - same behavior, no connection For item 2: changing to the command prompt did do something, bit looks like it hit an error on the command line before the debugger tried to connect. I don't know where this command line string comes from to edit the &&. I'll also try restarting VScode. |
@DonJayamanne , Sorry, none of the 2 items worked for me. About the "Please elaborate on this. How do you know about this failure,": It was not a system module, but the module written by me which had some issue. |
Should I remove the activateEnvironment flag as it did not change the behavior? In the spirit of just changing one thing at a time. |
Please could you try this once again however, this time go into your "timeout": 10000
}, Please ensure this setting is added into the right launch configuration item. |
Yes, that's fine. |
Don
I have two machines running 1.28.1 The first is a very clean (last night) install of win 10, anaconda python. Its still contains Powershell and disabled auto-activation.
The second also 1.28.1 (both using the Oct 9 Python extension) – its not as clear – playing around I got my current running script using the Python Debug Console – stills have Powershell but its not the active terminal. Likely 12 hours away from that running script terminating – but will confirm things running with Powershell. But on machine 1 if I start with powershell as terminal as soon as I hit f5 to run script terminal switches to Python Debug Console.
I just went into json settings on the first machine – removed the disable auto-activation and its broken again. Press F5 and I get this output in the terminal – followed in 20-30 seconds with the timeout dialog.
Put disable back into json settings – and back to working.
To break it after removing I did need to unload and reload VS Code. To fix it, just needed to make the json change and save.
Jim
Sent from Mail for Windows 10
From: Don Jayamanne
Sent: Friday, October 12, 2018 11:02 AM
To: Microsoft/vscode-python
Cc: PCJimmmy; Mention
Subject: Re: [Microsoft/vscode-python] Python Timeout waiting for debuggerconnection when using Anaconda (#2732)
@elfayoumi @ninja-asa @jdobrzen @wpilgri @matvelloso @lorossee @matkoh @graywolfcorp @HughGrovesArup @F8F-Bearcat @ColombianViking @2Dews @conorfos @demo16
I'd like to rule out Powershell as the cause:
• Please could you ensure you have Powershell as your default shell in VSCode
• Next disable auto-activation of the terminal.
Go into settings.json and add the following setting:
"python.terminal.activateEnvironment": false
• Try debugging once again
Please let me know whether this fix alone works.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
This comment has been minimized.
This comment has been minimized.
Yes, only by disabling the auto-activation of the environment I stop getting the error aforementioned "Timeout waiting for debugger connection"
|
Same settings as @ninja-asa work for me |
Nope just went back to 1.27.2 |
I can get debugger and everything fine if I change my python interpreter to something else other than any of conda environments |
We believe there are two issues going on (PowerShell not activating fast enough under conda to get the debug command, and a potential issue related to the Windows 10 October 2018 release regardless of environment activation), and due to the amount of comments here it has become hard for us to tell what configurations are leading to failures. If people can provide the following it would be really helpful:
A massive thanks to anyone able to provide details regarding this!
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Brett
Two machines – both showing identical response – both running a long script that I don’t want to kill at the present. Both have been running VS pretty continuously for the last couple weeks.
#1 – had the issue with this one first. It was standard Win 1803 when it occurred – submitted a issue a couple of days ago that was closed too quickly in my view – I have since done a full clean install completed last night including a full fresh conda and python install. Not sure what level of VS or extension I was at when it first went bad. I made a big mess of it trying to fix which lead to the decision to fresh install. Simple refresh did not work as all the Anaconda stuff part of my user files, which were retained in a refresh. Full clean install taken to wipe all of that out. I did nothing on either machine with regards to the terminal type – always been default powershell.
1.28.1 2018.9.0 Windows 10 1803 Python 3.7.0 conda 4.5.11 ‘false’ - works like a charm.
- default No entry following clean install it did not work.
- removed the false line – no longer works after a reload of VS – until than its OK
- add false back in – works fine again without the need to reload VS
#2 – issue just arose yesterday after I did a reboot. Can’t recall the last previous reboot. This machine on Win 10 fast track and has had 1809 since 9/15/2018 OS build 17758.1 So for my machines the issue has nothing to do with the October release of Win 10 and everything to do with the VS and extension updates.
1.28.0 2018.9.0 Win 10 1809 Python 3.6.5 conda 4.5.11 ‘false’ – works like a charm.
Sent from Mail for Windows 10
From: Brett Cannon
Sent: Friday, October 12, 2018 12:26 PM
To: Microsoft/vscode-python
Cc: PCJimmmy; Mention
Subject: Re: [Microsoft/vscode-python] Timeout waiting for debugger connectionwhen using Windows PowerShell (#2732)
We believe there are two issues going on (PowerShell not activating fast enough under conda to get the debug command, and a potential issue related to the Windows 10 October 2018 release regardless of environment activation), and due to the amount of comments here it has become hard for us to tell what configurations are leading to failures. If people can provide the following it would be really helpful:
1. The information listed in the table below (I will update it as people's responses come in)
2. A screenshot of the failure (please try to capture your status bar so we can see the Python details as well as the terminal output)
A massive thanks to anyone able to provide details regarding this!
VS Code version
Python extension version
Windows 10 version ("About your PC")
PowerShell version (`$PSVersionTable.PSVersion`)
Python version
Python environment
Environment activation (`"python.terminal.activateEnvironment"`)
Debugging works
1.28.1
2018.9.0
Windows 10 1803
PS 5.1 17134
Python 3.7.0
venv
`true`
Y
1.28.1
2018.9.0
Windows 10 1803
PS 5.1 17134
Python 3.7.0
conda 4.5.11
`false`
Y
1.28.1
2018.9.0
Windows 10 1803
PS 5.1 17134
Python 3.7.0
conda 4.5.11
`true`
**N**
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Please could you try running a new simple script such as |
Same issues repeated on 3 different PC. All the configuration are all the same as below:
|
Thanks to everyone for the help! We're fairly certain we have eliminated the Windows 10 October 2018 worry and corroborated that this is all because our hack around conda's lack of PowerShell support just isn't robust enough based on the APIs that VS Code provides us. We are going to get a fix out that will let you know that conda + PowerShell are not a good combination for debugging (conda should have the support necessary in conda 4.6). We will also make it easy to switch your terminal over to command prompt so that you can still debug with an activated conda environment. Otherwise you can disable environment activation and stick with PowerShell if you prefer while still being able to debug. |
just open the lauch.json file and add the following configuration:
When you specify "none" for the console, it will run the debugger in the debugger console instead of running in the internal or external terminal. |
@Beta3-Data yes, but it won't activate your conda environment either which many people want/expect. |
just did this and issue continues, I have set two things am I the only one with the issue, please I see others have closed it. |
@srirambm if you are using conda w/ PowerShell then either don't use conda or switch to Command Prompt. If you're not using conda w/ PowerShel then you have a different issue. |
Environment data
Actual behavior
with a simple hello world - click on debugger selection and green run debug symbol, timeout occurs waiting for debugger connection
Expected behavior
Expecting debugger to connect
Steps to reproduce:
Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Output from
Console
under theDeveloper Tools
panel (toggle Developer Tools on underHelp
)OK, opening the ticket, as Brett suggested was a good idea. I had no idea this was the way to get a error message to trigger off of. I searched the error and found a similar issue. There were several questions there which I will answer here.
Conda install location: C:\PyAna2
.vscode/settings.json, what is python.pythonPath value? I find no settings.json file there, extensions only
Conda env list:
(pandas36) C:\Users\Free Agent>conda env list
conda environments:
base C:\PyAna2
pandas36 * C:\PyAna2\envs\pandas36
pdf27 C:\PyAna2\envs\pdf27
Path:
(pandas36) C:\Users\Free Agent>path
PATH=C:\PyAna2\envs\pandas36;C:\PyAna2\envs\pandas36\Library\mingw-w64\bin;C:\PyAna2\envs\pandas36\Library\usr\bin;C:\PyAna2\envs\pandas36\Library\bin;C:\PyAna2\envs\pandas36\Scripts;C:\PyAna2\envs\pandas36\bin;C:\PyAna2;C:\PyAna2\Library\mingw-w64\bin;C:\PyAna2\Library\usr\bin;C:\PyAna2\Library\bin;C:\PyAna2\Scripts;C:\PyAna2\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\HashiCorp\Vagrant\bin;C:\Program Files\PuTTY;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Git\cmd;C:\Users\Free Agent\AppData\Local\Microsoft\WindowsApps;C:\Users\Free Agent\AppData\Local\GitHubDesktop\bin;C:\Users\Free Agent\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64;C:\Users\Free Agent\AppData\Local\Microsoft\WindowsApps;
So looks like I should start with the fact there is no settings.json file in .vscode?
I also don't have "conda" on the path, though I do have the conda environments on the path.
The text was updated successfully, but these errors were encountered: