skoruba / IdentityServer4.Admin

The administration for the IdentityServer4 and Asp.Net Core Identity
MIT License
3.56k stars 1.15k forks source link

Upgrade Skoruba.AuditLogging.EntityFramework to 1.0.0-beta8 brakes admin app #572

Closed zd-dalibor closed 4 years ago

zd-dalibor commented 4 years ago

After upgrade Skoruba.AuditLogging.EntityFramework to 1.0.0-beta8 I got this exceptions:

[15:45:36 ERR] An unhandled exception has occurred while executing the request.
System.MissingMethodException: Method not found: 'Int32 Skoruba.AuditLogging.EntityFramework.Entities.AuditLog.get_Id()'.
   at Skoruba.IdentityServer4.Admin.EntityFramework.Repositories.AuditLogRepository`2.GetAsync(String event, String source, String category, Nullable`1 created, String subjectIdentifier, String subjectName, Int32 page, Int32 pageSize)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at Skoruba.IdentityServer4.Admin.EntityFramework.Repositories.AuditLogRepository`2.GetAsync(String event, String source, String category, Nullable`1 created, String subjectIdentifier, String subjectName, Int32 page, Int32 pageSize)
   at Skoruba.IdentityServer4.Admin.BusinessLogic.Services.AuditLogService`1.GetAsync(AuditLogFilterDto filters)
   at IdentityServer.Admin.Controllers.LogController.AuditLog(AuditLogFilterDto filters) in d:\Projects\WaitingRooms\src\Services\IdentityServer\IdentityServer.Admin\Controllers\LogController.cs:line 43
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(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()
--- End of stack trace from previous location where exception was thrown ---
   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()
--- End of stack trace from previous location where exception was thrown ---
   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 Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at NWebsec.AspNetCore.Middleware.Middleware.CspMiddleware.Invoke(HttpContext context)
   at NWebsec.AspNetCore.Middleware.Middleware.MiddlewareBase.Invoke(HttpContext context)
   at NWebsec.AspNetCore.Middleware.Middleware.MiddlewareBase.Invoke(HttpContext context)
   at NWebsec.AspNetCore.Middleware.Middleware.MiddlewareBase.Invoke(HttpContext context)
   at NWebsec.AspNetCore.Middleware.Middleware.MiddlewareBase.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
skoruba commented 4 years ago

I updated primary key of AuditLog table from int to long, because it could be a limit. You need upgrade AuditLog.cs and AuditLogDto.cs, then run db migrations - before applying migrations, I can recommend backup audit table. I will describe this change in next release, currently it is in progress in dev branch. Thanks.

skoruba commented 4 years ago

Fixed in master. Thanks