Contact   •   Products   •   Search

Rick Strahl's Web Log

Wind, waves, code and everything in between...
ASP.NET • C# • HTML5 • JavaScript • AngularJs

503 Service Unavailable in IIS 7 - watch those Application Pools


I ran into a funky issue with an application on IIS 7 today on my development machine: One of my Web applications simply would not respond to requests and IIS was reporting a 503 Error – Service Unavailable. Oddly enough though the rest of my Web site was working just fine – just this one application/virtual wasn’t working.  So at first I tried the usual – restarting IIS with IISReset, to no avail.

 

After some back and forth with the management console it turns out in IIS 7 that IIS 7 has a confusing option when you create a new Application Pool that ask whether you want to start the Application Pool immediately. This is not real obvious – in IIS 6 there was no such option and the Application Pool started automatically when a virtual/application was accessed for the first time. So when it asks for Start Immediately it’s not clear if the worker process that hosts the Application Pool starts immediately, or what. As it turns out when you say No to that question the Application Pool requires manual starting up.

 

 

Notice that there’s a Stop icon next the selected application pool. When this is set the pool will not automatically start and hence you get the Service Unavailable error. I suppose it’d be nice if the error message would be a little clearer in saying that the host process is unavailable.

 

The setting can be set in the Advanced Settings of the Application Pool:

 


Voila, my service runs again.

I’m not sure why you would EVER want to have an Application Pool not start automatically.

Make Donation
Posted in IIS  


Feedback for this Post

 
# DotNetSlackers: 503 Service Unavailable in IIS 7 - watch those Application Pools
by DotNetSlackers Latest ASP.NET News December 05, 2006 @ 12:50am
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by François Ligouy January 05, 2007 @ 11:26am
A lot of thanks for this contribution of your's that gave me the clue to the problem that puzzled me for part of the afternoon.
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by Greg Abernethy February 20, 2007 @ 5:17pm
Excellent. Solved my problems immediately.

cheers
greg
# IIS 7 and Rapid Fail Protection - Rick Strahl's Web Log
by Rick Strahl's Web Log May 27, 2007 @ 4:52am
IIS 7 has a new default feature called Rapid Fail Protection which detects failures and if too many failures occur in a specified period shuts down an Application Pool. Useful feature, but a little unexpected if you don't know about it and are wondering why your Application Pool has just shut down and won't restart automatically.
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by Matt Anthony May 29, 2007 @ 9:52pm
I wonder if there is any way to "auto-start" and run some custom code in an Application Pool when IIS starts. Say to initialise some in memory shared business objects (or cached data).
Can't seem to find anything in the documentation.
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by AliM December 03, 2007 @ 5:25am
Hi,

Greetings...

I recieve the same error message on DefaultAppPool. initially its started, and when i try to browse default website configured under this default pool. i recieve the same error "HTTP Error 503. The service is unavailable." and DefaultAppPool is stopped...

when i check windows log.... i found following entries:
=> Application pool 'DefaultAppPool' is being automatically disabled due to a series of failures in the process(es) serving that application pool.
=> A process serving application pool 'DefaultAppPool' terminated unexpectedly. The process id was '4300'. The process exit code was '0xfffffffe'.


Please let me know how can i resolve this problem.
Thanks,
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by Hans Wuest July 08, 2008 @ 6:59am
Hi Rick
What would we normal guys do without all your advice and expertise.
I am in midst of setting up a website and going through the programming essentials because I do not want to use one of those WYSIWYG Website templates. By far no control over the site!

I've just installed and used the WampServer, set it's ports to 81, and wanted to use the IIS7 server again. That's when I ran into this Error 503. Incredible what one can find on the MS site; "excellent but not sufficient!" as Edward de Bono would say.

As a matter of fact: I do now have access to my localhost via IIS7 again.
Thanks a lot.
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by Doug Wetzel February 27, 2009 @ 8:30am
I am naming my first born after you. Many thanks.

We had 3 different app pools running and one didn't come back because it was set to "Don't Start Automatically".

You rock.
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by steve December 08, 2009 @ 10:58am
It solved my problem. Many thanks.

Steve
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by Srini January 30, 2010 @ 9:13am
Hurray..!!! it solved my issue. Thank u so much... :)

Srini
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by nishant February 02, 2010 @ 11:31am
Hi
I am on a shared hosting service. These days I am getting 503 error quite frequently. I am not able to know the exact reason. how could I Know the exact reason why it is happening?

I know about rapid fail protection which cause application pool to shut down for a particular number of error in a fixed time. but what type of error these can be for example these are not html errors obviously, not complilation error, then what type of errors/failures can cause application pool shutdown.
I have installed blog on my site and generaly when i view blog oages I get 503 error so what type of error/failure we could think of which can cause application pool to shutdown....
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by student March 22, 2010 @ 9:18am
Thanks
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by sam March 24, 2010 @ 4:46am
Thanks.It worked for me.Actually I changed my admin password recently,after that I got this error.You have saved my time.Thank you soooooooooooooo much.
# 'HTTP Error 503. The service is unavailable' message in IIS7
by I think, therefore I Code... April 06, 2010 @ 10:58am
'HTTP Error 503. The service is unavailable' message in IIS7
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by Rajesh June 10, 2010 @ 12:19am
IT solved My Issue.... Thank You Very Much!..
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by Stuart June 11, 2010 @ 7:40pm
Thanks Rick! I had the same problem and it would have taken me ages to figure this out by myself.
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by Woody June 21, 2010 @ 9:34am
I am having issues of IIS 7 giving random 503 errors on certain files.
I say it's random because each time I run the page, different files fail with that error.

I have installed Fiddler to see whether I can get a handle on the situation and at first thought it was an issue with the JQuery code being used but it also seems to reject some CSS files (again random ones) and sometimes rejects the ScriptResource.axd.

It is a .NET application running on Windows Server 2008 using IIS 7; The application works absolutely fine on our dev box which is IIS 6.
There are no other applications running on the server and I have checked your theory of the Application Pool and that is still up and running.

Hope someone has an idea of what is happening as I have been trying to figure it out for ages.

Woody.
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by Woody June 22, 2010 @ 3:41am
Addendum to my last post.

It was found that the problem was related to the Application Pool in one sense.
We are using a dual server system with a Load Balanced configuration and we switched off server 2 a few weeks ago for maintenance reasons.
However, although the problems have only just been found, apparently the Load Balancer was still trying to get some random pages from the server 2 application pool instead of directing all traffic to the server 1 application pool.
Obviously as the server 2 application pool wasn't available, this caused the 503 error...

Cheers,

Woody.
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by Kayzad July 07, 2010 @ 3:35am
I have also the same problem. I figured out that the problem is due to my installation of reporting server of Microsoft sql 2005 32bit to windows server 2008 64 bit. I have enabled 32 bit applications in default application pool and problem appeared. When is disable this feature problem goes away. but reporting server does not function. please help.
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by Sarika September 21, 2010 @ 6:49am
Thanks Rick! I was facing same issue and it would have taken me long to find it out.
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by Michael September 29, 2010 @ 8:36am
Hi Rick, have a situation for you :) Our IIS7 is failing with weeks/months in between occurrences. I tracked down errors in the event logs and found the "Application pool 'DefaultAppPool' is being automatically disabled due to a series of failures in the process(es) serving that application pool." and a few "A process serving application pool 'DefaultAppPool' terminated unexpectedly" before that. I tested and the DefaultAppPool was indeed causing the 503 error that wouldn't go away so at least I can restart it next time rather than the whole system. I came upon your page here. Thanks, very helpful! So how to fix the problem that keeps causing it mysteriously with long periods in between failures? I see other issues in the event logs around the same time and see several "Faulting application name: w3wp.exe" and "Fault bucket , type 0, Event Name: APPCRASH, Response: Not available, Cab Id: 0, Problem signature:P1: w3wp.exe" in the Application Log. So I think it's the Application crash scenario mentioned here - http://mvolo.com/blogs/serverside/archive/2006/10/19/Where-did-my-IIS7-server-go_3F00_-Troubleshooting-_2200_service-unavailable_2200_-errors.aspx. I look in the actual web server logs and just see a ton of requests for phpMyAdmin and the like (which we don't have) around that time. It seems like w3wp.exe is just crashing for no reason. So how do I prevent this in the future? Any suggestions? Thanks for any help!
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by Pradeep December 27, 2010 @ 7:48pm
Hi,

My apppools are running without any issues. Still I am getting this issue. I didnt found any information in Event Logs.

Please help me.

Regards,
Pradeep.
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by Gbenga December 30, 2010 @ 2:45am
Hi,
Thanks for this wonderful contribution. Who could have ever suspected that this is the cause of the HTTP 503 error as the error message was not suggestive.
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by Glory to The Lord January 07, 2011 @ 1:06pm
Check your IIS server's Event Viewer on why the app pool service doesn't stay on. For me (32bit) I was missing either:

-compdyn.dll
-validcfg.dll

In the C:\Windows\System32 folder.

Thanks! -Jesus is Good!!!
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by Marc January 10, 2011 @ 3:11pm
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by Ol'SureHand February 14, 2011 @ 8:03pm
Excellent-set me on the right path. Error 503 is also caused by the Enable 32 bit being set to False as it turns out.
My apps in ASP 2.0 are 32 bits so they generated this error when migrated. Set to Enable-True and restart the service ... WORKING.
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by Mark Allread September 17, 2012 @ 5:02am
Thanks for this page, solved my problem. For me, it turned out that I'd forgotten that I switched my app pool to use my own domain account rather than LocalSystem (for an unrelated reason). Then a couple of months later my domain password expired and I had to change it. Then I started getting the 503s until I updated the password in the app pool.
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by Ghostwolf October 07, 2013 @ 3:28am
Seven years later, and this post is STILL solving the problem!

On mine: the DefaultAppPool kept failing, until I changed its defaulted .NET Framework Version from v2.0 to v4.0, and enabled 32-bit applications.
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by Z Fourn May 08, 2014 @ 7:38am
I had this problem this morning. My app pool was starting, but then it stopped a little while after. Finally, I noticed the Identity of the app pool was set to my account and probably months ago before my password had to be updated. I updated the identity in advanced settings and the 503 error went away.

If your app pool is starting and then stopping very soon after, try updating the identity under advanced settings.

GL;HF
# re: 503 Service Unavailable in IIS 7 - watch those Application Pools
by Vincent Wansink May 11, 2014 @ 7:21pm
Wow. I almost had a heart attack today. Thank goodness this happened on a sunday when very few people use my site, but I was worried for Monday morning.

For me this started happening at the same time that my password expired, and because of a server hiccup I was unable to change my password and my host had to resync my password with some magic and I was able to at least access my server again.

However, because I was using my account as the identity on this application pool and my account/password was somehow weirded out application pool it kept stopping immediately after I would restart it. It was only when I changed the identity to default ApplicationPoolIdentity the problem went away.

I have a sneaking suspicion that if I change the password on my account and change the identity back to my own account it will be o.k.
 


West Wind  © Rick Strahl, West Wind Technologies, 2005 - 2014