Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

500 Error Redirect Page Issue

Avatar

Level 1

I'm following the ACS Commons method of redirecting my errors to our custom error-handling pages, and the redirect is happening. On my local machine, I am purposely throwing a 500 error by misspelling a sightly attribute in my HTML file (this is the only way I know so far to do this). On my 500 error page, though, I am getting another 500 error and an "Uncaught ReferenceError: Granite is not defined", which is causing my clientlibs to break and the page to look terrible and broken. Does anyone know why this may be happening or how I can fix it? It's very frustrating because my actual 500 page does not itself have any errors in code, just the page that redirects to it. Thank you!

1 Accepted Solution

Avatar

Correct answer by
Level 9

If you are throwing 500 on post request then need to implement PostResponseCreator. https://sling.apache.org/apidocs/sling8/org/apache/sling/servlets/post/PostResponseCreator.html

View solution in original post

3 Replies

Avatar

Correct answer by
Level 9

If you are throwing 500 on post request then need to implement PostResponseCreator. https://sling.apache.org/apidocs/sling8/org/apache/sling/servlets/post/PostResponseCreator.html

Avatar

Administrator

What is your AEM version and can you please shre with us AEM error.log?

And i would encourage to re-post your question at :- http://adobe-consulting-services.github.io/acs-aem-commons/features/errorpagehandler.html

Link:-http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

// Struggling to get the 500 error work

~kautuk



Kautuk Sahni

Avatar

Level 1

My AEM version is 6.1 and below are the last lines of my error.log:

[Mon Apr 10 08:49:48.474461 2017] [rewrite:trace2] [pid 10094:tid 140664838522624] mod_rewrite.c(476): [client 10.20.30.149:59561] 10.20.30.149 - - [ca1ts-aemqad01/sid#7fef1c13c8b0][rid#7fef1c0320a0/initial] init rewrite engine with requested uri /libs/granite/csrf/token.json, referer: http://ca1ts-aemqad01/test-500-error
[Mon Apr 10 08:49:48.474491 2017] [rewrite:trace3] [pid 10094:tid 140664838522624] mod_rewrite.c(476): [client 10.20.30.149:59561] 10.20.30.149 - - [ca1ts-aemqad01/sid#7fef1c13c8b0][rid#7fef1c0320a0/initial] applying pattern '^/$' to uri '/libs/granite/csrf/token.json', referer: http://ca1ts-aemqad01/test-500-error
[Mon Apr 10 08:49:48.474497 2017] [rewrite:trace3] [pid 10094:tid 140664838522624] mod_rewrite.c(476): [client 10.20.30.149:59561] 10.20.30.149 - - [ca1ts-aemqad01/sid#7fef1c13c8b0][rid#7fef1c0320a0/initial] applying pattern '^(.+)$' to uri '/libs/granite/csrf/token.json', referer: http://ca1ts-aemqad01/test-500-error
[Mon Apr 10 08:49:48.474509 2017] [rewrite:trace3] [pid 10094:tid 140664838522624] mod_rewrite.c(476): [client 10.20.30.149:59561] 10.20.30.149 - - [ca1ts-aemqad01/sid#7fef1c13c8b0][rid#7fef1c0320a0/initial] applying pattern '^/gga/(.+)$' to uri '/libs/granite/csrf/token.json', referer: http://ca1ts-aemqad01/test-500-error
[Mon Apr 10 08:49:48.474514 2017] [rewrite:trace3] [pid 10094:tid 140664838522624] mod_rewrite.c(476): [client 10.20.30.149:59561] 10.20.30.149 - - [ca1ts-aemqad01/sid#7fef1c13c8b0][rid#7fef1c0320a0/initial] applying pattern '^/en(.+)$' to uri '/libs/granite/csrf/token.json', referer: http://ca1ts-aemqad01/test-500-error
[Mon Apr 10 08:49:48.474532 2017] [rewrite:trace3] [pid 10094:tid 140664838522624] mod_rewrite.c(476): [client 10.20.30.149:59561] 10.20.30.149 - - [ca1ts-aemqad01/sid#7fef1c13c8b0][rid#7fef1c0320a0/initial] applying pattern '^(.+)$' to uri '/libs/granite/csrf/token.json', referer: http://ca1ts-aemqad01/test-500-error
[Mon Apr 10 08:49:48.474540 2017] [rewrite:trace1] [pid 10094:tid 140664838522624] mod_rewrite.c(476): [client 10.20.30.149:59561] 10.20.30.149 - - [ca1ts-aemqad01/sid#7fef1c13c8b0][rid#7fef1c0320a0/initial] pass through /libs/granite/csrf/token.json, referer: http://ca1ts-aemqad01/test-500-error
[Mon Apr 10 08:49:48.584133 2017] [rewrite:trace2] [pid 10094:tid 140664599668480] mod_rewrite.c(476): [client 10.20.30.149:59561] 10.20.30.149 - - [ca1ts-aemqad01/sid#7fef1c13c8b0][rid#7fef1c0400a0/initial] init rewrite engine with requested uri /undefined.articleTag.json, referer: http://ca1ts-aemqad01/test-500-error
[Mon Apr 10 08:49:48.584157 2017] [rewrite:trace3] [pid 10094:tid 140664599668480] mod_rewrite.c(476): [client 10.20.30.149:59561] 10.20.30.149 - - [ca1ts-aemqad01/sid#7fef1c13c8b0][rid#7fef1c0400a0/initial] applying pattern '^/$' to uri '/undefined.articleTag.json', referer: http://ca1ts-aemqad01/test-500-error
[Mon Apr 10 08:49:48.584163 2017] [rewrite:trace3] [pid 10094:tid 140664599668480] mod_rewrite.c(476): [client 10.20.30.149:59561] 10.20.30.149 - - [ca1ts-aemqad01/sid#7fef1c13c8b0][rid#7fef1c0400a0/initial] applying pattern '^(.+)$' to uri '/undefined.articleTag.json', referer: http://ca1ts-aemqad01/test-500-error
[Mon Apr 10 08:49:48.584176 2017] [rewrite:trace3] [pid 10094:tid 140664599668480] mod_rewrite.c(476): [client 10.20.30.149:59561] 10.20.30.149 - - [ca1ts-aemqad01/sid#7fef1c13c8b0][rid#7fef1c0400a0/initial] applying pattern '^/gga/(.+)$' to uri '/undefined.articleTag.json', referer: http://ca1ts-aemqad01/test-500-error
[Mon Apr 10 08:49:48.584181 2017] [rewrite:trace3] [pid 10094:tid 140664599668480] mod_rewrite.c(476): [client 10.20.30.149:59561] 10.20.30.149 - - [ca1ts-aemqad01/sid#7fef1c13c8b0][rid#7fef1c0400a0/initial] applying pattern '^/en(.+)$' to uri '/undefined.articleTag.json', referer: http://ca1ts-aemqad01/test-500-error
[Mon Apr 10 08:49:48.584185 2017] [rewrite:trace3] [pid 10094:tid 140664599668480] mod_rewrite.c(476): [client 10.20.30.149:59561] 10.20.30.149 - - [ca1ts-aemqad01/sid#7fef1c13c8b0][rid#7fef1c0400a0/initial] applying pattern '^(.+)$' to uri '/undefined.articleTag.json', referer: http://ca1ts-aemqad01/test-500-error
[Mon Apr 10 08:49:48.584192 2017] [rewrite:trace1] [pid 10094:tid 140664599668480] mod_rewrite.c(476): [client 10.20.30.149:59561] 10.20.30.149 - - [ca1ts-aemqad01/sid#7fef1c13c8b0][rid#7fef1c0400a0/initial] pass through /undefined.articleTag.json, referer: http://ca1ts-aemqad01/test-500-error
[Mon Apr 10 08:49:48.660915 2017] [rewrite:trace2] [pid 10094:tid 140664633239296] mod_rewrite.c(476): [client 10.20.30.149:59561] 10.20.30.149 - - [ca1ts-aemqad01/sid#7fef1c13c8b0][rid#7fef1c03c0a0/initial] init rewrite engine with requested uri /undefined.articleTag.json, referer: http://ca1ts-aemqad01/test-500-error
[Mon Apr 10 08:49:48.660935 2017] [rewrite:trace3] [pid 10094:tid 140664633239296] mod_rewrite.c(476): [client 10.20.30.149:59561] 10.20.30.149 - - [ca1ts-aemqad01/sid#7fef1c13c8b0][rid#7fef1c03c0a0/initial] applying pattern '^/$' to uri '/undefined.articleTag.json', referer: http://ca1ts-aemqad01/test-500-error
[Mon Apr 10 08:49:48.660941 2017] [rewrite:trace3] [pid 10094:tid 140664633239296] mod_rewrite.c(476): [client 10.20.30.149:59561] 10.20.30.149 - - [ca1ts-aemqad01/sid#7fef1c13c8b0][rid#7fef1c03c0a0/initial] applying pattern '^(.+)$' to uri '/undefined.articleTag.json', referer: http://ca1ts-aemqad01/test-500-error
[Mon Apr 10 08:49:48.660954 2017] [rewrite:trace3] [pid 10094:tid 140664633239296] mod_rewrite.c(476): [client 10.20.30.149:59561] 10.20.30.149 - - [ca1ts-aemqad01/sid#7fef1c13c8b0][rid#7fef1c03c0a0/initial] applying pattern '^/gga/(.+)$' to uri '/undefined.articleTag.json', referer: http://ca1ts-aemqad01/test-500-error
[Mon Apr 10 08:49:48.660973 2017] [rewrite:trace3] [pid 10094:tid 140664633239296] mod_rewrite.c(476): [client 10.20.30.149:59561] 10.20.30.149 - - [ca1ts-aemqad01/sid#7fef1c13c8b0][rid#7fef1c03c0a0/initial] applying pattern '^/en(.+)$' to uri '/undefined.articleTag.json', referer: http://ca1ts-aemqad01/test-500-error
[Mon Apr 10 08:49:48.660978 2017] [rewrite:trace3] [pid 10094:tid 140664633239296] mod_rewrite.c(476): [client 10.20.30.149:59561] 10.20.30.149 - - [ca1ts-aemqad01/sid#7fef1c13c8b0][rid#7fef1c03c0a0/initial] applying pattern '^(.+)$' to uri '/undefined.articleTag.json', referer: http://ca1ts-aemqad01/test-500-error
[Mon Apr 10 08:49:48.660985 2017] [rewrite:trace1] [pid 10094:tid 140664633239296] mod_rewrite.c(476): [client 10.20.30.149:59561] 10.20.30.149 - - [ca1ts-aemqad01/sid#7fef1c13c8b0][rid#7fef1c03c0a0/initial] pass through /undefined.articleTag.json, referer: http://ca1ts-aemqad01/test-500-error