HTTP Error 500.30 - ASP.NET Core app failed to start - azure - azure

I am running a blazor wasm hosted project 6.0 and in development it perfectly works, but when I deploy/publish it to azure app, i get the following error
HTTP Error 500.30 - ASP.NET Core app failed to start
Common solutions to this issue:
The app failed to start
The app started but then stopped
The app started but threw an exception during startup
Troubleshooting steps:
Check the system event log for error messages
Enable logging the application process' stdout messages
Attach a debugger to the application process and inspect
For more information visit: https://go.microsoft.com/fwlink/?LinkID=2028265
How will I debug the issue? It says system event log, The application is hosted in azure. is there any mechanism to know the exact cause of the error?

to see the logs and analyse the exact cause of error when hosted in azure I did the following:
https://<yoursitename>.scm.azurewebsites.net/api/dump
this will give you an errorlog folder and you can analyse the exact cause of error.

Related

HTTP Error 502.5 - Process Failure after Deployed the .Net core to Azure appservice

I have recently upgraded my .Netcore webapi from 2.2 to 3.1 and deployed to azure app services.
Since then I got the below issue. I have reverted the release but still getting the same error.
I found few solutions for IIS but nothing for Azure app services .How to fix this?
[NEWEST]
Solution:
Reduce the version of Microsoft.Extensions.Configuration.Abstractions to 3.1.17 or 3.1.16.
Troubleshooting:
Try to find Microsoft.Extensions.Configuration.Abstractions on scm site.
I guess it don't include Microsoft.Extensions.Configuration.Abstractions package when deploy, so try to use below code in .csproj file. But it failed.
I try to find the reason on scm site, and I find it. On azure, .net core 3.1 just support the version of Microsoft.Extensions.Configuration.Abstractions are 3.1.17 and 3.1.16.
[PREVIOUS] The way to find the error logs
Judging from the error message, your webapp did not start. To solve the problem, we can only locate the error by querying the log.
You have the following two solutions to solve the problem. View the log:
Prerequisite: If you have successfully deployed the project before, please log in to the scm site to clean up all the files in the original wwwroot folder.
Plan 1:
Find the web.config file in the wwwroot folder and set stdoutLogEnabled="true".
You can refer to the following posts and github issues.
Azure Web App - Python: can't open file 'manage.py': [Errno 0] No error
How to enable stdoutLogEnabled=true when site is deployed with Run From Package
After add the settings in web.config, we can check the logs.
Plan 2:
Follow below picture, check Application Event Logs.
You also can refer my answer to Collect .NET Profiler Trace (Azure - Unhandled Exception: System.IO.FileNotFoundException).
After find the error, you can solve it quickly. If you also have some problem, you can create a new project without any sensitive info for us to reproduce your issues.

Azure slot swapping cause HTTP Error 500.30 - ANCM In-Process Start Failure

I've got an simple asp.net core 2.2 API. It is configured to deploy to azure as soon as we check-in into the master branch.
Azure devops release pipeline is configured to deploy it to an staging slot first. Then it does an smoke web test (by going to one end-point) and if that is successful then it swap the slot with production.
When the slot is swaped it does the same smoke web test (by going to the same end-point on production) to check if it still works. A lot of times i then get an HTTP Error 500.30 - ANCM In-Process Start Failure.
Deploying the same build again fixes this problem most of the times. But i cannot find any logs or details why this error occurds and how to fix this.
Any idea how to debug an HTTP Error 500.30 - ANCM In-Process Start Failure on a Azure Web App?
Turns out Azure has an internally known (I guess they are not eager to share the news about this) problem with 'Application Insights'.
So turn that feature off (if it's on), and see if it solves the issue. That step solved the problem for me.
I had the same error with an Azure ASP.Net Core 2.2 that was running fine for several weeks and suddenly started generating this error from Oct 15 to Oct 17.
Microsoft tech support folks tried to help for a couple of days but they couldn't figure out why the stdout logs were blank. Then, after 2 days, it turned out that it was a known problem on Microsoft's side and they promised to fix. Indeed, after about 8 hours the application started working again (no change or redeployment of the application on my side!).
I asked for an explanation but they told me it was too sensitive.
Today, after 2 weeks of working well, the same application is back to showing the same exact error: "HTTP Error 500.30 - ANCM In-Process Start Failure"
So, most likely, the problem is not in your code or deployment procedure. Instead, the problem is Azure (perhaps how they provision the .net core 2.2 runtime). But for some odd reason Microsoft is not willing to share the details of the problem with their user community (or permanently solve it). Very disappointing!

Failed to Listen on the Given Port .net core 2.0 IIS

I am trying to publish a .netcore 2.0 application to a remote web server and host it using IIS. I have a custom domain setup and want to run it as www.mysub.mydomain.com. It is a web api application.
I have published the app to the server and when I run dotnet on the project manually, it runs. It runs off of localhost:5000 when I do this, and when I navigate to it on the server it works properly.
The problem comes when I try to run it via IIS after binding www.mysub.mydomain.com to the location. I get a 502.5 Process Failure error in my browser.
When I check the Event Viewer, I see that it says "created process with commandline 'dotnet .\myproj.dll' but failed to listen on the given port '21159'"
Any ideas?

dotnet core IIS website restart on error (for example sql server reboot)

I'm currently facing the following problem when hosting a dotnet core application with IIS.
When the webserver boots before the database server, the dotnet-application throws an error that it is unable to connect to the database. So for so good offcourse.
But the problem is that when it faces this error on startup, it will never again try to connect to the database. The dotnet core application seems to be giving up when facing a startup error.
Is there some general re-try mechanism available to handle these kind of errors? So for example when the application detects a problem, to restart every 5 minutes?
I seem to have found the answer myself. It was during my startup-logic that I already was connecting to the sql database. I could simply force IIS to try to restart the process, until initialization worked out by explicitly shutting down the application using Environment.Exit(-1); whenever an error occured

Running Signalr in IIS on .Net Core - hub being hit but client sees 500 error

I have a .net core application deployed to IIS. There is a signalr hub in the application.
My problem is that when my client hits the hub it receives a 500 error back.
I have put logging in the hub and can see that it is being hit correctly and no exceptions are being thrown.
The setup works perfectly when run from Visual Studio.
I am thinking something might not be set up in IIS correctly.
Does anyone have any ideas that this might be?
I enabled the generic error page in the api and looking at the network tab in the browser I was able to see the call that signalr was making.
I looked at the content of this request and found that an error with the following message was being returned by the server...
The data protection operation was unsuccessful
After some searching I found that this was being caused due to a setting on the IIS application pool.
The steps to change the setting were...
Open IIS Manager
Select Applications Pools, and go ahead and select the App Pool used by your app
Right-click on it, and select Advanced Settings, Go to the Process Model Section and Find the “Load User Profile” Option and set it to True
These steps were taken from http://puresourcecode.com/dotnet/post/ASPNET-The-data-protection-operation-was-unsuccessful

Resources