question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[AbpException: There is no role with name: Admin]

See original GitHub issue

i have a view for creating Tenant, in application service method i have a method that create tenant with admin role and user. i use role repository not role manager, when i try to login with the new created user , i got this exception

Abp.AbpException: There is no role with name: Admin
at Abp.Authorization.Roles.AbpRoleManager`3.<GetRoleByNameAsync>d__3d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Authorization.Roles.AbpRoleManager`3.<HasPermissionAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Abp.Authorization.Users.AbpUserManager`3.<IsGrantedAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Authorization.Users.AbpUserManager`3.<IsGrantedAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Authorization.PermissionChecker`3.<IsGrantedAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Web.Authorization.AuthorizationScriptManager.<GetScriptAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown -

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:16 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
Anduin2017commented, Oct 10, 2018

This issue occurred again and I solved it by executing the following SQL to my database:

update AbpRoles set NormalizedName = UPPER(Name);
1reaction
rgiosacommented, Dec 8, 2021

When you create a role manually it is necessary to call role.SetNormalizedName(), otherwise any GUID will be saved in the database and the permissions will not work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GetScripts Exception: There is no role with name
For our POST action in our AccountController for Login we want to currently limit authentication of users who have the role 'Administrator'.
Read more >
Test fails asp.net boilerplate. Abp.AbpException : There is ...
When I run web.mvc project (of asp.net boilerplate template) the following exception is throwed: Abp.AbpException: There is no permission with ...
Read more >
Implement "pro"modues in the microservicedemo #316
Exception: An error was encountered while handling the remote login. Volo.Abp.AbpException: There is already an existing permission group with name: AbpIdentity.
Read more >
Spatie\Permission\Exceptions\RoleDoesNotExist There is ...
Spatie\Permission\Exceptions\RoleDoesNotExist There is no role named `super_admin`. Hi there, I don't what the problem is, I've added the guard to my model ...
Read more >
ASP.NET Boilerplate authorization
The CreateUser method can not be called by a user who is not granted the permission "Administration.UserManagement.CreateUser". The AbpAuthorize attribute also ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found