0

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. 
coding-dude.com
  • 758
  • 1
  • 8
  • 27

1 Answers1

1

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.

Parvez Mulla
  • 526
  • 4
  • 7
  • thank you so much, I will contact the service provider with this new info and get back to you – coding-dude.com Apr 12 '18 at 13:56
  • I did not find a solution for this yet, however I marked the answers as accepted as I feel that this is the way to investigate. Thank you again! Can I ask you more questions if the results from the hosting provider gets me into complicated stuff? – coding-dude.com Apr 12 '18 at 19:03
  • Absolutely ! Feel free to reach out :) – Parvez Mulla Apr 14 '18 at 01:10
  • This took a while, but finally the system logs show that: "A worker process with process id of '36624' serving application pool 'mydomain.com(domain)(4.0)(pool)' has requested a recycle because it reached its virtual memory limit". This indicates probably a memory leak or I hope that it's because I'm using "OutputCache" on my pages. I've now set Do you think this should help? – coding-dude.com Apr 15 '18 at 05:12
  • This could be one of the issues. The reason I say that is because in your case, the application pool stops and does not recycle. An application pool recycle will change the pid of w3wp process but will continue to serve requests and not throw a 503 service unavailable. However, unless there is a possibilty that virtual memory spiked up instantly 5 times within 5 minutes. I highly doubt this would have happened. So bottom line - get a dump of w3wp process. That's the best way to find out the root cause here – Parvez Mulla Apr 15 '18 at 16:31
  • I have tried to track down the memory leaks, if you are interested https://stackoverflow.com/questions/49850594/asp-net-web-application-memory-leaks-profiler-shows-a-lot-of-strings – coding-dude.com Apr 16 '18 at 06:11
  • just fyi, setting EnableViewState="false" on several controls included on all pages fixed the problems, the application pool no longer hits the virtual memory limitation, thank you again for your help! – coding-dude.com Apr 17 '18 at 14:07
  • Excellent ! no problem :) – Parvez Mulla Apr 18 '18 at 16:59