U4-8116 - ContentTypeService failed to find a content type with alias "root".

Created by Wesley de Roo 03 Mar 2016, 15:59:46 Updated by Dan Booth 15 Mar 2017, 13:25:51

When using a datatype MNTP and using xpath query with $root, i'am getting error. For now fixed with: $current/ancestor-or-self::*[@isDoc][@level=0].

Stacktrace error: An error occured

ContentTypeService failed to find a content type with alias "root".

EXCEPTION DETAILS

System.Exception: ContentTypeService failed to find a content type with alias "root". [DEFAULTDIALOGS_STACKTRACE]

at Umbraco.Core.Models.PublishedContent.PublishedContentType.CreatePublishedContentType(PublishedItemType itemType, String alias) at Umbraco.Core.Cache.CacheProviderExtensions.<>c__DisplayClass91.<GetCacheItem>b__8() at Umbraco.Core.Cache.StaticCacheProvider.<>c__DisplayClass1a.<GetCacheItem>b__19(String key) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Umbraco.Core.Cache.StaticCacheProvider.GetCacheItem(String cacheKey, Func1 getCacheItem) at Umbraco.Core.Cache.CacheProviderExtensions.GetCacheItem[T](ICacheProvider provider, String cacheKey, Func1 getCacheItem) at Umbraco.Core.Models.PublishedContent.PublishedContentType.Get(PublishedItemType itemType, String alias) at Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedContent.Initialize() at Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedContentCache.ConvertToDocument(XmlNode xmlNode, Boolean isPreviewing) at Umbraco.Web.PublishedCache.ContextualPublishedCache1.GetSingleByXPath(Boolean preview, String xpath, XPathVariable[] vars) at Umbraco.Web.PublishedContentQuery.TypedDocumentByXPath(String xpath, XPathVariable[] vars, ContextualPublishedContentCache cache) at Umbraco.Web.Editors.EntityController.GetByQuery(String query, Int32 nodeContextId, UmbracoEntityTypes type) at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.b__9(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary2 arguments, CancellationToken cancellationToken) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()

Comments

Dan Sørensen 01 Jul 2016, 11:58:05

This also happens with $parent


Niall McCabe 19 Jul 2016, 14:01:02

This also happens when just using the xpath query $current


Mark Bowser 22 Jul 2016, 16:41:18

This is happening on one of our umbraco 7.4.3 sites. The error doesn't pop up on the content tree for our content editors. The MNTP we use has $current as the XPATH. It is working great for the content editors. The error only seems to pop up when I open the Document Type editor and attempt to edit a document type that has one of these MNTPs. So far, it isn't preventing us from proceeding; it is just very annoying.


Thomas 04 Aug 2016, 06:53:51

Possible to work round this for now using: $current[@isDoc]

That stops the "root" error happening in the document designer.


Jamie Attwood 06 Jan 2017, 01:48:23

I have this happening currently on 7.5.4 when using $site. Both queries that are throwing errors are using the following syntax. The queries appear to work fine in the content section, however blow up when trying to edit the doc type.

Thanks Jamie


Dan Booth 15 Mar 2017, 13:25:51

Yep, I've been seeing this a lot


Priority: Normal

Type: Bug

State: Submitted

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.4.1, 7.4.3

Due in version:

Sprint:

Story Points:

Cycle: