Sitecore 503 Service Unavailable Error Fix

Issue

Sitecore websites will not start after a server reboot. We faced this issue across all our environments and trying to figure out why would this happen. We didnt have deployments during that time and wierd issue was only sitecore sites broke not regular IIS sites.

Error Details

w3p.exe will stop after 5 tries and return 503 error when we try to browse the sitecore site.

All the logs ended with the following message

INFO HttpModule is being initialized

Analysis

We started looking into all possible logs started with event logs and noticed the app pool was crashing. Also we noticed the server facing issue had a restart after updates. We tried this on lower environments and proved the theory of after reboot the server starts failing. Checked for any patch updates that went through that time. There was a windows security patch that week but there were other servers even without the patch were failing. Next we tried to restore the server a week back and it started working. In parallel we also investigated the sitecore dump files and logs and nothing prominent.

Solution

Method 1

We found out that there was an update to the Microsoft SCOM agent (this does monitoring of the servers) and it is because of this update the app pools were crashing and would not start back up properly.

To resolve this issue the fix is to reinstall the agent with the switch NOAPM=1.

Once the update was re-installed, an IIS reset would allow the app pools to function normally. We then rebooted each of the servers and confirmed that each of the servers restarted successfully.

Method 2

The following is a common issue that might cause the issue. Ensure app pool account has access to the IIS folder also to the SSL Cert.

  1. Disable Antivirus temporary
  2. It is possible that some old\corrupted files are used.
  3. Try to clear .NET temporarily files in the following locations C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\
  4. Delete all temporarily or diagnistic files:

    \temp

    \App_Data\DeviceDetection

    \App_Data\diagnostics**

    \App_Data\logs

    https://stackoverflow.com/questions/16137457/asp-net-temporary-files-cleanup

Reference

https://docs.microsoft.com/en-us/troubleshoot/system-center/scom/apm-feature-causes-iis-application-pool-crash