Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

AEM as cloud 500 page redirection issue

Avatar

Level 1

We recently migrated from AEM 6.5 to AEMasCloud and facing issue for 500 error page redirection. Our Solution is implemented as below and was working fine unless we switched to AEMasCloud.

1. In Dispatcher we have -

ErrorDocument 404 /en-US/404-page-path.html
ErrorDocument 500 /en-US/500-page-path.html

2. In AEM, we have a Component Model and sending error as depicted in below code. Requirement was to keep the URL same and display 500 page in case of any issue.


if
(!isAuthor) {
response.addHeader("x-aem-error-pass", "true");// added when migrated to cloud
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}

We are unable to understand why in Cloud, it is not respecting the dispatcher code written to redirect on basis of 500 error similar to how it was working earlier. Requirement is to show internal server error without changing the current URL.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

3 Replies

Avatar

Level 1

Thanks @arunpatidar 

Going through the details and will try this out. Will keep you posted.

Avatar

Level 1

Adding details for the community - 

As per logs analyzed, dispatcher is correctly 'trying' to load the 500 page internally. Whereas observed that somehow it is not  passing "x-aem-error-pass" in header. This one is necessary for the server to recognize the error page as per Adobe's documentation. 

We removed all the custom code and 500 error page and observed that OOB message was only coming as per image below-

GurjotSingh_0-1717830088417.png

Same is getting reproduces at Adobe's end and it being worked upon in backend.