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.

14 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. This works absolutely well. thanks!

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

    ReplyDelete
  6. 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
  7. Just go me out of trouble as well.
    Thanks

    ReplyDelete
  8. 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
  9. You should get a medal of honor equivalent for posting the brilliant fix! It solved my issue. Thanks a lot!!

    ReplyDelete
  10. 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
  11. Thank you very much.
    it solved my problem :)

    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