HTTP Error 503. The service is unavailable. App pool stops on accessing website

299,579

Solution 1

One possible reason this might happen is that the Application Pool in IIS is configured to run under some custom account and this account either doesn't exist or a wrong password has been provided, or the password has been changed. Look at the advanced properties of the Application Pool in IIS for which account it uses.

Also the Event Log might contain more information as to why the Application Pool is stopping immediately on the first request.

enter image description here

Solution 2

Ok, I have another solution for one specific case: if you use WINDOWS 10, and you updated it recently (with Anniversary Update package) you need to follow the steps below:

  1. Check your Windows Event Viewer - press Win+R and type: eventvwr, then press ENTER.
  2. On the left side of Windows Event Viewer click on Windows Logs -> Application.
  3. Now you need to find some ERRORS for source IIS-W3SVC-WP in middle window.
  4. Probably you will see message like:

The Module DLL >>path-to-DLL<< failed to load. The data is the error.

  1. You have to go to Control Panel -> Program and Features and depending on which dll cannot be load you need to repair another module:
    • for rewrite.dll - find IIS URL Rewrite Module 2 and click Change->Repair
    • for aspnetcore.dll - find Microsoft .NET Core 1.0.0 - VS 2015 Tooling ... and click Change->Repair.
  2. Restart your computer.

Solution 3

For my situation is that my login password changed, while the application pool still uses the old one. So just click the "Advanced Settings" of your application pool and reset your "Identity".

Solution 4

I was facing the same problem, and debugged it using the event logs. First it said that : "The description for Event ID 5059 from source Microsoft-Windows-WAS cannot be found".

I then turned on WAS using turn windows features on/off. Then i saw this in eventvwr "Microsoft-Windows-DistributedCOM cannot be found".

Finally I gave up and deleted the App Pool (that used to stop on accessing the website) and created it again, as it is. This resolved the problem.

Solution 5

Most of Time, it was occured due to AppPool Setting.

Check the following to resolve this

  1. Check Apppool service is running.
  2. Check Identity of AppPool.
  3. Enter the new password if it has changed for that identity.

The following Images show these setting in IIS

enter image description here

Share:
299,579

Related videos on Youtube

Sandy
Author by

Sandy

Enthusiast in technology world and fascinated by new entrepreneurs. Strongly believe in innovation and creativity and looking forward to be a part of it.

Updated on March 10, 2022

Comments

  • Sandy
    Sandy about 2 years

    There are number of posts on this and I have tried many a things by now. But to no avail. Myself a Winforms Developer basically, started working on this Web stuff few days back as my company is taking Web initiatives.

    I have a ASP.Net project and I want to host it on local IIS. In Project properties -> Web settings I chose Use Local IIS Server and gave a url as localhost/MyApp. I tried accessing it on my firefox browser and received error as HTTP Error 503. The service is unavailable.

    Previously I got many other errors and I one by one fixed them all. But struck with this one. These are the settings I have in my project

    1. Application Pool set to ASP.Net v4.0 Classic
    2. App Pool Enable 32 bit Application property is true
    3. App Pool is started
    4. Project build property set to Any CPU for Target framework

    But I would like to mention a weird behavior. Following is something that I am facing

    1. Application Pool is Started
    2. I try to access my local website (by giving url as localhost/MyApp)
    3. I receive the error as HTTP Error 503. The service is unavailable
    4. Application Pool is Stopped

    I have seen following link and I have already tried it. For the above behavior I reached here. According to this link, Computer name should not have . in it. I don't have any . in my Computer name but do have - in it. Also my domain name contains . in it. Moreover I can't change these settings as its my office laptop and our TFS settings are bound to our Domain and Computer Names.

    Can anyone help me to understand whats happening? Please guide me. Thanks.

    Edit

    I have following code in Global.asax. Application_BeginRequest method is empty in same file.

    protected override void Application_Start(object sender, EventArgs e)
    {
        base.Application_Start(sender, e);
        String _path = String.Concat(System.AppDomain.CurrentDomain.RelativeSearchPath, ";",
                                             System.Environment.GetEnvironmentVariable("PATH"));
        System.Environment.SetEnvironmentVariable("PATH", _path, EnvironmentVariableTarget.Process);
        MyAppLog.Initialize();
        MyAppLog.WriteMessage("Application Started");
    }
    

    Update

    As per the suggestions in Comment, I am able to run the website from Cassini.

    • CodingIntrigue
      CodingIntrigue over 10 years
      Do you have any code in your Global.asax which runs on application start? Anything which might be getting stuck in a loop? You enabled Enable 32 bit Application but are you using any 32-bit only DLLs?
    • Simon Whitehead
      Simon Whitehead over 10 years
      What happens when you run it in Cassini?
    • Sandy
      Sandy over 10 years
      @RGraham: I have project build property set to Any CPU. So I think used dlls should not be a problem. Please see the edit for Global.asax code. Thanks
    • Sandy
      Sandy over 10 years
      @SimonWhitehead: No idea of whats Cassini is. I downloaded it now from cassinidev.codeplex.com. I can see some dlls and exe in downloaded files. Could you please help me how to use it? Meanwhile I will try to read on this issue from internet sources.
    • Sandy
      Sandy over 10 years
      @SimonWhitehead: I am able to run website from Cassini.
    • an phu
      an phu about 10 years
      check the substatus codes in the iis web log support.microsoft.com/kb/943891
  • teynon
    teynon over 9 years
    In my case, this was the issue. I had changed my Windows password and my local IIS for Windows 8.1 stopped working. I had to update each project in multiple places. In IIS 8, I had to update the credentials in the application pool by right clicking on the pool and clicking "Advanced settings -> Process Model -> Identity". I then had to update the Site itself by going to "Sites -> MySITE -> Advanced Settings -> Physical Path Credentials"
  • Sandy
    Sandy over 9 years
    I would agree that this happens quite often
  • drzaus
    drzaus over 8 years
    And if you happen to have a bunch of sites referencing the same app pool, you can use appcmd to batch-update them: appcmd list site /xml | appcmd set site /[path='/'].applicationPool:YOURNEWPOOL /in
  • Wolfgang
    Wolfgang over 8 years
    Even if the account exists and the password is correct, it may have been disabled; this would cause the same symptoms.
  • Anthony Horne
    Anthony Horne over 7 years
    Worked for me too. By upgrading from 2008 to 2012, the app pools were not entirely happy.
  • mihkov
    mihkov over 7 years
    Yes, That's the solution. My account password is changed very often. And I forgot to give the new password in the "Advanced settings"
  • Amr Elgarhy
    Amr Elgarhy over 7 years
    checking Event Log is the way to go, always helped me in these issues, last time i checked the event log and i found that it is a fail in loading the rewrite.dll in iis, I went to programs and features in control panel, repaired the installation, and everything went back normal.
  • AskYous
    AskYous over 6 years
    We had a recent password change. This was the solution. For others, see screenshot here: i.imgur.com/rp8bnGy.png
  • Gwasshoppa
    Gwasshoppa over 5 years
    Mine was the "Url Rewrite" that I uninstalled and then reinstalled. Because i got this error: "The Module DLL C:\WINDOWS\system32\inetsrv\rewrite.dll failed to load. The data is the error."
  • Yogi
    Yogi over 5 years
    This answer helped me troubleshoot a similar problem. "Service Unavailable" error fixed by removing Core 2.2 (repair alone did not fix). up vote.
  • Akhil
    Akhil about 5 years
    "an element IIS clearly dislikes" whats that specific element you have mentioned ??
  • ShaneC
    ShaneC about 5 years
    I made this post over 4 years ago. I am not sure what element was in the web.config but that is not the point. The app pool problem that the OP describes was happening to me and I was getting back these unhelpful error messages. The cause of the above was that I had put an incorrect entry into my site's web.config. (maybe with a spelling mistake or syntax error or section that IIS didn't recognise to be valid)
  • Ryan Tavan
    Ryan Tavan almost 5 years
    I would like to say you are a life saver. I spent a whole day on this. Thank you
  • phanf
    phanf over 4 years
    This fixed my issue which appeared after applying the following windows KB to our windows server 2008 R2 runing IIS 7.5. ### 2019-07 Security and Quality Rollup for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 for Windows 7 and Server 2008 R2 for x64 (KB4507420) More information: support.microsoft.com/kb/4507420 ###
  • THE JOATMON
    THE JOATMON over 4 years
    The accepted answer did not help. This did. Thanks!
  • Hamit YILDIRIM
    Hamit YILDIRIM over 4 years
    In my case application is working width Application Pool Identity with load user profile = true, and stoping 2 days later itself. I have changed it to the local service, i think it will corrected. But i dont know and couldnt understand why! ? :)
  • Mehdi Daustany
    Mehdi Daustany about 4 years
    great answer, the log show me The Module DLL C:\Windows\System32\inetsrv\compdyn.dll failed to load. The data is the error. so I install Dynamic Content Compression
  • David Refoua
    David Refoua almost 4 years
    For me, it was: The Module DLL C:\Windows\System32\inetsrv\iis_ssi.dll failed to load. The data is the error. So I installed Select Server Side Includes per this suggestion
  • Timothy C. Quinn
    Timothy C. Quinn over 3 years
    I wonder why CGI is required. I guess I have to dig into this. I excluded it from my config as I wanted to harden my IIS.
  • ruffin
    ruffin over 3 years
    For the braindead like me, it might be worth adding steps 1-7 in bullets. But then I'm braindead. Did I mention that?
  • Ozair Kafray
    Ozair Kafray about 3 years
    In my case my user was recently migrated from one domain to another, hence I faced this error.
  • Hammy
    Hammy almost 3 years
    The accepted answer did not help me either, but this one did, however, I only uninstalled the IIS URL Rewrite Module 2 and it worked...I did not repair it or reinstall it.
  • Harrison Boles
    Harrison Boles over 2 years
    This worked for me as well, but first I had to actually install the Web Platform Installer, which is located on the right-side of the panel, after doing that 'Web Platform Installer' showed up where you said it would.