Open Closed

Error mapping types - LockoutEnd #7005


User avatar
0
apxsl created

We are getting below error and can't open Users (/identity/users) page if there is any value in LockoutEnd column in the AbpUsers Table.

Please check and let us know how to fix it.

  • ABP Framework version: v7.0.3
  • UI Type: Blazor Server
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace:
2024-04-06 10:23:29.2081|0|ERROR|Volo.Abp.Identity.Pro.Blazor.Pages.Identity.UserManagement|Error mapping types.
Mapping types:
List`1 -> List`1
System.Collections.Generic.List`1[[Volo.Abp.Identity.IdentityUser, Volo.Abp.Identity.Domain, Version=7.0.3.0, Culture=neutral, PublicKeyToken=null]] -> System.Collections.Generic.List`1[[Volo.Abp.Identity.IdentityUserDto, Volo.Abp.Identity.Pro.Application.Contracts, Version=7.0.3.0, Culture=neutral, PublicKeyToken=null]] AutoMapper.AutoMapperMappingException: Error mapping types.

Mapping types:
List`1 -> List`1
System.Collections.Generic.List`1[[Volo.Abp.Identity.IdentityUser, Volo.Abp.Identity.Domain, Version=7.0.3.0, Culture=neutral, PublicKeyToken=null]] -> System.Collections.Generic.List`1[[Volo.Abp.Identity.IdentityUserDto, Volo.Abp.Identity.Pro.Application.Contracts, Version=7.0.3.0, Culture=neutral, PublicKeyToken=null]]
 ---> AutoMapper.AutoMapperMappingException: Error mapping types.

Mapping types:
IdentityUser -> IdentityUserDto
Volo.Abp.Identity.IdentityUser -> Volo.Abp.Identity.IdentityUserDto

Type Map configuration:
IdentityUser -> IdentityUserDto
Volo.Abp.Identity.IdentityUser -> Volo.Abp.Identity.IdentityUserDto

Destination Member:
LockoutEnd

 ---> AutoMapper.AutoMapperMappingException: Missing type map configuration or unsupported mapping.

Mapping types:
DateTimeOffset -> DateTime
System.DateTimeOffset -> System.DateTime

Destination Member:
LockoutEnd

   at lambda_method11622(Closure, DateTimeOffset, DateTime, ResolutionContext)
   at lambda_method11621(Closure, Object, List`1, ResolutionContext)
   --- End of inner exception stack trace ---
   at lambda_method11621(Closure, Object, List`1, ResolutionContext)
   --- End of inner exception stack trace ---
   at lambda_method11621(Closure, Object, List`1, ResolutionContext)
   at Volo.Abp.ObjectMapping.DefaultObjectMapper.Map[TSource,TDestination](TSource source)
   at Volo.Abp.Identity.IdentityUserAppService.GetListAsync(GetIdentityUsersInput input)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.Authorization.AuthorizationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.GlobalFeatures.GlobalFeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.Auditing.AuditingInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Volo.Abp.BlazoriseUI.AbpCrudPageBase`10.GetEntitiesAsync()

Steps to reproduce the issue:

  • login as admin and create a new user
  • Enable Account lockout for that user
  • logoff from admin
  • try to log in with new user but give wrong password more that five time. (until account lock)
  • login as admin again with correct password
  • go to user management page. you will see the error message.
  • Open and see the log file. you will see this error message.

2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I can't reproduce this in a new template project.

    Do you have any custom code of the Mapper?

    Can you share a project? liming.ma@volosoft.com

    Thanks

  • User Avatar
    0
    apxsl created

    Hi,

    Thank you for the update.

    We have custom code for mapping and it has introduce the issue it seems.

    Regards, Wasantha.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11