Search code examples
asp.netiisweb-configforms-authentication

"Forms authentication failed for the request." causes 503 service unavailable in shared hosting


I'm close to desperate. My ASP NET website keeps crashing and I get 503 service unavailable.

I am using hostgator shared hosting. They say that the 503 error is triggered in IIS by the fact that the app gives more than X errors in a short amount of time.

I don't have direct access to the server logs, but what they've sent me looks like this:

Event code: 4005 
Event message: Forms authentication failed for the request. 
Event time: 4/11/2018 12:18:30 PM 
Event time (UTC): 4/11/2018 5:18:30 PM 
Event ID: 15efc898b8054a1e8aef9915b181307e 
Event sequence: 6 
Event occurrence: 1 
Event detail code: 0 

Application information: 
Application domain: /blah blah
Trust level: HG_Full 
Application Virtual Path: / 
Application Path: [somethingsomething]\httpdocs\ 


Process information: 
Process ID: 50012 


Request information: 
Request URL: [somethingsomething]/login.aspx
Request path: .../login.aspx 

I do use forms login on the website, but it never created any problems. What should I do?

Right now the only solution is that I call them and they reset the application pool which is very frustrating as I have to go through their call center.

I can't make the site give any visible error in the login page, no matter what I do.

I've already read other posts indicating that I can hide the error in the global.asax by clearing the error in application_error, but I have my doubts that this is the way to go

I also had authentication > forms timeout set very high, I now changed it to 30 minutes - not sure if that did anything since I can see that the cookie expiration date generated is 1969

please help!

here's the hosting provider description:

 Per the time stamps these errors are occurring in approximately one minute intervals. Please bear in mind that after a website has hard-crashed multiple times in close succession the Rapid Fail Protection feature of IIS will be triggered which monitors your site for hard-crashes, and if a certain number of errors occur in a certain amount of time then the site will be deactivated with a 503 error message in order to protect the stability of the server. If the site hard-errors more than 5 times in 5 minutes then the website is most likely malfunctioning, or exceeding its allocated resources in the shared environment, and will need to be reviewed by a developer to determine what aspect of the site is causing the application pool to crash. 

This is an intentional configuration of the server to help ensure that no single user impacts other shared users by causing resource exhaustion issues on the server. 

Solution

  • By default, if application pool crashes more than 5 times in 5 minutes, you will receive a 503 service unavailable error.

    Now important question here is to find out why the application pool is crashing. There could be multiple reasons for it and Forms authentication is definitely not one of them. Here is what you can do.

    1. Reach out to the service provider and request for "System" logs from Event Viewer during the time of issue. You will find either of the following error messages.

    A process serving application pool '%1' suffered a fatal communication error with the Windows Process Activation Service. The process id was '%2'. The data field contains the error number.

    A process serving application pool '%1' terminated unexpectedly. The process id was '%2'. The process exit code was '%3'.

    1. Once you identify that application pool is crashing, check with the hosting provider if you could set up a rule to capture a dump of the w3wp process. Analyzing the dump will tell you exactly what went wrong within the application.

    More details in setting up a crash rule here

    Let me know if you have any follow up questions.