Azure / azure-functions-vs-build-sdk

MSBuild task for Azure Functions
MIT License
98 stars 65 forks source link

Function build hangs if COREHOST_TRACE=1 #604

Open vivlimmsft opened 1 year ago

vivlimmsft commented 1 year ago

If the environment variable COREHOST_TRACE is set to 1, building a function project hangs during the target _GenerateFunctionsPostBuild. The only way to stop it is to terminate msbuild.exe in Task Manager, when building in a terminal ctrl+c fails to actually stop it. The experience in VS is even worse, the build cannot be cancelled and blocks many actions including closing VS.

Removing COREHOST_TRACE or setting it to 0 seems to fix the issue. The hint I could find that this could have been causing the issue is this stackoverflow post: https://stackoverflow.com/a/66884272

264 seems to be related, but it's from 2018 and hasn't been touched since 2019.

I'm running Win10 and tried both Microsoft.NET.SDK.Functions 4.1.3 and Microsoft.Azure.Functions.Worker.Sdk 1.7.0, both inside VS and using msbuild /bl from powershell.

bhagyshricompany commented 1 year ago

Thanks for the update will check and update you soon

bhagyshricompany commented 1 year ago

The issue you are experiencing is likely caused by the COREHOST_TRACE environment variable being set to 1, which causes the build process to hang. This is a known issue, and the recommended solution is to remove the variable or set it to 0. This should resolve the issue and allow you to build your function project without any issues. Additionally, you can also try to use the latest version of the SDKs, as there may have been updates that have resolved this issue.

vivlimmsft commented 1 year ago

Yes, that's the workaround I already mentioned in my post. Is this the latest version of the Functions SDK? That's what I have installed.

Deadlocking the build indefinitely with no indication of what's wrong or how to fix it in the logs is a really bad experience.

bhagyshricompany commented 1 year ago

@vivlimmsft Deadlocking a build indefinitely with no indication of what is causing the issue or how to fix it in the logs can be a frustrating experience for developers. It can lead to wasted time and difficulty in identifying and resolving the problem. To improve this experience, it would be helpful to have detailed logs that provide information on what is causing the deadlock and possible solutions to fix it. Additionally, providing troubleshooting steps or documentation on how to handle similar issues in the future can help to mitigate the impact of future build deadlocks. youcan try with latest sdk and share the output

vivlimmsft commented 1 year ago

I said that I tried with 4.1.3, which is the newest SDK available on nuget.org. Is there somewhere else I can get a newer one? Exactly what feedback are you looking for from me?

Did you use a model to generate your last reply or did you seriously just rephrase my bug report back at me?

bhagyshricompany commented 1 year ago

@vivlimmsft what info I had I provided you and its already am started looking on that issue will update asap.

fabiocav commented 1 year ago

@vivlimmsft thank you for reporting. Flagging this for investigation and will reach out if we need any additional information.

@soninaren / @brettsam for awareness.