3

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: enter image description here

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 SERVICE

Thread 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.

3

it depends on your Sitecore version. This was a known issue in the Sitecore 8.0/8.1 stack, where Solr had to be up and running in for a succesful start of your Sitecore application. At the moment that Solr would be offline, this wouldn't bring Sitecore down. I believe that this was fixed in Sitecore 8.2, where Sitecore can start with an offline Solr instance.

  • 1
    Interesting! that is pretty much the exact problem we are having. The solution will hopefully be upgraded to 8.2.x in the near future. Hopefully that fixes the issue. When I get a bit of time i will test this with a vanilla version of their current version of Sitecore and a newer version of Sitecore and see what happens. – j_r Aug 10 '17 at 23:07
  • 1
    I believe they fixed it in one of the latest versions – Bas Lijten Aug 15 '17 at 6:48
1

Even when Solr is not running, it looks for those cores in solr. So make sure you start Solr and make sure sitecore_analytics_index(and all other indeses like sitecore_master_index,sitecore_web_index) in the Solr cores. You can navigate to http://localhost:8983/solr/#(need Solr installed and running on local to navigate) and see if you can find the sitecore_analytics_index in the Core Selector. If you can not find it, you can add core using Add Core button as shown in screenshot below.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.