2

I'm trying to setup custom 500 page on SC 9.1

I'm following this procedure: https://www.geekhive.com/buzz/post/2017/08/a-complete-guide-to-configuring-friendly-error-pages-in-sitecore-part-2-500-pages/

I get this error:

enter image description here

Note that it seems like it's working but there is an error "...while executing the custom error page...".

My configuration is like this: enter image description here

NOTES:

  • In order to test the 500 page, I am turning off the SQL Server Windows Service.
  • The <customErrors> node is in the <system.web> node of the web.config
  • I switched from using a .aspx file to a .html file to simplify things.. same error though.

Anyone seen this before?

  • Can you test by throwing an error on a component instead? I'm not positive if sql outages/failed connection strings are caught properly. – jrap Jul 18 '19 at 14:40
  • I have separate 500 error handling at the component level such that the page will still render. – sitecorepm Jul 18 '19 at 14:51
  • To test the 500.html logic though, can you intentionally throw an error? – jrap Jul 18 '19 at 15:14
  • Okay. I re-enabled SQL Server and added an explicit exception in a ServicesConfigurator. I get the same error page/message. – sitecorepm Jul 18 '19 at 15:39
  • Try removing the runat="server" from the 500.html <head> – Matt Connolly Jul 18 '19 at 17:30
4

I worked with @sitecorepm on Slack to run a few tests.

Why It Fails

If Sitecore has not been previously initialized the custom error page will not appear.

Failed Test Using Habitat 9.1.0

  1. Stop SQL Server
  2. Reset IIS
  3. View site

You will receive the generic IIS Runtime Error page, even with <customErrors> set to "On".

Habitat 910 Runtime Error

Successful Test Using Habitat 9.1.0

  1. Start SQL Server
  2. Reset IIS (optional)
  3. View site (it should come up successfully, at this point Sitecore has the connection data it needs)
  4. Stop SQL Server
  5. View site

You will now receive the custom 500 error page.

Habitat 910 Custom Error

Further Note About Breaking Connection Strings

I also tested the intentional change of a connection string- by changing the password to an incorrect value, for example. This change still results in the generic Runtime Error being displayed. In other words, it is not accounted for in this answer.

| improve this answer | |
  • 1
    I have submitted a ticket to Sitecore for a resolution to this issue. Thanks for taking the time to help troubleshoot this! – sitecorepm Jul 19 '19 at 16:35

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.