abp icon indicating copy to clipboard operation
abp copied to clipboard

Data Seeding for Host Tenant Missing

Open zaktecs opened this issue 6 years ago • 7 comments

Hi,

I have just followed the process here

https://docs.abp.io/en/abp/latest/Getting-Started?UI=MVC&DB=EF&Tiered=No

to create a new project but it failed to create the host tenant, hence when I try to run it gives a missing tenant error message

Kind Regards, Zak

zaktecs avatar May 09 '20 19:05 zaktecs

Please show the error message.

realLiangshiwei avatar May 10 '20 03:05 realLiangshiwei

An unhandled exception occurred while processing the request. BusinessException: Tenant not found! Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)

Stack Query Cookies Headers Routing BusinessException: Tenant not found! Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass5_1+<b__1>d.MoveNext() Microsoft.AspNetCore.Builder.ApplicationBuilderAbpJwtTokenMiddlewareExtension+<>c__DisplayClass0_0+<b__0>d.MoveNext() Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

zaktecs avatar May 15 '20 15:05 zaktecs

Tenant not found!

Can you provide steps to reproduce the problem?

realLiangshiwei avatar May 16 '20 01:05 realLiangshiwei

I have exact the same problem. I just started new project like the docs said :

  1. abp new Acme.BookStore --template app --database-provider ef --ui mvc --mobile none
  2. right click on the Acme.BookStore.DbMigrator and click Debug > Start New Instance. This created tables successfully.
  3. run Application

and result 👎 - Looks like no tenant seeding in db migration process. Should we create manually?

An unhandled exception occurred while processing the request. BusinessException: Tenant not found! Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)

Stack Query Cookies Headers Routing BusinessException: Tenant not found! Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass5_1+<b__1>d.MoveNext() Microsoft.AspNetCore.Builder.ApplicationBuilderAbpJwtTokenMiddlewareExtension+<>c__DisplayClass0_0+<b__0>d.MoveNext() Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass5_1+<b__1>d.MoveNext() Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Show raw exception details Volo.Abp.BusinessException: Tenant not found! at Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass5_1.<b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Builder.ApplicationBuilderAbpJwtTokenMiddlewareExtension.<>c__DisplayClass0_0.<b__0>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.<b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

codebycinar avatar May 27 '20 19:05 codebycinar

I have exact the same problem. I just started new project like the docs said :

  1. abp new Acme.BookStore --template app --database-provider ef --ui mvc --mobile none
  2. right click on the Acme.BookStore.DbMigrator and click Debug > Start New Instance. This created tables successfully.
  3. run Application

and result 👎 - Looks like no tenant seeding in db migration process. Should we create manually?

An unhandled exception occurred while processing the request. BusinessException: Tenant not found! Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)

Ok, this issue related with cookies. I might be create and try abp framework app before and that have some cookies. When i deleted cookies, voilaaa app works!

Thanks for being awesome.

codebycinar avatar May 27 '20 19:05 codebycinar

@zaktecs How did you solve this problem? I had the same problem. I'm using 3.3.0.rc.1.

xdmushui avatar Oct 24 '20 15:10 xdmushui

Hi Mason,

You have to delete your cookies. if you press F12 => Application => Select Cookies and delete cookies => Fress F5

Cheers,

Zak

On Sat, Oct 24, 2020 at 4:57 PM Mason [email protected] wrote:

@zaktecs https://github.com/zaktecs How did you solve this problem? I had the same problem. I'm using 3.3.0.rc.1.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/abpframework/abp/issues/3888#issuecomment-715953962, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNC54T6OKF5DEBVOOPBJWLSML2M7ANCNFSM4M45TR6A .

zaktecs avatar Oct 24 '20 18:10 zaktecs