Issue with Loading Content after Adding Workspaces to CI

2025/06/27 9:11 PM

We had the default Kentico Workspace setup for a client. I added 4 more to explain something to the client and test a theory and now I am getting an error that I am not sure how to solve. This does NOT happen on my local environment, only in HostedDev.  Anyone have any insight on how I can solve this? Basically ANY time I am editing widgets or content, I am getting this error.

Message: Root folder not found for workspace with ID '2'.

27362
Source
Kentico.Web.Mvc.KenticoErrorHandlingMiddleware
Event code
0
User ID
96
User name
[email protected]
IP address
162.207.199.46
Description
Message: Invocation of command 'LoadFormItems' on the 'Kentico.Xperience.Admin.Base.Forms.ContentItemSelectorComponent' component failed. See the inner exception for details.

Exception type: System.InvalidOperationException
Stack trace:
at Kentico.Xperience.Admin.Base.Forms.FormComponentCommandInvoker.InvokeCore(Object target, Command command, IFormComponentCommandInvocationModel commandArguments, CancellationToken cancellationToken)
at Kentico.Xperience.Admin.Websites.UIPages.PageBuilderTab.ComponentCommand(FormComponentCommandModel commandModel, CancellationToken cancellationToken)
at Kentico.Xperience.Admin.Base.Command.Invoke(Object target, Object parameter, Object confirmationModel, CancellationToken cancellationToken)
at Kentico.Xperience.Admin.Base.PageCommandInvoker.InvokeCommand(CommandRequestModel commandRequest, PageRouteValues routeValues, UITreeNode node, Command command, CancellationToken cancellationToken)
at Kentico.Xperience.Admin.Base.PageCommandInvoker.InvokeCommand(CommandRequestModel commandRequest, CancellationToken cancellationToken)
at Kentico.Xperience.Admin.Base.KenticoAdministrationController.ProcessCommand(CommandRequestModel commandRequest, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Kentico.Xperience.Admin.Base.AntiforgeryMiddleware.InvokeAsync(HttpContext context)
at Kentico.Web.Mvc.Internal.DefaultAdminSchemeAuthenticationMiddleware.InvokeAsync(HttpContext context)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Kentico.Xperience.Admin.Base.AdminLocalizationMiddleware.InvokeAsync(HttpContext context)
at Kentico.Web.Mvc.KenticoRequestEventsMiddleware.InvokeAsync(HttpContext context)
at Kentico.Web.Mvc.KenticoErrorHandlingMiddleware.InvokeAsync(HttpContext context, ILogger`1 logger)

Message: Root folder not found for workspace with ID '2'.

Exception type: System.InvalidOperationException
Stack trace:
at CMS.ContentEngine.ContentFolderInfoExtensions.<>c__DisplayClass7_0.<<GetRootAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at CMS.Helpers.ProgressiveCache.<>c__DisplayClass6_0`1.<<LoadCoreAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at CMS.Helpers.ProgressiveLoadItem`1.ExecuteTaskAsync(CancellationToken cancellationToken)
at CMS.Helpers.ProgressiveLoadItem`1.GetResultAsync(CancellationToken cancellationToken)
at CMS.Helpers.ProgressiveLoader.GetResultAsync[TData](IProgressiveLoadItem progressiveLoadItem, String progressiveItemName, CancellationToken cancellationToken)
at CMS.Helpers.ProgressiveCache.LoadCoreAsync[TData](Func`3 loadDataFuncAsync, CacheSettings settings, CancellationToken cancellationToken)
at CMS.ContentEngine.ContentFolderInfoExtensions.GetRootAsync(IInfoProvider`1 infoProvider, Int32 workspaceId, CancellationToken cancellationToken)
at Kentico.Xperience.Admin.Base.ContentFolderCommandManager.GetRootFolder(String workspaceName, CancellationToken cancellationToken)
at Kentico.Xperience.Admin.Base.Forms.ContentItemSelectorComponent.ModifyContentTypeSelectionFormComponents(ICollection`1 formItems, CancellationToken cancellationToken)
at Kentico.Xperience.Admin.Base.Forms.ContentItemSelectorComponentBase`1.LoadFormItems(ContentItemCommandParameters args, CancellationToken cancellationToken)
at Kentico.Xperience.Admin.Base.Command.Invoke(Object target, Object parameter, Object confirmationModel, CancellationToken cancellationToken)
at Kentico.Xperience.Admin.Base.Forms.FormComponentCommandInvoker.InvokeCore(Object target, Command command, IFormComponentCommandInvocationModel commandArguments, CancellationToken cancellationToken)
Machine name
WN0XSDWK0000D4
Event URL
/admin/api/cmd
URL referrer
https://****-xbyk-dev.azurewebsites.net/admin/webpages-1/en-US_9899/page-builder
User agent
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36

Environment

  • Xperience by Kentico version: 30.3.1

  • .NET version: [8]

  • Execution environment: Private cloud (Azure)

Answers

2025/06/27 9:42 PM

It looks like a related bug was fixed in v30.2.2, but you're using v30.3.1?

If you download the database and run a v30.3.1 app against it, can you identify any other information about the problem?

The CMS_ContentFolder table lists all folders in the Content Hub across all workspaces. Each "root" folder has a ContentFolderName of "Root" and a ContentFolderParentFolderID value of null. The ContentFolderWorkspaceID tells you which workspace the folder is for.

I'd look for a folders for workspace 2 and see if you are missing a root content folder there.

The CMS_ContentItem table has a column ContentItemContentFolderID and ContentItemWorkspaceID - are there any items that don't have a valid folder for the given workspace? All items are required to be in a valid workspace/folder combination.

To answer this question, you have to login first.