Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
Version: 14
Bug summary
Requesting the DataTypeFolder endpoint: https://localhost:44339/umbraco/management/api/v1/tree/data-type/root?take=100&foldersOnly=false
Sometimes causes errors, this seems to be because of some caching error, and thus it will throw this exception:
Specifics
at Umbraco.Extensions.StringExtensions.InvariantStartsWith(String compare, String compareTo) in C:\\Users\\Zeegan\\Documents\\GitHub\\v14-plsfix\\src\\Umbraco.Core\\Extensions\\StringExtensions.cs:line 613\r\n at Umbraco.Cms.Core.Cache.ObjectCacheAppCache.<>c__DisplayClass13_0.<SearchByKey>b__0(String key) in C:\\Users\\Zeegan\\Documents\\GitHub\\v14-plsfix\\src\\Umbraco.Core\\Cache\\ObjectCacheAppCache.cs:line 76\r\n at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()\r\n at System.Linq.Enumerable.WhereEnumerableIterator`1.ToArray()\r\n at Umbraco.Cms.Core.Cache.ObjectCacheAppCache.SearchByPredicate(Func`2 predicate) in C:\\Users\\Zeegan\\Documents\\GitHub\\v14-plsfix\\src\\Umbraco.Core\\Cache\\ObjectCacheAppCache.cs:line 88\r\n at Umbraco.Cms.Core.Cache.ObjectCacheAppCache.SearchByKey(String keyStartsWith) in C:\\Users\\Zeegan\\Documents\\GitHub\\v14-plsfix\\src\\Umbraco.Core\\Cache\\ObjectCacheAppCache.cs:line 76\r\n at Umbraco.Cms.Core.Cache.DeepCloneAppCache.SearchByKey(String keyStartsWith) in C:\\Users\\Zeegan\\Documents\\GitHub\\v14-plsfix\\src\\Umbraco.Core\\Cache\\DeepCloneAppCache.cs:line 59\r\n at Umbraco.Extensions.AppCacheExtensions.GetCacheItemsByKeySearch[T](IAppCache provider, String keyStartsWith) in C:\\Users\\Zeegan\\Documents\\GitHub\\v14-plsfix\\src\\Umbraco.Core\\Cache\\AppCacheExtensions.cs:line 31\r\n at Umbraco.Cms.Core.Cache.DefaultRepositoryCachePolicy`2.GetAll(TId[] ids, Func`2 performGetAll) in C:\\Users\\Zeegan\\Documents\\GitHub\\v14-plsfix\\src\\Umbraco.Infrastructure\\Cache\\DefaultRepositoryCachePolicy.cs:line 180\r\n at Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement.EntityRepositoryBase`2.GetMany(TId[] ids) in C:\\Users\\Zeegan\\Documents\\GitHub\\v14-plsfix\\src\\Umbraco.Infrastructure\\Persistence\\Repositories\\Implement\\EntityRepositoryBase.cs:line 153\r\n at Umbraco.Cms.Core.Services.Implement.DataTypeService.GetAll(Int32[] ids) in C:\\Users\\Zeegan\\Documents\\GitHub\\v14-plsfix\\src\\Umbraco.Core\\Services\\DataTypeService.cs:line 351\r\n at Umbraco.Cms.Api.Management.Controllers.DataType.Tree.DataTypeTreeControllerBase.MapTreeItemViewModels(Nullable`1 parentId, IEntitySlim[] entities) in C:\\Users\\Zeegan\\Documents\\GitHub\\v14-plsfix\\src\\Umbraco.Cms.Api.Management\\Controllers\\DataType\\Tree\\DataTypeTreeControllerBase.cs:line 32\r\n at Umbraco.Cms.Api.Management.Controllers.Tree.EntityTreeControllerBase`1.GetRoot(Int32 skip, Int32 take) in C:\\Users\\Zeegan\\Documents\\GitHub\\v14-plsfix\\src\\Umbraco.Cms.Api.Management\\Controllers\\Tree\\EntityTreeControllerBase.cs:line 41\r\n at Umbraco.Cms.Api.Management.Controllers.DataType.Tree.RootDataTypeTreeController.Root(Int32 skip, Int32 take, Boolean foldersOnly) in C:\\Users\\Zeegan\\Documents\\GitHub\\v14-plsfix\\src\\Umbraco.Cms.Api.Management\\Controllers\\DataType\\Tree\\RootDataTypeTreeController.cs:line 25\r\n at lambda_method301(Closure, Object)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)\r\n at Umbraco.Cms.Web.Common.Middleware.BasicAuthenticationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in C:\\Users\\Zeegan\\Documents\\GitHub\\v14-plsfix\\src\\Umbraco.Web.Website\\Middleware\\BasicAuthenticationMiddleware.cs:line 62\r\n at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Umbraco.Cms.Web.BackOffice.Middleware.BackOfficeExternalLoginProviderErrorMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in C:\\Users\\Zeegan\\Documents\\GitHub\\v14-plsfix\\src\\Umbraco.Web.BackOffice\\Middleware\\BackOfficeExternalLoginProviderErrorMiddleware.cs:line 50\r\n at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)\r\n at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)\r\n at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)\r\n at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)\r\n at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)\r\n at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)\r\n at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)\r\n at StackExchange.Profiling.MiniProfilerMiddleware.Invoke(HttpContext context) in C:\\projects\\dotnet\\src\\MiniProfiler.AspNetCore\\MiniProfilerMiddleware.cs:line 112\r\n at Umbraco.Cms.Web.Common.Middleware.UmbracoRequestMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in C:\\Users\\Zeegan\\Documents\\GitHub\\v14-plsfix\\src\\Umbraco.Web.Common\\Middleware\\UmbracoRequestMiddleware.cs:line 139\r\n at Umbraco.Cms.Web.Common.Middleware.UmbracoRequestMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in C:\\Users\\Zeegan\\Documents\\GitHub\\v14-plsfix\\src\\Umbraco.Web.Common\\Middleware\\UmbracoRequestMiddleware.cs:line 145\r\n at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Umbraco.Cms.Web.Common.Middleware.PreviewAuthenticationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in C:\\Users\\Zeegan\\Documents\\GitHub\\v14-plsfix\\src\\Umbraco.Web.Common\\Middleware\\PreviewAuthenticationMiddleware.cs:line 82\r\n at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Umbraco.Cms.Web.Common.Middleware.UmbracoRequestLoggingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in C:\\Users\\Zeegan\\Documents\\GitHub\\v14-plsfix\\src\\Umbraco.Web.Common\\Middleware\\UmbracoRequestLoggingMiddleware.cs:line 42\r\n at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)",
"instance": "NullReferenceException"
Steps to reproduce
Create a DataTypeFolder in the DataType tree
Call the https://localhost:44339/umbraco/management/api/v1/tree/data-type/root?take=100&foldersOnly=true endpoint
Call the https://localhost:44339/umbraco/management/api/v1/tree/data-type/root?take=100&foldersOnly=false endpoint (Click it a lot in swagger and you will see an error)
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
Version: 14
Bug summary
Requesting the DataTypeFolder endpoint:
https://localhost:44339/umbraco/management/api/v1/tree/data-type/root?take=100&foldersOnly=false
Sometimes causes errors, this seems to be because of some caching error, and thus it will throw this exception:Specifics
Steps to reproduce
DataType
treehttps://localhost:44339/umbraco/management/api/v1/tree/data-type/root?take=100&foldersOnly=true
endpointhttps://localhost:44339/umbraco/management/api/v1/tree/data-type/root?take=100&foldersOnly=false
endpoint (Click it a lot in swagger and you will see an error)Expected result / actual result
No response
This item has been added to our backlog AB#37073