I'm trying to configure a 500 error page.h I have successfully done this for handling exceptions once the application is already up and running. However I'm having an issue where if Solr Or MongoDB are not running before your website starts up, then IIS cannot handle any configured 500 page. It will not even return any direct file system requests.
The Web.config looks like:
<httpErrors errorMode="Custom" existingResponse="Auto" >
<remove statusCode="404" />
<remove statusCode="500" />
<error statusCode="404" responseMode="File" path="404.html" />
<error statusCode="500" responseMode="File" path="500.html" />
</httpErrors>
</system.webServer>
<system.web>
<customErrors mode="On" defaultRedirect="~/404.aspx" redirectMode="ResponseRewrite">
<error statusCode="500" redirect="~/500.aspx" />
<error statusCode="404" redirect="~/404.aspx" />
</customErrors>
The browser receives the following output:
When looking in the windows event viewer I receive the following stack trace:
Process information: Process ID: 1592 Process name: w3wp.exe Account name: NT AUTHORITY\NETWORK SERVICE
Exception information: Exception type: HttpException Exception message: Connection error to search provider [Solr] : Unable to connect to [localhost:8983/solr], Core: [sitecore_analytics_index] at System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) at System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)
Connection error to search provider [Solr] : Unable to connect to [localhost:8983/solr], Core: [sitecore_analytics_index] at Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.Initialize() at Sitecore.ContentSearch.SolrProvider.SolrContentSearchManager.Initialize()
Request information: Request URL: localhost/ffg.js Request path: /ffg.js User host address: ::1 User:
Is authenticated: False Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICEThread information: Thread ID: 32 Thread account name: NT AUTHORITY\NETWORK SERVICE Is impersonating: False Stack trace: at System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) at System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)
I'm wondering if anyone is aware of what is going on here? If the application is running and any of these severs go down then it successfully handles the 500.aspx.