Error while creating assignment

We are facing an issue with creating assignments. When clicking “New Assignment” from the menu for the two most recent versions of one particular questionnaire in one particular workspace, Survey Solutions tells us that the operation has failed and we should contact the administrator, showing a Log off link. Other questionnaires in the same workspace work, older versions of the questionnaire work, the same version of the same questionnaire works in other workspaces.

I am being told that while importing the latest version of the questionnaire, assignments were updated, ostensibly successfully. Since that time, interviewers are no longer able to start new interviews.

Here is the exception that occurs when trying to create a new assignment:

hq_1        | System.InvalidOperationException: Requested level was not found for 0d8d5ad7f977455d85c74ef841ad5dd9_1 in bedb5e476f4a47d9a2afb720b981d9ff
hq_1        |    at WB.Core.SharedKernels.DataCollection.Implementation.Aggregates.InterviewEntities.InterviewTreeUpdater.GetLevelOrThrow(IInterviewTreeNode entity) in /src/Core/SharedKernels/DataCollection/DataCollection/Implementation/Aggregates/InterviewEntities/InterviewTreeUpdater.cs:line 341
hq_1        |    at WB.Core.SharedKernels.DataCollection.Implementation.Aggregates.InterviewEntities.InterviewTreeUpdater.UpdateEnablement(InterviewTreeRoster roster) in /src/Core/SharedKernels/DataCollection/DataCollection/Implementation/Aggregates/InterviewEntities/InterviewTreeUpdater.cs:line 140
hq_1        |    at WB.Core.SharedKernels.DataCollection.Implementation.Aggregates.InterviewEntities.InterviewTreeRoster.Accept(IInterviewTreeUpdater updater) in /src/Core/SharedKernels/DataCollection/DataCollection/Implementation/Aggregates/InterviewEntities/InterviewTreeRoster.cs:line 77
hq_1        |    at WB.Core.SharedKernels.DataCollection.Implementation.Aggregates.Interview.<>c__DisplayClass192_0.<UpdateTreeWithDependentChanges>g__PlayActionForEachNodeInOrder|0(List`1 playOrder, Action`1 action) in /src/Core/SharedKernels/DataCollection/DataCollection/Implementation/Aggregates/Interview.cs:line 2303
hq_1        |    at WB.Core.SharedKernels.DataCollection.Implementation.Aggregates.Interview.UpdateTreeWithDependentChanges(InterviewTree changedInterviewTree, IQuestionnaire questionnaire, Identity entityIdentity, DateTimeOffset originDate, Boolean removeLinkedAnswers) in /src/Core/SharedKernels/DataCollection/DataCollection/Implementation/Aggregates/Interview.cs:line 2313
hq_1        |    at WB.Core.SharedKernels.DataCollection.Implementation.Aggregates.Interview.CreateTemporaryInterview(CreateTemporaryInterviewCommand command) in /src/Core/SharedKernels/DataCollection/DataCollection/Implementation/Aggregates/Interview.cs:line 1142
hq_1        |    at WB.Core.Infrastructure.CommandBus.Implementation.CommandExecutor.ExecuteEventSourcedCommand(ICommand command, String origin, Type aggregateType, Guid aggregateId, IEnumerable`1 validators, IEnumerable`1 preProcessors, IEnumerable`1 postProcessors, Action`2 commandHandler, CancellationToken cancellationToken) in /src/Core/Infrastructure/WB.Core.Infrastructure/CommandBus/Implementation/CommandExecutor.cs:line 136
hq_1        |    at WB.Core.Infrastructure.CommandBus.Implementation.CommandExecutor.ExecuteCommand(ICommand command, String origin, CancellationToken cancellationToken, Guid aggregateId) in /src/Core/Infrastructure/WB.Core.Infrastructure/CommandBus/Implementation/CommandExecutor.cs:line 47
hq_1        |    at WB.Core.BoundedContexts.Headquarters.Implementation.UnitOfWorkInScopeExecutor.Execute(Action`1 action, String workspace) in /src/Core/BoundedContexts/Headquarters/WB.Core.BoundedContexts.Headquarters/Implementation/UnitOfWorkInScopeExecutor.cs:line 134
hq_1        |    at WB.Core.GenericSubdomains.Portable.NamedLocker.RunWithLock(String name, Action body) in /src/Core/GenericSubdomains/WB.Core.GenericSubdomains.Portable/NamedLocker.cs:line 36
hq_1        |    at WB.Core.Infrastructure.CommandBus.Implementation.CommandService.ExecuteImpl(ICommand command, String origin, CancellationToken cancellationToken) in /src/Core/Infrastructure/WB.Core.Infrastructure/CommandBus/Implementation/CommandService.cs:line 118
hq_1        |    at WB.Core.Infrastructure.CommandBus.Implementation.CommandService.Execute(ICommand command, String origin) in /src/Core/Infrastructure/WB.Core.Infrastructure/CommandBus/Implementation/CommandService.cs:line 35
hq_1        |    at WB.UI.Headquarters.Controllers.HQController.TakeNew(String id) in /src/UI/WB.UI.Headquarters.Core/Controllers/HQController.cs:line 74
hq_1        |    at lambda_method23275(Closure , Object , Object[] )
hq_1        |    at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
hq_1        |    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
hq_1        |    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
hq_1        |    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
hq_1        | --- End of stack trace from previous location ---
hq_1        |    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
hq_1        |    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
hq_1        |    at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
hq_1        | --- End of stack trace from previous location ---
hq_1        |    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
hq_1        |    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
hq_1        |    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
hq_1        |    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
hq_1        | --- End of stack trace from previous location ---
hq_1        |    at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
hq_1        |    at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
hq_1        |    at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
hq_1        |    at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
hq_1        | --- End of stack trace from previous location ---
hq_1        |    at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.Invoke(HttpContext context)
hq_1        |    at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
hq_1        |    at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
hq_1        |    at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
hq_1        |    at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
hq_1        |    at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
hq_1        |    at WB.UI.Headquarters.Code.Workspaces.WorkspaceRedirectMiddleware.Invoke(HttpContext context) in /src/UI/WB.UI.Headquarters.Core/Code/Workspaces/WorkspaceRedirectMiddleware.cs:line 62
hq_1        |    at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
hq_1        |    at WB.UI.Headquarters.Metrics.HeadquartersHttpMetricsMiddleware.<>c__DisplayClass5_0.<<Invoke>g__Next|0>d.MoveNext() in /src/UI/WB.UI.Headquarters.Core/Metrics/HeadquartersHttpMetricsMiddleware.cs:line 41
hq_1        | --- End of stack trace from previous location ---
hq_1        |    at WB.UI.Headquarters.Metrics.HeadquartersHttpMetricsMiddleware.Invoke(HttpContext context) in /src/UI/WB.UI.Headquarters.Core/Metrics/HeadquartersHttpMetricsMiddleware.cs:line 92
hq_1        |    at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
hq_1        | [10:10:38 ERR] Headquarters HTTP GET /nigeria/HQ/TakeNew/bedb5e476f4a47d9a2afb720b981d9ff$7 responded 500 in 140.5361 ms

This is on 21.09.3 (build 31749).

Any help would be greatly appreciated.

Hello Thorsten,

could you please check if

  1. there were edit operations on the Designer ~ around ~ the time when the questionnaire was imported to the HQ?
  2. if any assignments were created on this questionnaire earlier? (same questionnaire and version).

Thank you, Sergiy

Thank you for reporting this issue.
It should be resolved soon in the next version of Survey Solutions.

This issue was resolved.
Please update your environment with the latest Survey Solutions version 21.09.4

Windows Installer is already available.
Docker image will be available soon Docker image is also available.