Skip to content
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

VS Code instance freezes after terminating vscode debugging session on javascript HttpTrigger function #1401

Closed
SDP190 opened this issue Jul 23, 2019 · 28 comments
Labels
Milestone

Comments

@SDP190
Copy link

SDP190 commented Jul 23, 2019

I have latest vscode version running on windows 10.
I am able to run Azure Functions locally on VS code using AzureFunctions ext. for VS Code, however when I run the debugger (F5) on my JavaScript Azure Function V2 (HttpTrigger), then when I stop it, very often it causes VS Code instance to crash and freeze.

Any help on this?

Its a standard project created with VS Code.

VS Code Info (Copied from About window):
Version: 1.36.1 (system setup)
Commit: 2213894ea0415ee8c85c5eea0d0ff81ecc191529
Date: 2019-07-08T22:59:35.033Z
Electron: 4.2.5
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.18362

Node.js Version:
node -v --> v10.15.3

@ejizba
Copy link
Contributor

ejizba commented Jul 23, 2019

@SDP190 What language is your project? Does it show any errors?

@SDP190
Copy link
Author

SDP190 commented Jul 23, 2019

@EricJizbaMSFT My language is JavaScript node.js
It happens when I click on this debuggers Disconnect button to stop the debugging session!
It does not show any errors!

@SDP190 SDP190 changed the title VS Code instance freezes when stopping vscode debugger VS Code instance freezes after terminating vscode debugging session on javascript function Jul 23, 2019
@ejizba
Copy link
Contributor

ejizba commented Jul 23, 2019

Is your project a standard project created from VS Code? If not - is it open source and can you share a link?

Also just to confirm - can you copy your exact VS Code version and your Node.js version

@SDP190
Copy link
Author

SDP190 commented Jul 23, 2019

@EricJizbaMSFT See original comment updated

@SDP190 SDP190 changed the title VS Code instance freezes after terminating vscode debugging session on javascript function VS Code instance freezes after terminating vscode debugging session on javascript HttpTrigger function Jul 23, 2019
@askpatrickw
Copy link
Contributor

askpatrickw commented Jul 24, 2019

I experience this intermittently as well with Python.
Standard project created with vscode.
I've just started using this extension so I have no previous experience to say its a change in behavior.

VS Code Version: 1.36.1 (user setup)
Commit: 2213894ea0415ee8c85c5eea0d0ff81ecc191529
Date: 2019-07-08T22:59:35.033Z
Electron: 4.2.5
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.18362

(.env) PS: github\project> python --version
Python 3.6.8

@ejizba
Copy link
Contributor

ejizba commented Jul 24, 2019

@SDP190 @askpatrickw If you can get concrete repro steps that would be great. I'm having a hard time repro-ing. That being said - I actually submitted a PR a little bit ago that might affect this experience: #1389 (The PR title says C#, but it should affect other languages as well)

If you have the time, please try out the latest build from master with these instructions and let me know if it helps: https://aka.ms/azCodeInsiders

@SDP190
Copy link
Author

SDP190 commented Jul 24, 2019

@EricJizbaMSFT, I cant tell you exactly what the problem is because it does not occur always I cannot pinpoint any cause, however what I can tell you is to play around with a HttpTrigger javascript function calling the the function with http calls multiple times (1 after another), also maybe try putting breakpoints in the code, then try 'Disconnect' the debugging session at various times during either when its in break mode either while it is running.

I will maybe try later minimizing my code to see if it maybe caused by my own code, (I use mssql npm package for sql connections, and also have multiple awaits, however I dont believe its related to this).

Also, I tried the latest build it did not solve the problem!

@askpatrickw
Copy link
Contributor

askpatrickw commented Jul 27, 2019

I have a very simple python function with an http binding for GET only. It returns a file from blob storage. The file is retrieved using the requests library and the url is put together with a url parmeter value placed in an f-string.

requests is the only thing in my requirements.txt

I can run my project, make a request. Stop the debugger and start it again and it will hang.
If I kill the terminal window it seems to prevent that.

I wonder if the other people who've observed this also have GET only binding or some other single HTTP Method.

@SDP190
Copy link
Author

SDP190 commented Jul 28, 2019

@askpatrickw, my HttpTrigger is configured for 'POST' only.

@ejizba ejizba added this to the 0.19.0 milestone Sep 19, 2019
@fiveisprime
Copy link
Member

I saw this while working with @sbatten. Seems to repro 100% for him if you want to get in touch with each other.

@ejizba
Copy link
Contributor

ejizba commented Oct 14, 2019

@SDP190 @askpatrickw @sbatten FYI we just released v0.19.0 of the extension. It has a new setting azureFunctions.stopFuncTaskPostDebug which you can set to false if you don't want us to stop the functions host after you stop debugging (which may be causing the crash).

Let us know if that helps. Also let us know if you still see a crash if you manually stop the functions host (either through ctrl-c or the trash can icon).

@twentytwokhz
Copy link

@EricJizbaMSFT This workaround seems to help. VS Code is no longer entering unresponsive state when debugging Azure functions.

@ejizba
Copy link
Contributor

ejizba commented Oct 24, 2019

Awesome - are you manually stopping the func host task and does that work without crashing? Also what version of the func cli are you on?

@ejizba ejizba modified the milestones: 0.20.0, 0.21.0 Oct 29, 2019
@sevenam
Copy link

sevenam commented Nov 22, 2019

Seen the same problem with python on az cli v2.0.73 and multiple versions of vs code.
This seem to have fixed it for me too (not happened since I disabled this):

azureFunctions.stopFuncTaskPostDebug = false

Manually stopping it with ctrl-c has not caused any freezing yet either.

@jsacapdev
Copy link

This is happening for me consistently. My project is a Function developed on C#. A full sample project can be found here:

https://github.com/jsacapdev/steel.function

While adding "azureFunctions.stopFuncTaskPostDebug": false to settings.json this is not ideal as then the assemblies become locked on subsequent builds.

Build started 02/06/2020 07:31:55.
     1>Project "C:\git\steel.function\st.cfg.str.rbac.sln" on node 1 (Clean target(s)).
     1>ValidateSolutionConfiguration:
         Building solution configuration "Debug|Any CPU".
     1>Project "C:\git\steel.function\st.cfg.str.rbac.sln" (1) is building "C:\git\steel.function\src\ConfigFunctionApi\ConfigFunctionApi.csproj" (2) on node 1 (Clean target(s)).
     2>CoreClean:
         Deleting file "C:\git\steel.function\src\ConfigFunctionApi\bin\Debug\netcoreapp3.1\host.json".
         Deleting file "C:\git\steel.function\src\ConfigFunctionApi\bin\Debug\netcoreapp3.1\local.settings.json".
         Deleting file "C:\git\steel.function\src\ConfigFunctionApi\bin\Debug\netcoreapp3.1\ConfigFunctionApi.deps.json".
         Deleting file "C:\git\steel.function\src\ConfigFunctionApi\bin\Debug\netcoreapp3.1\bin\ConfigFunctionApi.dll".
     2>C:\Program Files\dotnet\sdk\3.1.300\Microsoft.Common.CurrentVersion.targets(5148,5): warning MSB3061: Unable to delete file "C:\git\steel.function\src\ConfigFunctionApi\bin\Debug\netcoreapp3.1\bin\ConfigFunctionApi.dll". Access to the path 'C:\git\steel.function\src\ConfigFunctionApi\bin\Debug\netcoreapp3.1\bin\ConfigFunctionApi.dll' is denied. [C:\git\steel.function\src\ConfigFunctionApi\ConfigFunctionApi.csproj]
         Deleting file "C:\git\steel.function\src\ConfigFunctionApi\bin\Debug\netcoreapp3.1\bin\Microsoft.ApplicationInsights.dll".
         Deleting file "C:\git\steel.function\src\ConfigFunctionApi\bin\Debug\netcoreapp3.1\bin\Microsoft.Azure.Functions.Extensions.dll".

This development experience is less than ideal.

I am getting the same experience on insiders.

Please let me know if there is anything else, I can provide to help diagnose this issue. My machine is a Surface Book 2 running Windows 10.

@ejizba
Copy link
Contributor

ejizba commented Jun 2, 2020

@jsacapdev what version of the func cli do you have? Are you on Windows 10 Home or Pro?

Also can you go to the "About" thing for VS Code and copy all the versions from there

@jsacapdev
Copy link

@EricJizbaMSFT i believe i have the following version of the cli (let me know if this is not correct):

PS C:\> func --version
3.0.2534

I am on Windows 10 Pro 1909 (Version 10.0.18363 Build 18363).

VS Code:

Version: 1.45.1 (user setup)
Commit: 5763d909d5f12fe19f215cbfdd29a91c0fa9208a
Date: 2020-05-14T08:27:35.169Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18363

Insiders:

Version: 1.46.0-insider (user setup)
Commit: 2c1871d538c64df71af4902deba47d7fa4b53f27
Date: 2020-06-01T10:34:11.096Z
Electron: 7.3.0
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18363

@cloudappsguy
Copy link

Hi @EricJizbaMSFT - I have the same problem as @jsacapdev:

Running an Azure Function App (C#) locally, in debug mode. Set some break points. Call the local FA via Postman a time or three.

Then, attempting to stop debugging via disconnecting, the UI freezes and eventually (10-20 seconds later) VSCode pops a window stating the environment is non responsive and asks if I want to restart it.

Function App version:
3.0.2630

VS Code:

Version: 1.47.3 (user setup)
Commit: 91899dcef7b8110878ea59626991a18c8a6a1b3e
Date: 2020-07-23T13:12:49.994Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18363

Happy to provide any other details needed.

@bijeebuss
Copy link

any updates on this. I having the same issue with a C# function app with a timer trigger

@pacorreia
Copy link

pacorreia commented Sep 23, 2020

same thing here, this as started with latest azure function core tools, but might be coincidence.

The fact is, Ctrl+C is the way to avoid the issue

@bijeebuss
Copy link

mine doesn't freeze as long as I kill it with ctrl-c in the terminal window

@stefanushinardi
Copy link

@EricJizbaMSFT, is there any update to this investigation? thanks

@erharvey
Copy link

erharvey commented Oct 4, 2020

Exact same issue on me side with the latest core tools. CTRL-C in the terminal is the only way to not freeze vcode.

@songyang-dev
Copy link

I'm experiencing this issue from time to time on Python debugger as well.

@prkhandelwal
Copy link

Experiencing the same issue with Python debugger

@pmillot
Copy link

pmillot commented Oct 26, 2020

Exact same issue here every time, with the latest versions of everything.

@mpriem
Copy link

mpriem commented Nov 16, 2020

Same issue here. latest builds of tools and client. Doesn't matter what language or architecture. Hangs on x32/x64 with JS/C#/PS. It happens less if you close the terminal once the function ends.

@ejizba ejizba modified the milestones: out of scope, 1.1.0 Dec 10, 2020
@ejizba
Copy link
Contributor

ejizba commented Dec 11, 2020

Okay folks just released v1.1.0 of the extension which should hopefully fix this issue. I'm going to go ahead and close it, but let me know if you're still having problems after updating. Hard to know for sure because I was never able to get a consistent repro

@ejizba ejizba closed this as completed Dec 11, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jan 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests