Wednesday, July 20, 2011

One reason for “HTTP Error 503. The service is unavailable” in IIS

Recently I faced with interesting problem. I resume work over ASP.Net MVC application which I didn’t touch some time (I think all of us have such projects in the private SC repository). It is configured to use local IIS in web project settings in Visual Studio. However when I build and and run without changes IE showed me “Service Unavailable” error page (HTTP Error 503. The service is unavailable).

Site was running in IIS. Then I checked application pool for the web application – and it was stopped. Relaxing with the thought that problem is found I ran app pool and refresh the page. However I still get the same result: “Service Unavailable”. I checked app pool again – it was stopped. I tried to run it again and got the same result. IIS forced my app pool to stop each time when request went to the server.

A bit confusing, I checked event log and found interesting error record in System logs:

Application pool ASP.NET v4.0 has been disabled. Windows Process Activation Service (WAS) encountered a failure when it started a worker process to serve the application pool.

And couple of warnings – also interesting. The first was:

Application pool ASP.NET v4.0 has been disabled. Windows Process Activation Service (WAS) did not create a worker process to serve the application pool because the application pool identity is invalid.

And the second:

The identity of application pool ASP.NET v4.0 is invalid. The user name or password that is specified for the identity may be incorrect, or the user may not have batch logon rights. If the identity is not corrected, the application pool will be disabled when the application pool receives its first request.  If batch logon rights are causing the problem, the identity in the IIS configuration store must be changed after rights have been granted before Windows Process Activation Service (WAS) can retry the logon. If the identity remains invalid after the first request for the application pool is processed, the application pool will be disabled. The data field contains the error number.

And I remember that some time ago I changed password for account which was used for this app pool. It was the actual reason. I go to IIS manage > select app pool > Advanced settings > Identity > Click “…” > Click “Set…” button and specify new password. After it I started app pool again and refresh page in browser. Problem disappeared. Hope it will help someone.

16 comments:

  1. It was resolved my issue with this post .Thanks a lot to share this


    http://csharpektroncmssql.blogspot.com

    ReplyDelete
  2. Thanks a lot for the post. This was exactly the problem I'm facing. Thanks a lot again :)

    ReplyDelete
  3. Thanks for the post. It helped me resolve my issue.

    ReplyDelete
  4. Thanks I was stuck for an hour with the problem.

    ReplyDelete
  5. Had a similar issue. Had to create another app pool and offload the applications within the old pool to the new one, after I had set up the identity user name & password.

    ReplyDelete
  6. Just go me out of trouble as well.
    Thanks

    ReplyDelete
  7. This is a very good answer to a [common] problem. Question: if one changes the identity password (i.e. the Windows user password) then why doesn't the application pool fail immediately? Why does this problem occur many days/weeks down the line?

    ReplyDelete
  8. You should get a medal of honor equivalent for posting the brilliant fix! It solved my issue. Thanks a lot!!

    ReplyDelete
  9. Thanks a lot.
    It is a very good explanatory answer.
    This resolved my issue. I have been using TFS on a domain and the administrator asks to change password in every 45 days. I simply changed the password in the application pool and it started working!!
    Thanks

    ReplyDelete
  10. Thank you very much.
    it solved my problem :)

    ReplyDelete
  11. When trying to install a web site on my test machine (IIS Server) I got Error 503 Service Unavailable, after a long discussion with my seniors and searching on the Internet I found the solution to this problem. Thanks for sharing with us. Following links also helped me to complete my task.

    http://www.mindstick.com/Articles/c7eb99f0-5876-43ad-9ece-f8f633ebdb74/?Solving%20IIS%207%20Error%20503%20Service%20Unavailable

    http://social.technet.microsoft.com/Forums/windowsserver/en-US/acbe683b-dd3b-4b6f-8b28-d020ed02edfa/http-error-503-the-service-is-unavailable-with-iis-7

    ReplyDelete
  12. You saved my day!! Thank you very much!!

    ReplyDelete
  13. thank you, forgot about changing the password, and problem occured after reboot

    ReplyDelete