Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"<error404>$site//..." configuration doesn't work on Cloud Environments #465

Open
hfloyd opened this issue Oct 7, 2021 · 1 comment
Open

Comments

@hfloyd
Copy link

hfloyd commented Oct 7, 2021

Issue description

According to this PR - umbraco/Umbraco-CMS#10356, as of Umbraco v 8.16, the following 404 configuration should now work:

umbracoSettings.config:
<error404>$site//MyErrorPageType[@nodeName='404']</error404>

Since we have a setup with three separate sites, each with its own error page, I have used this format.

On my LOCAL environment, this works correctly - visiting a non-existent url returns the proper error page. But on my Cloud environments (DEV/LIVE) it doesn't work - I see the ugly white Umbraco 404 page. If I check the log on DEV, I see this message:

Message:
Could not parse xpath expression: "$site//ErrorPage[@nodeName='404']"

									
Exception:
System.Xml.XPath.XPathException: Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function.
   at MS.Internal.Xml.XPath.CompiledXpathExpr.get_QueryTree()
   at System.Xml.XPath.XPathNavigator.Evaluate(XPathExpression expr, XPathNodeIterator context)
   at System.Xml.XPath.XPathNavigator.Select(XPathExpression expr)
   at Umbraco.Web.PublishedCache.NuCache.ContentCache.GetSingleByXPath(Boolean preview, String xpath, XPathVariable[] vars)
   at Umbraco.Web.PublishedContentQuery.ContentSingleAtXPath(String xpath, XPathVariable[] vars)
   at Umbraco.Web.Routing.NotFoundHandlerHelper.GetContentIdFromErrorPageConfig(IContentErrorPage errorPage, IEntityService entityService, IPublishedContentQuery publishedContentQuery, Nullable`1 domainContentId)

Ps. The v8 docs have not yet been updated accordingly, so I wanted to check that this is indeed officially supported
https://our.umbraco.com/Documentation/Tutorials/Custom-Error-Pages/index-v8

Version

Umbraco Cloud
Umbraco Id
Umbraco 8.17.0
Deploy 4.3.0.0
Forms 8.8.0

@TommyForsberg
Copy link

I can confirm this issue. We are having the exact same behavior in our project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants