Adobe-Consulting-Services / acs-aem-commons

http://adobe-consulting-services.github.io/acs-aem-commons/
Apache License 2.0
451 stars 597 forks source link

Issue with acs commons error handling #2803

Open AnupamaKarru opened 2 years ago

AnupamaKarru commented 2 years ago

Required Information

Expected Behavior

When we are accessing any page inside one microsite it is redirecting us to the error page of other microsite. Although we have error pages published for that microsite. Example: In case of any error on /content/testing/us/en page then it is redirecting us to the error page of "/content/app/us/en".

We do have error pages for both /content/testing/us/en and /content/app/us/en

the error handling is setup with acs commons as recommended.

Steps to Reproducehttps://stryker-build64.adobecqms.net/content/marketing-operations/us/en/indextest.html >> this Url should go to the https://stryker-build64.adobecqms.net/content/marketing-operations/us/en/error

davidjgonzalez commented 2 years ago

Can you set loggin to DEBUG on com.adobe.acs.commons.errorpagehandler.impl and reproduce the erroring condition? I would double-check all your errorPages properties - it sounds like one isn't updated (or maybe not published after an update?)

This feature hasnt changed in ages - and im not sure how it could know abotu some other trees error pages unless there's an errorPages property pointing to it (or its the fallback in the OSGi config).

Also, are you sure no one deployed ErrorDocument directives on Apache webserver(dispatcher) that hard-coded to goto the /content/app/us/en?

AnupamaKarru commented 2 years ago

We tried setting debug but we didn't find any log trace. All the pages are published which are having error pages configuration.

We have OSGI config pointing to "/content/app/us/en".Please find screenshot. We have ErrorDocument on dispatcher config which is pointing to /content/app/us/en.

image

Could you please let us know what are the required configurations we have to do in order to point microsite1 points to microsite1 error page and microsite2 points to microsite2 error page.

i.e. /content/testing/us/en -->"/content/testing/us/en/error". /content/app/us/en -->"/content/app/us/en/error".

Thanks, Anupama

davidjgonzalez commented 2 years ago

@AnupamaKarru - few observations

  1. I assume your errorPages property is set on all your cq:Page trees properly. Your OSGi only lists 1 mapping in paths, so i assume other are handled elsewhere (you dont need the OSGi paths at all if you are handled it at the cq:Page property leve)
  2. If the ErrorDocument directive is active for all your microsites, then this will override what AEM returns AS the error page. based on the info you provided, my guess is AEM is returning the correct error page - but the ErrroDocument is setting the 5xx/4xx response and returning with the error page specified there (which is hardcoded to /app/us/en/errors.html ..)

You can test this, but hitting AEM Publish directly (port 4503) without going through dispatcher and see if you have different behavior.

AnupamaKarru commented 2 years ago
  1. Yes, errorPages property is set on all pages.But we have OSGI config as well pointed to single url.
  2. Both errorDocument and OSGI has the same value configured. I tried hitting the publish url but it is still going to /app/us/en/errors.html
AnupamaKarru commented 2 years ago

Please provide an update.