Hello dear team, I write since a while ago our server registers the following exception when it tries to receive data synchronization.
One or more handlers failed when publishing 58 events. First event source id: ebad6f7730564dfebc5d418c23db6c7f. (EventHandlerException: Exception has been thrown by the target of an invocation.)
System.AggregateException (thrown 2 times)
System.AggregateException: One or more handlers failed when publishing 58 events. First event source id: ebad6f7730564dfebc5d418c23db6c7f. (EventHandlerException: Exception has been thrown by the target of an invocation.)
---> Ncqrs.Domain.EventHandlerException: EventHandlerException: Exception has been thrown by the target of an invocation.
---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.NullReferenceException: Object reference not set to an instance of an object.
at WB.Core.BoundedContexts.Headquarters.EventHandler.InterviewDynamicReportAnswersDenormalizer.Update(InterviewSummary state, IPublishedEvent<T> event)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at WB.Core.Infrastructure.EventHandlers.AbstractCompositeFunctionalEventHandler<T1,T2>.ApplyEventOnEntity(IPublishableEvent evt, TEntity currentState)
at WB.Core.Infrastructure.EventHandlers.AbstractFunctionalEventHandler<T1,T2>.Handle(IPublishableEvent evt, IReadSideStorage<T> storage)
at WB.Core.Infrastructure.EventHandlers.AbstractFunctionalEventHandler<T1,T2>.Handle(IEnumerable<T> publishableEvents)
at WB.Core.Infrastructure.Implementation.EventDispatcher.NcqrCompatibleEventDispatcher.Publish(IEnumerable<T> eventMessages)
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at WB.Core.Infrastructure.Implementation.EventDispatcher.NcqrCompatibleEventDispatcher.Publish(IEnumerable<T> eventMessages)
at WB.Core.Infrastructure.CommandBus.Implementation.CommandExecutor.ExecuteEventSourcedCommand(ICommand command, String origin, Type aggregateType, Guid aggregateId, IEnumerable<T> validators, IEnumerable<T> preProcessors, IEnumerable<T> postProcessors, Action<T1,T2> commandHandler, CancellationToken cancellationToken)
at WB.Core.Infrastructure.CommandBus.Implementation.CommandExecutor.ExecuteCommand(ICommand command, String origin, CancellationToken cancellationToken, Guid aggregateId)
at WB.Core.Infrastructure.CommandBus.Implementation.CommandService.<>c__DisplayClass14_0.<ExecuteImpl>b__1(ICommandExecutor ce)
at WB.Core.BoundedContexts.Headquarters.Implementation.UnitOfWorkInScopeExecutor.Execute(Action<T> action, String workspace)
at WB.Core.GenericSubdomains.Portable.NamedLocker.RunWithLock(String name, Action body)
at WB.Core.Infrastructure.CommandBus.Implementation.CommandService.ExecuteImpl(ICommand command, String origin, CancellationToken cancellationToken)
at WB.Core.Infrastructure.CommandBus.Implementation.CommandService.Execute(ICommand command, String origin)
at WB.Core.BoundedContexts.Headquarters.Implementation.Synchronization.InterviewPackagesService.<>c__DisplayClass22_0.<ProcessPackage>b__0(IServiceLocator serviceLocator)
at WB.Core.BoundedContexts.Headquarters.Implementation.UnitOfWorkInScopeExecutor.Execute(Action<T> action, String workspace)
at WB.Core.BoundedContexts.Headquarters.Implementation.Synchronization.InterviewPackagesService.ProcessPackage(InterviewPackage interview)
at WB.UI.Headquarters.Controllers.Api.DataCollection.InterviewsControllerBase.PostV3(InterviewPackageApiView package)
at lambda_method33619(Closure , Object , Object[] )
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location ---
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|24_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|19_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.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at WB.UI.Headquarters.Code.Workspaces.WorkspaceRedirectMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
at WB.UI.Headquarters.Metrics.HeadquartersHttpMetricsMiddleware.<>c__DisplayClass5_0.<<Invoke>g__Next|0>d.MoveNext()
--- End of stack trace from previous location ---
at WB.UI.Headquarters.Metrics.HeadquartersHttpMetricsMiddleware.Invoke(HttpContext context)
at WB.UI.Headquarters.Code.Workspaces.WorkspaceMiddleware.<>c__DisplayClass2_0.<<Invoke>g__InvokeNextWithScope|0>d.MoveNext()
--- End of stack trace from previous location ---
at WB.UI.Headquarters.Code.Workspaces.WorkspaceMiddleware.Invoke(HttpContext context)
at Serilog.AspNetCore.RequestLoggingMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
at StackExchange.Exceptional.ExceptionalMiddleware.Invoke(HttpContext context)