gpt4 book ai didi

mysql - Abp.AbpException : There is no tenant with given id: 2 异常

转载 作者:行者123 更新时间:2023-11-30 21:35:28 25 4
gpt4 key购买 nike

启动模板项目时出错: Abp.AbpException :

There is no tenant with given id: 2

我检查了数据库,有默认租户和用户被创建。但未能加载 Swagger,出现错误:

Fetch errorInternal Server Error http://localhost:21021/swagger/v1/swagger.json.

检查了 txt 日志,下面是错误堆栈,我很困惑租户 id 2 传递到哪里。

ERROR 2019-01-09 14:54:25,221 [7 ] Microsoft.AspNetCore.Server.Kestrel - Connection id "0HLJLVT04BST8", Request id "0HLJLVT04BST8:00000003": An unhandled exception was thrown by the application. Abp.AbpException: There is no tenant with given id: 2 at Abp.MultiTenancy.TenantCache2.Get(Int32 tenantId) in D:\Github\aspnetboilerplate\src\Abp.Zero.Common\MultiTenancy\TenantCache.cs:line 35
at Castle.Proxies.Invocations.TenantCache
2_Get.InvokeMethodOnTarget() at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.Proxies.TenantCache2Proxy.Get(Int32 tenantId)
at Abp.Zero.EntityFrameworkCore.DbPerTenantConnectionStringResolver.GetNameOrConnectionString(DbPerTenantConnectionStringResolveArgs args) in D:\Github\aspnetboilerplate\src\Abp.ZeroCore.EntityFrameworkCore\Zero\EntityFrameworkCore\DbPerTenantConnectionStringResolver.cs:line 50
at Abp.Zero.EntityFrameworkCore.DbPerTenantConnectionStringResolver.GetNameOrConnectionString(ConnectionStringResolveArgs args) in D:\Github\aspnetboilerplate\src\Abp.ZeroCore.EntityFrameworkCore\Zero\EntityFrameworkCore\DbPerTenantConnectionStringResolver.cs:line 45
at Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.GetOrCreateDbContext[TDbContext](Nullable
1 multiTenancySide, String name) in D:\Github\aspnetboilerplate\src\Abp.EntityFrameworkCore\EntityFrameworkCore\Uow\EfCoreUnitOfWork.cs:line 107 at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.get_Table() in D:\Github\aspnetboilerplate\src\Abp.EntityFrameworkCore\EntityFrameworkCore\Repositories\EfCoreRepositoryBaseOfTEntityAndTPrimaryKey.cs:line 39
at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase
3.GetAllIncluding(Expression1[] propertySelectors) in D:\Github\aspnetboilerplate\src\Abp.EntityFrameworkCore\EntityFrameworkCore\Repositories\EfCoreRepositoryBaseOfTEntityAndTPrimaryKey.cs:line 88
at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase
3.GetAllListAsync(Expression1 predicate) in D:\Github\aspnetboilerplate\src\Abp.EntityFrameworkCore\EntityFrameworkCore\Repositories\EfCoreRepositoryBaseOfTEntityAndTPrimaryKey.cs:line 108
at Abp.Threading.InternalAsyncHelper.AwaitTaskWithPostActionAndFinallyAndGetResult[T](Task
1 actualReturnValue, Func1 postAction, Action1 finalAction) at Abp.Configuration.SettingStore.GetAllListAsync(Nullable1 tenantId, Nullable1 userId) in D:\Github\aspnetboilerplate\src\Abp.Zero.Common\Configuration\SettingStore.cs:line 40 at Abp.Threading.InternalAsyncHelper.AwaitTaskWithPostActionAndFinallyAndGetResult[T](Task1 actualReturnValue, Func1 postAction, Action1 finalAction)
at Abp.Configuration.SettingManager.<>c__DisplayClass40_0.<<GetUserSettingsFromCache>b__0>d.MoveNext() in D:\Github\aspnetboilerplate\src\Abp\Configuration\SettingManager.cs:line 436
--- End of stack trace from previous location where exception was thrown ---
at Abp.Runtime.Caching.CacheExtensions.<>c__DisplayClass9_0
2.<b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Abp.Runtime.Caching.CacheBase.GetAsync(String key, Func2 factory) in D:\Github\aspnetboilerplate\src\Abp\Runtime\Caching\CacheBase.cs:line 182
at Abp.Runtime.Caching.CacheExtensions.GetAsync[TKey,TValue](ICache cache, TKey key, Func
2 factory) in D:\Github\aspnetboilerplate\src\Abp\Runtime\Caching\CacheExtensions.cs:line 60 at Abp.Configuration.SettingManager.GetUserSettingsFromCache(UserIdentifier user) in D:\Github\aspnetboilerplate\src\Abp\Configuration\SettingManager.cs:line 430 at Abp.Configuration.SettingManager.GetReadOnlyUserSettings(UserIdentifier user) in D:\Github\aspnetboilerplate\src\Abp\Configuration\SettingManager.cs:line 403 at Abp.Configuration.SettingManager.GetSettingValueForUserOrNullAsync(UserIdentifier user, String name) in D:\Github\aspnetboilerplate\src\Abp\Configuration\SettingManager.cs:line 373 at Abp.Configuration.SettingManager.GetSettingValueInternalAsync(String name, Nullable1 tenantId, Nullable1 userId, Boolean fallbackToDefault) in D:\Github\aspnetboilerplate\src\Abp\Configuration\SettingManager.cs:line 235 at Abp.AspNetCore.Localization.AbpUserRequestCultureProvider.DetermineProviderCultureResult(HttpContext httpContext) in D:\Github\aspnetboilerplate\src\Abp.AspNetCore\AspNetCore\Localization\AbpUserRequestCultureProvider.cs:line 29 at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.Invoke(HttpContext context) at Abp.AspNetCore.Security.AbpSecurityHeadersMiddleware.Invoke(HttpContext httpContext) in D:\Github\aspnetboilerplate\src\Abp.AspNetCore\AspNetCore\Security\AbpSecurityHeadersMiddleware.cs:line 26 at Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application) INFO 2019-01-09 14:54:25,227 [7 ] soft.AspNetCore.Hosting.Internal.WebHost - Request finished in 182.7895ms 500

最佳答案

是昨天给swagger授权的浏览器Swagger缓存问题。

最好清除浏览器缓存。这就是租户 ID 为 2 的原因。

关于mysql - Abp.AbpException : There is no tenant with given id: 2 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54104739/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com