Rick Strahl's Weblog  

Wind, waves, code and everything in between...
.NET • C# • Markdown • WPF • All Things Web
Contact   •   Articles   •   Products   •   Support   •   Advertise
Sponsored by:
West Wind WebSurge - Rest Client and Http Load Testing for Windows

503 Service Unavailable in IIS 7 - watch those Application Pools


:P
On this page:

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.

Posted in IIS  

The Voices of Reason


 

# DotNetSlackers: 503 Service Unavailable in IIS 7 - watch those Application Pools


François Ligouy
January 05, 2007

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

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.

Greg Abernethy
February 20, 2007

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

Excellent. Solved my problems immediately.

cheers
greg

Rick Strahl's Web Log
May 27, 2007

# IIS 7 and Rapid Fail Protection - Rick Strahl's Web Log

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.

Matt Anthony
May 29, 2007

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

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.

AliM
December 03, 2007

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

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,

Hans Wuest
July 08, 2008

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

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.

Doug Wetzel
February 27, 2009

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

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.

steve
December 08, 2009

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

It solved my problem. Many thanks.

Steve

Srini
January 30, 2010

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

Hurray..!!! it solved my issue. Thank u so much... :)

Srini

nishant
February 02, 2010

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

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....

student
March 22, 2010

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

Thanks

sam
March 24, 2010

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

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

'HTTP Error 503. The service is unavailable' message in IIS7

Rajesh
June 10, 2010

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

IT solved My Issue.... Thank You Very Much!..

Stuart
June 11, 2010

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

Thanks Rick! I had the same problem and it would have taken me ages to figure this out by myself.

Woody
June 21, 2010

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

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.

Woody
June 22, 2010

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

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.

Kayzad
July 07, 2010

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

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.

Sarika
September 21, 2010

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

Thanks Rick! I was facing same issue and it would have taken me long to find it out.

Michael
September 29, 2010

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

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!

Pradeep
December 27, 2010

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

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.

Gbenga
December 30, 2010

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

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.

Glory to The Lord
January 07, 2011

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

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!!!

Marc
January 10, 2011

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools


Ol'SureHand
February 14, 2011

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

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.

Mark Allread
September 17, 2012

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

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.

Ghostwolf
October 07, 2013

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

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.

Z Fourn
May 08, 2014

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

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

Vincent Wansink
May 11, 2014

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

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.

Roy
September 29, 2015

# re: 503 Service Unavailable in IIS 7 - watch those Application Pools

Thanks Maui for your greatful post.
I also refer very helpful and useful article about Solving IIS 7 Error 503 Service Unavailable
Visit this helpful article
http://www.mindstick.com/Articles/c7eb99f0-5876-43ad-9ece-f8f633ebdb74/Solving%20IIS%207%20Error%20503%20Service%20Unavailable#.VgqHHJc0Xcc
http://forums.iis.net/t/1183179.aspx?Service+Unavailable+HTTP+Error+503+The+service+is+unavailable+

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