Error handling in DXC

Vote:
 

Hi, I have activated the Error handling in Episerver CMS to "Activate for all". It is working correctly in my local environment, but it is not in INTEGRATION. I always get the error: "The page cannot be displayed because an internal server error has occurred."

Actual result:

Expected result:

Does anyone know how can I take advantage of this feature in DXC?

#219190
Mar 30, 2020 23:03
Vote:
 

Hi Francisco,

If you are using the Azure environment then try with the below setting in the web.config on the DXC environment.

<customErrors mode="Off"> </customErrors>
<applicationSettings globalErrorHandling="Off" ....>

Thanks,

Sanjay

#219198
Mar 31, 2020 7:26
Vote:
 

Hi Sanjay,

It did not work. I still see the standard message "The page cannot be displayed because an internal server error has occurred."

Regards.

#220563
Apr 02, 2020 19:31
Vote:
 

Hi Francisco

Have you also allowed "Detailed error messages for troubleshooting" for Everyone in Permissions for Functions? Your screenshots doesn't show.

#220583
Apr 03, 2020 6:04
Francisco Quintanilla - Apr 03, 2020 12:42
Hi Stefan,
Yes, I did. It still shows me the generic error "The page cannot be displayed because an internal server error has occurred.". It looks like the detail error message does not work on DXC.
Stefan Holm Olsen - Apr 03, 2020 16:27
I know that it works in DXC, having worked on sites where I could retrieve YSOD details in all DXC environments.
Do you have anything in Global.asax that overrides the error handling?
Francisco Quintanilla - Apr 03, 2020 16:36
I only have this code:
protected void Application_Error()
{
var ex = Server.GetLastError()?.GetBaseException();

Log.Error(string.Empty, ex);
}

It's weird because the error message is working properly on my local environment.
Stefan Holm Olsen - Apr 03, 2020 16:46
What if you remove that method? In DXC you won't need it anyway, since Application Insights automatically logs unhandled exceptions from it's HTTP Module.
Vote:
 

Hi Francisco,

You need to trace the error log on the Azure portal. Please follow the below steps and try to investigate.

  • Login to Azure Portal
  • Goto--> App Service
    • MONITORING 
      •  Diagnostics logs
        • Application Logging (ON) --> Information (Choose level)  --> SAVE
        • Detailed error message (ON) --> Save
      • Log stream
        • Application logs (loading...)
        • Maybe need to refresh site URL to trace the Application log if shows loading...
        • Copy the generated text, save as HTML and the run on the browser window.

Hopefully, you will get the actual error and then fix it.

#220681
Apr 03, 2020 7:52
Francisco Quintanilla - Apr 03, 2020 12:48
Hi Sanjay,
I threw the exception on purpose to validate the content of the error page on integration. I don't want to create a custom 500 error page. I just want to use what Episerver has out of the box.
Vote:
 

Hi Francisco,

What do you have configured for the web server? I mean section <system.webServer> <httpErrors> and there the errorMode attribute.

By default that is DetailedLocalOnly so you should set it to Detailed if you want to see detailed errors from server (in addition to setting the asp.net error handling in system.web customErrors mode="Off").

(and also check what you have in your config transforms for the environment you don't see detailed exceptions)

#220768
Edited, Apr 04, 2020 7:05
Francisco Quintanilla - Apr 06, 2020 15:30
Hi Antti,
I have changed the configuration according to what you said, but I am still not able to see the custom Episerver error page. This is my configuration:



Now I see something like:

HTTP Error 500.0 - Internal Server Error
The page cannot be displayed because an internal server error has occurred.
Vote:
 

I'm fairly certain that clicking in Admin Mode System Settings will only update one node's web.config file and should never be used other than to look at stuff.

#221254
Apr 15, 2020 20:38
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.