-
Notifications
You must be signed in to change notification settings - Fork 54
Local debugging in VS Code fails after app restart #538
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
Same here! |
This is happening to me @AnatoliB after upgrading to Core Tools Also nothing works at the debug prompt in the integrated console ( |
@EricJizbaMSFT Could you please help and confirm? You seemed very active recently in regards to debugging issues in VSCode (thanks for that!). |
Tried it out and I can repro on the latest func cli, but not on v3.0.2798. We changed (cc @pragnagopa) the message indicating when VS Code could attach the debugger to a debug-specific message ("Worker process started and initialized") that was supposed to be more reliable than the old/arbitrary message we were using ("Host lock lease acquired by instance ID"). I would guess this is a timing problem and for some reason the new message is printed too early for us to attach, but I have no idea how this PowerShell stuff works under the covers or what could be happening during the time between messages Here are two workarounds in the meantime:
|
@EricJizbaMSFT |
I will investigate and update the issue when I have more info. Thanks! |
These are great ideas. Please note though that debugging works fine once after VS Code start. After that, it is broken until VS Code restart. |
@AnatoliB in my case it fails every time, I think some others had the same. |
I can repro the issue. @EricJizbaMSFT - I verified core tools output with latest version. It does print new log message : Worker process started and initialized - When this message is printed - worker process is started and initialized with indexed functions. New Core tools version also added flag |
I agree it's not related to the verbosity changes. I think it has to do with the timing of when "Worker process started and initialized" is logged and when "Host lock lease acquired by instance ID." is logged. I was hoping someone familiar with the PowerShell worker could help identify what is happening between when those two messages are logged |
At this point, I don't know how the worker could influence this behavior. The "Worker process started and initialized" and "Host lock lease acquired by instance ID." messages are emitted by the host, not the worker. Also, please note that we might be dealing with two potentially separate issues here:
|
This might be local to me, I've been noticing console freezes in debugging in a lot of powershell places outside of functions they didn't normally happen before, I need to drop down to earlier powershell extension releases to verify. |
Just updating that this is still an issue and leads to an extremely poor debugging experience. Here's a twitter complaint: |
@JustinGrote In the middle of a long debugging session, I suddenly started getting an error on Host lock lease. I did two things to clear up the error: 1) Create new Function App from VS Code and migrate code to new app. 2) Remove ALL Vscode extensions except those needed for Azure Account, Axure Functions, Azure Resources, PowerShell, Remote-WSL. This cleared the original error - but now I cannot get the debugger to start on either BreakPoints or Wait-Debugger after triggering the specific function. As a result, I have NO debugging experience until I figure out the issue. |
Adding my five cents to this issue. I experience the same problem with the most recent versions of VS Code and the Azure functions extension. Restarting the debugging session breaks it with an error message "There is no process with the given ID". I must wait for 3-5 seconds until I can successfully restart debugging with F5. I just started with Azure Functions and this makes it cumbersome to develop. Versions:
|
This could be related to PowerShell/PowerShellEditorServices#1295. The original comment describes "sluggishness and dead locks" which is representative of the comments in this issue, right? See this comment for latest update and how this affects VS Code: PowerShell/PowerShellEditorServices#1295 (comment) It appears the (large) PR linked to that issue is actively being worked on: PowerShell/PowerShellEditorServices#1459 |
Repro steps:
Debug-Runspace: You cannot debug the default host Runspace using this cmdlet. To debug the default Runspace use the normal debugging commands from the host.
Further attempts to start the app fail with the same error, until VS Code is restarted.
The text was updated successfully, but these errors were encountered: