Open Closed

Tenant Id not found on module project template #2319


User avatar
0
nhontran created
  • ABP Framework version: v3.3.2
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

Hi, I got tenant Id not found error when working on a module project:

[21:13:26 INF] Request starting HTTP/2.0 OPTIONS https://localhost:44343/api/partners-buddy/category-groups?skipCount=0&maxResultCount=10  
[21:13:26 INF] CORS policy execution successful.
[21:13:26 INF] Request finished in 3.2625ms 204 
[21:13:26 INF] Request starting HTTP/2.0 GET https://localhost:44343/api/partners-buddy/category-groups?skipCount=0&maxResultCount=10  
[21:13:26 INF] CORS policy execution successful.
[21:13:26 INF] Successfully validated the token.
[21:13:26 ERR] Connection ID "18230571301796315688", Request ID "80000229-0002-fd00-b63f-84710c7967bb": An unhandled exception was thrown by the application.
Volo.Abp.BusinessException: Tenant not found!
   at Volo.Abp.MultiTenancy.TenantConfigurationProvider.GetAsync(Boolean saveResolveResult)
   at Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass5_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Volo.Abp.AspNetCore.Security.Claims.AbpClaimsMapMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass5_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass5_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT`1.ProcessRequestAsync()
[21:13:26 INF] Request finished in 10.4021ms 500 

Steps to reproduces:

  1. Create a module project template
  2. Create a list with Abp Suite
  3. set the Multi-Tenancy to true
  4. create a new tenant and login to that tenant
  5. Access the list view just created above
    public static class MultiTenancyConsts
    {
        /* Enable/disable multi-tenancy in a single point
         * to test your module with multi-tenancy.
         */
        public const bool IsEnabled = true;
    }

I also tried login with incognito mode, got the same issue, so cache/cookies is not the root cause

Could you please help us take a look?


12 Answer(s)
  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Hi nhontran

    You're on an outdated version currently. Can you please try on newer versions?


    You can follow Migrations Guides: https://docs.abp.io/en/abp/latest/Migration-Guides/Index

  • User Avatar
    0
    nhontran created

    Hi @enisn, we could not upgrade the version for now.

    Is there a work around to fix this issue on the version 3.3.2?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Can we check it remotely?

    https://zoom.us/j/97802929466?pwd=NUNMaFNZeUJaY3liZkpRc0N6clhQZz09

  • User Avatar
    0
    nhontran created

    Hi @maliming, sure

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    I will test it locally and tell you the result.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi nhontran

    Can you share your project with me? liming.ma@volosoft.com

  • User Avatar
    0
    nhontran created

    Hi @maliming, sure, let me zip and send it to you

  • User Avatar
    0
    nhontran created

    Hi @maliming, Sent.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I have confirmed the problem. Thanks

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi nhontran

    Try to add SaasEntityFrameworkCoreModule to your SHDP.PartnersBuddy.HttpApi.Host

    <PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="3.3.2" />
    
    typeof(SaasEntityFrameworkCoreModule)
    
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    https://github.com/abpframework/abp/pull/11076

  • User Avatar
    0
    nhontran created

    Hi @maliming, the issue has been resolved :)

    Thanks a lot for your support.

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