-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Microsoft.AspNetCore.Hosting throws Startup assembly StartupBootstrapper failed to execute #14547
Comments
This happens when the |
BTW is your application self contained? |
I tried reading https://github.com/microsoft/ApplicationInsights-Home/issues/231 and the attached issue #5919. It is unclear what exactly resolved the issue -- and if in fact the issue was resolved in those cases. Yes, my application is self-contained, here's the config: Done (and desired) by me, manually:
I didn't want to go into Azure Portal and keep updating extensions there, so I haven't installed the .NET Core 3.0 Site Extension -- this is why I have it deployed in SCD mode. |
Unfortunately right now, the site extensions do not work with self contained deployments. You'll need to add the Application Insights SDK manually to get it working.
I think you'd need to remove the site extension to prevent it from throwing at startup. |
The only Site Extension present on this app service (as per App Service > Extensions blade on the portal is Could you clarify what you mean by "You'll need to add the Application Insights SDK manually" ? I have installed it from within the Visual Studio IDE. |
OK I spent some time looking into this and you can't get rid of this exception today if the application is self contained. The feature being used to inject application insights into the application always fails on startup (because of a limitation in the current design). The only way to get rid of it today is to do a framework dependent deployment by either waiting for 3.0 to be installed on app service or by using the ASP.NET Core runtime site extension. I'll keep this issue open and assign it to myself as it's something we need to solve. |
Thanks @davidfowl. Strange thing is, the Application Insights seems to be working fine. I see the traffic, exceptions and everything else as I normally should. This means App Insights is still being loaded? |
Yes, it works fine but it'll still try to load some other pieces of code at startup and always fail. |
Tangential question - Is there a way to simulate how an self-contained deployment would work in a local (laptop/PC) environment? |
What do you mean exactly? You can self contain publish and then run the published application locally? Is there something more you were looking for? |
Let's say you need to troubleshoot a problem (like the topic of this assembly load). You'd need an environment that mimics it right? So how would you mimic an SCD environment? When I publish and run an SCD application locally, the runtime is already present globally because of my primary .NET Core installation. |
Its doesnt matter if the runtime is already present globally it won't be used. The application produced has no ties to the globally installed runtime. |
What's the action you want to take here @davidfowl ? |
We're working with the App insights team on resolving this for 3.0. |
Ok, so at the moment there is no action on our side. I'll leave this open to track that work though. |
Any update or issue tracking this @davidfowl ? Can you loop me in on conversations related to this? |
I'm facing the same issue after upgrading our web app from 2.1 to 3.0. However, it is not self-contained. Shall I open a new issue for that case? |
This is likely part of #15381 (the issue refers to 5.0 but there's a 3.0 problem as well). |
Note, this is reproducible in Core 3.1. |
We're seeing this issue on Azure App Service Windows Servers + .NET Core 3.1 + FDD (not SCD as above). The same app deployed to Azure App Service Linux Containers + .NET Core 3.1 + FDD does not have this issue. There is also another immediate log entry related to What's the timeline to resolution? It's holding up our production migration to 3.1 since it's LTS.
|
What's holding up anything? The application should still be working. Is that not the case? |
@davidfowl To be honest, the application does bootup and we see it working fine under full load test. But we're also seeing some automatic restart every a 4-6 hours, under 0% load. This kills our <200 ms response time SLAs as cold restarts are clocking in at 45 seconds (haven't looked into ready2run optimizations yet). Back to attribution, logging shows only the following smoking guns:
We're not seeing any other log warn/critical/fatal messages from any other sub-system and components, hence the hesitation to go to production with azure app service (linux or windows), asp.net core 3.1 and appinsights till we can root cause and eliminate the app restarts. |
@SidShetye Perhaps the best thing for you to do here would be to engage Azure Support to dig deeper in to what's going on in your specific scenario. It sounds like you're hitting the same issue, but along with some other things (since this issue should not be blocking startup of the app nor causing swap usage limits to be exceeded). |
@anurse We already have an open Azure support ticket for the 3rd item. Of course, an ApplicationInsight release that resolving these errors/warnings would be great but till then we're running some tests over the weekend to have some data supporting/rejecting the idea that these are all related stability issues. |
I have fixed the
by uninstalling the Azure web app AI site extension as suggested here. I have also fixed the
by installing Also applied the advice from #15381 (comment) but not sure if it helped. Now the only issue i get is
which i can only fix by following the advice from #17370 (comment) which disables the profile and snapshot feature. Is it possible to have profile and snapshot features working without getting the " DiagnosticServices.HostingStartup failed to execute" exception message? I'm using framework dependant deployment from within visual studio publish screen and the app is .net core 3.1.0 64bit |
Just to confirm, the steps outlined by @flatproject worked - Thanks! Before arriving here, had to fix another issue in 3.1.1 with Microsoft.AspNetCore.Authentication.AzureAD.UI which was also crashing the app All in all, 5 or 6 issues to resolve to get to a working 3.1 app through VS publish. For this issue, specifically, I agree with the sentiment to reevaluate how these extensions affect the core service. At the minimum, if something goes wrong, they should not crash the entire app. |
@flatproject On a related note, if you're on Linux, it's probably a good idea to disable Application Insights' profiling and snapshot because we're seeing an unrecoverable memory leak from it. See microsoft/ApplicationInsights-dotnet#1678 |
@davidfowl Is the purpose of Seems like bad practice to include an entire binary ( |
@SidShetye The site extension enables the logging options in the azure portal for azure app service to work. The HostingStartup is a way to plug into the application startup process without that code having be in the application initially. Think of it as a plugin. There's a plugin that runs on app service to enable app service features. When it breaks it's because there's a version mismatch, that is, there's a newer version of .NET Core than the extension supports (this is what we're working on moving forward, extensions are tied to the .NET Core major minor version). You can enable the same feature by adding the package reference directly and calling the registration API (this is what the plugin package does) and why things work if you reference the package directly. |
+1 Azure app services adds many maybe well intented but overall counter productive things in the portal. |
I also had this mysterious "azure app svc Startup assembly Microsoft.AspNetCore.AzureAppServices.HostingStartup failed to execute" exception logged in App Insights, from Asp Net Core 2.1 on Windows, and was not able to make it go away with Self-Contained or Framework-Dependent. All the App Insights logging and TelemetryClient seemed to be working. I found this issue and suggestion to install this package ... I can confirm that installing NuGet package Microsoft.AspNetCore.AzureAppServices.HostingStartup stopped the logged entries. |
We also get this exception on every startup of our Azure app service. I just upgraded .NET 5.0 and it is still happening. What is the latest/recommended way of getting rid of this message. Are we really forced to install (We currently don't use Application Insights) |
Got the same issue when running a .NET 5 app in a docker container on azure app service. |
What's the TLDR? @davidfowl |
It's that this issue has nothing to do with ASP.NET Core and @shirhatti will talk to the app insights team |
Thanks for contacting us. |
I'm confused to where we should track this moving forward but I just wanted to say it's still happening for us, on .net 5.0. |
|
Closing as a duplicate of #34864 |
I see these errors logged on Azure (App Service) on every restart of the App Service:
Main message:
Stack trace:
Let me know what additional data I can collect for you that may help in fixing this issue.
The text was updated successfully, but these errors were encountered: