Base solution for your next web application
Open Closed

Getting 500 internal server error on Impersonate Login #11232


User avatar
0
murphymj5209 created
  • What is your product version? - 11.1.0
  • What is your product type (Angular or MVC)? - Angular
  • What is product framework type (.net framework or .net core)? .net core

If issue related with ABP Framework

  • What is ABP Framework version? 7.1.0
  • When I do Impersonate or normal login, I always get 500 internal server error. It works for admin role but for different roles it's not working. Can you please help me with this? Here is the link, https://localhost:44301/AbpUserConfiguration/GetAll?d= I didn't find any controller

13 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @murphymj5209

    Could you opne App_Data/Logs/Logs.txt file and share the error message with me ?

    Thanks,

  • User Avatar
    0
    murphymj5209 created

    Hey @ismcagdas,

    I have attached the logs from the Log.txt file. Just to let you know we do have 'Doctor' as Role in Database. Also, We have multi tenancy enabled so we have different tenants that might same Role named as 'Doctor' just giving this additional information to help you debug this issue!

    ERROR 2022-08-25 22:04:06,720 [orker] Mvc.ExceptionHandling.AbpExceptionFilter - There is no role with name: Doctor
    Abp.AbpException: There is no role with name: Doctor
       at Abp.Authorization.Roles.AbpRoleManager`2.GetRoleByNameAsync(String roleName)
       at Abp.Authorization.Users.AbpUserManager`2.<>c__DisplayClass89_0.<<GetUserPermissionCacheItemAsync>b__0>d.MoveNext()
    --- End of stack trace from previous location ---
       at Abp.Runtime.Caching.TypedCacheWrapper`2.&lt;&gt;c__DisplayClass18_0.&lt;&lt;GetAsync&gt;b__0>d.MoveNext()
    --- End of stack trace from previous location ---
       at Abp.Runtime.Caching.AbpCacheBase`2.GetAsync(TKey key, Func`2 factory)
       at Abp.Runtime.Caching.TypedCacheWrapper`2.GetAsync(TKey key, Func`2 factory)
       at Abp.Authorization.Users.AbpUserManager`2.GetUserPermissionCacheItemAsync(Int64 userId)
       at Abp.Authorization.Users.AbpUserManager`2.IsGrantedAsync(Int64 userId, Permission permission)
       at Abp.Authorization.Users.AbpUserManager`2.IsGrantedAsync(Int64 userId, String permissionName)
       at Abp.Authorization.PermissionChecker`2.IsGrantedAsync(Int64 userId, String permissionName)
       at Abp.Authorization.PermissionChecker`2.IsGrantedAsync(String permissionName)
       at Abp.Web.Configuration.AbpUserConfigurationBuilder.GetUserAuthConfig()
       at Abp.Web.Configuration.AbpUserConfigurationBuilder.GetAll()
       at Abp.AspNetCore.Mvc.Controllers.AbpUserConfigurationController.GetAll()
       at lambda_method1791(Closure , Object )
       at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.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.&lt;InvokeNextActionFilterAsync&gt;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.&lt;InvokeInnerFilterAsync&gt;g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.&lt;InvokeNextExceptionFilterAsync&gt;g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
    ERROR 2022-08-25 22:04:09,443 [orker] Mvc.ExceptionHandling.AbpExceptionFilter - There is no role with name: Doctor
    Abp.AbpException: There is no role with name: Doctor
       at Abp.Authorization.Roles.AbpRoleManager`2.GetRoleByNameAsync(String roleName)
       at Abp.Authorization.Users.AbpUserManager`2.&lt;&gt;c__DisplayClass89_0.&lt;&lt;GetUserPermissionCacheItemAsync&gt;b__0>d.MoveNext()
    --- End of stack trace from previous location ---
       at Abp.Runtime.Caching.TypedCacheWrapper`2.<>c__DisplayClass18_0.<<GetAsync>b__0>d.MoveNext()
    --- End of stack trace from previous location ---
       at Abp.Runtime.Caching.AbpCacheBase`2.GetAsync(TKey key, Func`2 factory)
       at Abp.Runtime.Caching.TypedCacheWrapper`2.GetAsync(TKey key, Func`2 factory)
       at Abp.Authorization.Users.AbpUserManager`2.GetUserPermissionCacheItemAsync(Int64 userId)
       at Abp.Authorization.Users.AbpUserManager`2.IsGrantedAsync(Int64 userId, Permission permission)
       at Abp.Authorization.Users.AbpUserManager`2.IsGrantedAsync(Int64 userId, String permissionName)
       at Abp.Authorization.PermissionChecker`2.IsGrantedAsync(Int64 userId, String permissionName)
       at Abp.Authorization.PermissionChecker`2.IsGrantedAsync(String permissionName)
       at Abp.Web.Configuration.AbpUserConfigurationBuilder.GetUserAuthConfig()
       at Abp.Web.Configuration.AbpUserConfigurationBuilder.GetAll()
       at Abp.AspNetCore.Mvc.Controllers.AbpUserConfigurationController.GetAll()
       at lambda_method1791(Closure , Object )
       at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.&lt;InvokeActionMethodAsync&gt;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>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
       at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
    
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @murphymj5209

    Just to be sure, do both Host and target Tenant which you are impersonating to have both Doctor role ?

  • User Avatar
    0
    murphymj5209 created

    Hey @ismcagdas,

    Yes both the host and the tenant have the Doctor role. I noticed there was a D capital in Tenant so I changed that to Small d(doctor) . Still no luck. Also, I feel something is wrong with RoleManager. I remember earlier I faced an issue getting a role by name it throwed error but when I tried with Id it worked.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @murphymj5209

    Is it possible to share your project with us via email ? It will be better if we can check this problem on your project.

  • User Avatar
    0
    murphymj5209 created
    1. I do not know how to do the email to support, let me know the email to use and procedures. 2) how about I give access to Github? I can make someone a contributor then remove it?
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @murphymj5209

    GitHub access would be better. You can send an email to [email protected] and we can arrange the details.

  • User Avatar
    0
    murphymj5209 created

    I have sent the email earlier today. please respond as soon as possible. thanks.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @murphymj5209

    Thanks. Replied to your email. We can continue via email.

  • User Avatar
    0
    murphymj5209 created

    I have sent a github invite and it is the Test_angular_cp branch. thanks.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @murphymj5209

    It seems like I didn't receive the invitation. Could you also share the repository URL via email with [email protected] ?

    Thanks,

  • User Avatar
    0
    murphymj5209 created

    Here is what I see when I go to github, which was set the other day. Is this what you asked for?

    There is no email in github for [email protected]. please reply asap so I know that my end is completed.

    Yes, I am alittle frustrated that this is taking so long to reply to a simple problem.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi Mike,

    Thanks, I got the invitaiton. We can continue via email for this topic.