Umbraco.Cloud.Issues
Umbraco.Cloud.Issues copied to clipboard
"<error404>$site//..." configuration doesn't work on Cloud Environments
Issue description
According to this PR - https://github.com/umbraco/Umbraco-CMS/pull/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