ASP Net core Https Request - https

I have a problem with my ASP .Net Core MVC application deployed on a Debian Environment.
Each time i try to make a HTTPS request, the application is killed and I have to restart it.
Did someone already have this problem ?
For information, a simple wget on the same URL is working in SSH.

Related

.NET 6 webapp returns 503 error on random intervals

I published a simple .NET 6.0 web app with user authentication on my IIS 10.0 web server hosted on Azure.
The application read and write data from a SQL Server 2017 database hosted on another machine on the same virtual network of the web server.
Everything works fine but after a while, even though nobody is using the app, it stop working and send Http Error 503 Service Unavailable and I have to restart it every time from the application pool.
I enabled tracing on the event log, but I don't receive any message explaining this.
These are the application settings:
IIS application settings
I tried to follow these advices but none of them worked:
IIS HTTP Error 503. The service is unavailable
503 “Service Unavailable” error for all apps after installing .NET Core 2.2 Runtime & Hosting Bundle for Windows
.Net core Service Unavailable after Publish to IIS
On the same web server I have other applications but this problem appears only on this one. None of the other apps is using .NET 6, most use .NET Framework 4.7/4.8 and another couple .NET Core 3.1.
I also tried to publish the application on Azure WebApp service and it has the same problem.
1. If you're deploying on IIS, we can install DebugDiag Tools and then use the DebugDiag collection to crawl the dump logs.
2. If you are using the azure app service, it is recommended to get dump in the azure portal.
My Suggestion
Enable Failed Request Tracing, and find which request will cause the Http 503.
Maybe this 503 is not a problem with the code, and it is possible to find some useful information in the log.
Check the EventViewer, try to find the useful info about the application.
Download the DebugDiag Tools, use debugdiag collection to collect the dump file when the issue occured, and use the debugdiag analysis to analyze the dump file and check the stacktrace.
My suggestion can't tell you the root cause directly, but it will help you to find it. You are also welcome to update the useful stacktrace information in the future, and there will be more people to help you.
I'm currently having the issue but using MySQL on a remote server.
Azure WebApp, Azure VM (IIS 10) and AWS EC2.
Http Error 503 Service Unavailable when the database connection timesout or fails to connect and the AppPool failed to restart.
No crashes when debugging in VS via console app.
I changed the hosting model to out-of-process and this solved the issue.
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="outofprocess">

FABRIC_E_TIMEOUT only on server?

I have a service fabric (on-premises) application written in .NET Framework 4.6.1 with one service with WebAPI using OWIN. When I make wrong request (bad uri) to api on local machine cluster it gives me 404 not found but when I deploy it to server and try same uri it takes some time and finally give FABRIC_E_TIMEOUT. I tried to add some custom IHttpControllerSelector and IHttpActionSelector like in this article https://dzone.com/articles/handling-http-404-error-aspnet but it was not helping. What can I do to make app on server work like on local cluster and return 404 immidiatelly?

Slow DotNetCore 2.0 MVC after publish to IIS

I have a Web Site that consumes two MVC web service. The entire project, both services and the web site were developed with dotnetCore 2.0 MVC and Angular
I am using VSCode for development. When I run in the VS Code debugger - (I guess that is Kestral?) Everything is great. The Web Site (AngularJS) calls to Service A, Service A makes a bunch of calls to Service B and everything is very snappy an responsive.
OK. Now I do "dotnet publish" and move the output to be hosted in IIS. Everything works the calls all execute successfully. However, the calls from Service A to service B take several seconds each. Where in the DEV server they take just a few milliseconds on the PROD Server the same call takes several seconds.
If I call from the web site to the Service B the response is as expected - very snappy.
So, to summarize
- Service A calling Service B on a DEV server with VSCODE debugger running is very fast
- Service A calling Service B on a PROD server with a Published version of the project running behind IIS very slow
- Calling AJAX directly to service B is working great even on the Published IIS version.
Anyone have any idea what could be causing this. Or even where I could start to debug the problem?
Thanks in advance.

Loadbalancing simple MVC3 app

I have a simple MVC3 app in .NET 4.0 framework which does not use sessions. It uses windows integration (AD groups) for authentication. It is deployed on 2 servers (both Windows 2003 and IIS 6). To get MVC3 to work under IIS 6 I have a workaround wherein I added a wildcard map. The app works fine on both the machines when I access them directly.
I would like to use a HW load balancer so that I can rotate between both the servers seamlessly. And since my app does not have any sessions this should be fairly easy (I hope). What I would like to do is make sure the app is running on the server before LB sends the request to that app. It could be as simple as checking if keepalive.htm file exists in that app. Since the number of users for this particular app is very low I do not want to device a very complicated solution. I tried implementing the keepalive solution but I keep getting 401 error. Even after I made the file readable by everyone and gave it anonymous access (so no authentication required) it still gives me the same error. I have a feeling that my workaround to get MVC3 to work for IIS 6 is getting in the way.
Any ideas on how to load balance a simple MVC3 app so that Loadbalancer can check if the app is up before forwarding the request?
Thanks for the help.

Will MVC2 application run on MVC3 host server?

I have application wirtten in MVC2. In the host server is installed MVC3 framework. Will my application run in this host server or I need to install also(or maybe instead) MVC2?
Thank you
You need to have ASP.NET MVC 2 installed on the server (System.Web.Mvc, V2.0.0.0 assembly). You can also bin-deploy ASP.NET MVC.

Resources