Create New Tenant Error (URGENT Please!!)
See original GitHub issueHello guys! I have a serious problem here. So upgrade from version 2.3 to version 3.5 I can no longer create a new Tenant !!!
In the code of the Tenant build method, when you arrow the tenant to the new using (CurrentUnitOfWork.SetTenantId (tenant.Id))
when trying to create the StaticRoles throws an exception informing that the user with ID 1 does not exist.
I imagine that somewhere is applying the permission check to create Roles … and is trying to verify if my user is allowed … Only my user is from Host … and I am creating the Tenant yet …
This is the exception text:
Abp.AbpException: There is no user with id: 1
at Abp.Authorization.Users.AbpUserManager2.<GetUserByIdAsync>d__46.MoveNext() in D:\Github\aspnetboilerplate\src\Abp.ZeroCore\Authorization\Users\AbpUserManager.cs:line 329 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Abp.Authorization.Users.AbpUserManager
2.<IsGrantedAsync>d__34.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Authorization.Users.AbpUserManager2.<IsGrantedAsync>d__33.MoveNext() in D:\Github\aspnetboilerplate\src\Abp.ZeroCore\Authorization\Users\AbpUserManager.cs:line 129 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Abp.Authorization.PermissionChecker
2.<IsGrantedAsync>d__19.MoveNext() in D:\Github\aspnetboilerplate\src\Abp.ZeroCore\Authorization\PermissionChecker.cs:line 48
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Authorization.PermissionChecker`2.<IsGrantedAsync>d__18.MoveNext() in D:\Github\aspnetboilerplate\src\Abp.ZeroCore\Authorization\PermissionChecker.cs:line 43
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.Compiler…
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top GitHub Comments
It looks like the AsyncCrudAppService class has something missing for me … Implemented it and it all worked again …
Thanks for your help @ryancyq!!
Does the fact that my TenantAppService class is not inheriting from the AsyncCrudAppService class? As my project was older … I had not inherited from this class and the methods were encoded when I downloaded the template … Is changing this can have some power in the AsyncCrudAppService class that bypass this?