Skip to content

Weird exception in background #529

Open
@JornWildt

Description

@JornWildt

Once in a while I get this exception after a MVC controller has completed, on a page with no editor in it:

This exception was originally thrown at this call stack:
    [External Code]
    AspNetCore._Admin_Modules_VisualEditor_MVC_Views_Frame.ExecuteAsync.AnonymousMethod__1() in Frame.cshtml

fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
      An unhandled exception has occurred while executing the request.
      Cofoundry.Domain.PermissionValidationFailedException: Permission Validation Check Failed. Permission Type: Cofoundry.Domain.RoleReadPermission. UserId: 5
         at Cofoundry.Domain.Internal.PermissionValidationService.EnforcePermission(IPermissionApplication permission, IUserContext userContext)
         at Cofoundry.Domain.Internal.PermissionValidationService.EnforcePermission(IEnumerable`1 permissions, IUserContext userContext)
         at Cofoundry.Domain.Internal.ExecutePermissionValidationService.Validate[TQuery,TResult](TQuery query, IQueryHandler`2 queryHandler, IExecutionContext executionContext)
         at Cofoundry.Domain.CQS.Internal.QueryExecutor.ExecuteQueryAsync[TQuery,TResult](TQuery query, IExecutionContext executionContext)
         at Cofoundry.Domain.CQS.Internal.QueryExecutor.ExecuteAsync[TResult](IQuery`1 query, IExecutionContext executionContext)
         at Cofoundry.Web.Admin.AngularBootstrapper.RenderBootstrapperAsync(AngularModuleRouteLibrary routeLibrary, Object options)
         at Cofoundry.Web.Admin.AngularBootstrapper.BootstrapAsync(AngularModuleRouteLibrary routeLibrary, Object options)
         at AspNetCore._Admin_Modules_VisualEditor_MVC_Views_Frame.<>c__DisplayClass9_0.<<ExecuteAsync>b__1>d.MoveNext() in /Admin/Modules/VisualEditor/MVC/Views/Frame.cshtml:line 29
      --- End of stack trace from previous location ---
         at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync()
         at AspNetCore._Admin_Modules_VisualEditor_MVC_Views_Frame.ExecuteAsync() in /Admin/Modules/VisualEditor/MVC/Views/Frame.cshtml:line 7
         at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context)
         at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts)
         at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)
         at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
         at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
         at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ActionContext actionContext, IView view, ViewDataDictionary viewData, ITempDataDictionary tempData, String contentType, Nullable`1 statusCode)
         at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor.ExecuteAsync(ActionContext context, ViewResult result)
         at Microsoft.AspNetCore.Mvc.ViewResult.ExecuteResultAsync(ActionContext context)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|30_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()
      --- End of stack trace from previous location ---
         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()
      --- End of stack trace from previous location ---
         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 Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
         at Cofoundry.Web.AutoUpdateMiddleware.Invoke(HttpContext cx)
         at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
         at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

The user ID 5 is not the currently signed-in user (which is user ID 6).

I am experimenting with user sign-in so there may very well be something wrong with user ID 5 ... but what happens here? The issue only shows in the log and not in the browser.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions