Activities of "duyan11110"

  • ABP Framework version: v8.0.0
  • UI Type: MVC
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace: I am upgrading ABP from v7.3.0 to v8.0.0 and getting this error when login. Pls help
[web_bd1ce1f9-2]: [18:00:24 INF] Request starting HTTP/1.1 GET http://mzh.mhibs.web:7004/Account/Login - null null
[web_bd1ce1f9-2]: [18:00:24 INF] Executing endpoint 'MZH.MHIBS.Web.Controllers.AccountController.Login (MZH.MHIBS.Web)'
[web_bd1ce1f9-2]: [18:00:24 INF] Route matched with {action = "Login", controller = "Account", area = "", page = ""}. Executing controller action with signature Microsoft.AspNetCore.Mvc.ActionResult Login(System.String, System.String) on controller MZH.MHIBS.Web.Controllers.AccountController (MZH.MHIBS.Web).
[web_bd1ce1f9-2]: [18:00:24 INF] Executing action method MZH.MHIBS.Web.Controllers.AccountController.Login (MZH.MHIBS.Web) - Validation state: Valid
[web_bd1ce1f9-2]: [18:00:24 INF] Executed action method MZH.MHIBS.Web.Controllers.AccountController.Login (MZH.MHIBS.Web), returned result Microsoft.AspNetCore.Mvc.ChallengeResult in 0.037ms.
[web_bd1ce1f9-2]: [18:00:24 INF] Executing ChallengeResult with authentication schemes (["oidc"]).
[web_bd1ce1f9-2]: [18:00:24 INF] AuthenticationScheme: oidc was challenged.
[web_bd1ce1f9-2]: [18:00:24 INF] Executed action MZH.MHIBS.Web.Controllers.AccountController.Login (MZH.MHIBS.Web) in 4.7096ms
[web_bd1ce1f9-2]: [18:00:24 INF] Executed endpoint 'MZH.MHIBS.Web.Controllers.AccountController.Login (MZH.MHIBS.Web)'
[web_bd1ce1f9-2]: [18:00:24 INF] Request finished HTTP/1.1 GET http://mzh.mhibs.web:7004/Account/Login - 302 0 null 5.572ms
[web_bd1ce1f9-2]: [18:00:25 INF] Request starting HTTP/1.1 POST http://mzh.mhibs.web:7004/signin-oidc - application/x-www-form-urlencoded 1586
[web_bd1ce1f9-2]: [18:00:25 WRN] '.AspNetCore.Correlation.zwwe_Ao2xW7750a7k0U1t8rW5pCQMvknu6aP7K0j1kw' cookie not found.
[web_bd1ce1f9-2]: [18:00:25 INF] Error from RemoteAuthentication: Correlation failed..
[web_bd1ce1f9-2]: [18:00:25 ERR] An unhandled exception has occurred while executing the request.
[web_bd1ce1f9-2]: Microsoft.AspNetCore.Authentication.AuthenticationFailureException: An error was encountered while handling the remote login.
[web_bd1ce1f9-2]: ---> Microsoft.AspNetCore.Authentication.AuthenticationFailureException: Correlation failed.
[web_bd1ce1f9-2]: --- End of inner exception stack trace ---
[web_bd1ce1f9-2]: at Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler`1.HandleRequestAsync()
[web_bd1ce1f9-2]: at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
[web_bd1ce1f9-2]: at Prometheus.HttpMetrics.HttpRequestDurationMiddleware.Invoke(HttpContext context)
[web_bd1ce1f9-2]: at Prometheus.HttpMetrics.HttpRequestCountMiddleware.Invoke(HttpContext context)
[web_bd1ce1f9-2]: at Prometheus.HttpMetrics.HttpInProgressMiddleware.Invoke(HttpContext context)
[web_bd1ce1f9-2]: at Volo.Abp.AspNetCore.Security.AbpSecurityHeadersMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
[web_bd1ce1f9-2]: at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()
[web_bd1ce1f9-2]: --- End of stack trace from previous location ---
[web_bd1ce1f9-2]: at Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
[web_bd1ce1f9-2]: at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()
[web_bd1ce1f9-2]: --- End of stack trace from previous location ---
[web_bd1ce1f9-2]: at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
[web_bd1ce1f9-2]: at Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
[web_bd1ce1f9-2]: at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()
[web_bd1ce1f9-2]: --- End of stack trace from previous location ---
[web_bd1ce1f9-2]: at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
[web_bd1ce1f9-2]: [18:00:25 INF] Request finished HTTP/1.1 POST http://mzh.mhibs.web:7004/signin-oidc - 500 null text/html; charset=utf-8 5.2675ms
  • ABP Framework version: v7.3.0
  • UI Type: MVC
  • Database System: EF Core (SQL Serve)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes

Currently, I would like to call app services from my old .net 4.8 winform app. Is it possible? I tried, but got this error:

Severity	Code	Description	Project	File	Line	Suppression State
Error	CS1705	Assembly 'MZH.MHIBS.SftpGatewayService.HttpApi.Client' with identity 'MZH.MHIBS.SftpGatewayService.HttpApi.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Runtime' with identity 'System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'	AbpClient	E:\SourceCode\AbpClient\AbpClient\CSC	1	Active

Is there any to call like that? If not, pls tell me how to call authorized app services with HttpClient? Thank you.

Hi, Just call RefreshManyAsync above to refresh or other method?

Hi, So that means there is no way to refresh the cache immediately, right?

Hi,

Can I use RefreshManyAsync method of IDistributedCache<PermissionGrantCacheItem> to refresh the cache whenever I change permissions?

I don't understand why RemoveManyAsync not work when deploying on K8s?

Hi,

Removing distributed cache with above method call when deploying on K8s does not affect immediately. The cache is refreshed after 5 minutes (I guess). Is there anything I have to do? How to remove old cache immediately after changing permissions?

Hi,

Thanks for your suggestion. I inject IDistributedCache<PermissionGrantCacheItem> and call it's RemoveManyAsync method => it works perfectly now.

Hi,

It works now. The Id need to be uppercase: .RequirePermissions(menuItem.Id.ToString().ToUpper()), but when I refresh the page, the granted menus are not displayed immediately. I have to manually clear redis cache. So, which is the right method I have to call to refresh the cache when changing permissions?

Hi,

I don't see any error.

[administration-service_76245987-4]: [13:30:52 DBG] Executed AbpApplicationConfigurationAppService.GetAsync().
[administration-service_76245987-4]: [13:30:52 INF] Executed action method Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc), returned result Microsoft.AspNetCore.Mvc.ObjectResult in 103.9099ms.
[administration-service_76245987-4]: [13:30:52 INF] Executing ObjectResult, writing value of type 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto'.
[administration-service_76245987-4]: [13:30:52 INF] Executed action Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc) in 106.7414ms
[administration-service_76245987-4]: [13:30:52 INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
[administration-service_76245987-4]: [13:30:52 INF] Request finished HTTP/1.1 GET http://mzh.mhibs.administrationservice.httpapi.host:7001/api/abp/application-configuration?IncludeLocalizationResources=False&api-version=1.0 - - - 200 - application/json;+charset=utf-8 110.7096ms
[administration-service_76245987-4]: [13:30:52 INF] Request starting HTTP/1.1 GET http://mzh.mhibs.administrationservice.httpapi.host:7001/api/abp/application-localization?CultureName=en&OnlyDynamics=True&api-version=1.0 - -
[administration-service_76245987-4]: [13:30:52 INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationLocalizationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
[administration-service_76245987-4]: [13:30:52 INF] Route matched with {area = "abp", action = "Get", controller = "AbpApplicationLocalization", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationDto] GetAsync(Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationRequestDto) on controller Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationLocalizationController (Volo.Abp.AspNetCore.Mvc).
[administration-service_76245987-4]: [13:30:52 INF] Executing action method Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationLocalizationController.GetAsync (Volo.Abp.AspNetCore.Mvc) - Validation state: Valid
[administration-service_76245987-4]: [13:30:52 INF] Executed action method Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationLocalizationController.GetAsync (Volo.Abp.AspNetCore.Mvc), returned result Microsoft.AspNetCore.Mvc.ObjectResult in 132.7568ms.
[administration-service_76245987-4]: [13:30:52 INF] Executing ObjectResult, writing value of type 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationDto'.
[administration-service_76245987-4]: [13:30:52 INF] Executed action Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationLocalizationController.GetAsync (Volo.Abp.AspNetCore.Mvc) in 134.5931ms
[administration-service_76245987-4]: [13:30:52 INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationLocalizationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
[administration-service_76245987-4]: [13:30:52 INF] Request finished HTTP/1.1 GET http://mzh.mhibs.administrationservice.httpapi.host:7001/api/abp/application-localization?CultureName=en&OnlyDynamics=True&api-version=1.0 - - - 200 - application/json;+charset=utf-8 138.5244ms
[administration-service_76245987-4]: [13:30:52 INF] Request starting HTTP/1.1 GET http://mzh.mhibs.administrationservice.httpapi.host:7001/api/administration-service/menu-item/menu?api-version=1.0 - -
[administration-service_76245987-4]: [13:30:53 DBG] PermissionStore.GetCacheItemAsync: pn:U,pk:67382431-cb1b-e66f-3384-3a0a1b180a20,n:AdministrationService.MenuItems
[administration-service_76245987-4]: [13:30:53 DBG] Found in the cache: pn:U,pk:67382431-cb1b-e66f-3384-3a0a1b180a20,n:AdministrationService.MenuItems
[administration-service_76245987-4]: [13:30:53 DBG] PermissionStore.GetCacheItemAsync: pn:R,pk:admin,n:AdministrationService.MenuItems
[administration-service_76245987-4]: [13:30:53 DBG] Found in the cache: pn:R,pk:admin,n:AdministrationService.MenuItems
[administration-service_76245987-4]: [13:30:53 DBG] PermissionStore.GetCacheItemAsync: pn:C,pk:Web.DockerHttpCore,n:AdministrationService.MenuItems
[administration-service_76245987-4]: [13:30:53 DBG] Found in the cache: pn:C,pk:Web.DockerHttpCore,n:AdministrationService.MenuItems
[administration-service_76245987-4]: [13:30:53 INF] Executing endpoint 'MZH.MHIBS.AdministrationService.Menus.MenuItemAppService.GetAllMenuAsync (MZH.MHIBS.AdministrationService.Application)'
[administration-service_76245987-4]: [13:30:53 INF] Route matched with {action = "GetAllMenu", controller = "MenuItem", area = "", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[System.Collections.Generic.List`1[MZH.MHIBS.AdministrationService.Menus.MenuItemDto]] GetAllMenuAsync() on controller MZH.MHIBS.AdministrationService.Menus.MenuItemAppService (MZH.MHIBS.AdministrationService.Application).
[administration-service_76245987-4]: [13:30:53 INF] Executing action method MZH.MHIBS.AdministrationService.Menus.MenuItemAppService.GetAllMenuAsync (MZH.MHIBS.AdministrationService.Application) - Validation state: Valid
[administration-service_76245987-4]: [13:30:53 INF] Executed action method MZH.MHIBS.AdministrationService.Menus.MenuItemAppService.GetAllMenuAsync (MZH.MHIBS.AdministrationService.Application), returned result Microsoft.AspNetCore.Mvc.ObjectResult in 4.5297ms.
[administration-service_76245987-4]: [13:30:53 DBG] Added 0 entity changes to the current audit log
[administration-service_76245987-4]: [13:30:53 INF] Executing ObjectResult, writing value of type 'System.Collections.Generic.List`1[[MZH.MHIBS.AdministrationService.Menus.MenuItemDto, MZH.MHIBS.AdministrationService.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]'.
[administration-service_76245987-4]: [13:30:53 INF] Executed action MZH.MHIBS.AdministrationService.Menus.MenuItemAppService.GetAllMenuAsync (MZH.MHIBS.AdministrationService.Application) in 9.1316ms
[administration-service_76245987-4]: [13:30:53 INF] Executed endpoint 'MZH.MHIBS.AdministrationService.Menus.MenuItemAppService.GetAllMenuAsync (MZH.MHIBS.AdministrationService.Application)'
[administration-service_76245987-4]: [13:30:53 DBG] Added 0 entity changes to the current audit log
[administration-service_76245987-4]: [13:30:53 INF] Request finished HTTP/1.1 GET http://mzh.mhibs.administrationservice.httpapi.host:7001/api/administration-service/menu-item/menu?api-version=1.0 - - - 200 - application/json;+charset=utf-8 20.4294ms
[administration-service_76245987-4]: [13:30:53 INF] Request starting HTTP/1.1 GET http://mzh.mhibs.administrationservice.httpapi.host:7001/api/administration-service/menu-item/menu?api-version=1.0 - -
[administration-service_76245987-4]: [13:30:53 DBG] PermissionStore.GetCacheItemAsync: pn:U,pk:67382431-cb1b-e66f-3384-3a0a1b180a20,n:AdministrationService.MenuItems
[administration-service_76245987-4]: [13:30:53 DBG] Found in the cache: pn:U,pk:67382431-cb1b-e66f-3384-3a0a1b180a20,n:AdministrationService.MenuItems
[administration-service_76245987-4]: [13:30:53 DBG] PermissionStore.GetCacheItemAsync: pn:R,pk:admin,n:AdministrationService.MenuItems
[administration-service_76245987-4]: [13:30:53 DBG] Found in the cache: pn:R,pk:admin,n:AdministrationService.MenuItems
[administration-service_76245987-4]: [13:30:53 DBG] PermissionStore.GetCacheItemAsync: pn:C,pk:Web.DockerHttpCore,n:AdministrationService.MenuItems
[administration-service_76245987-4]: [13:30:53 DBG] Found in the cache: pn:C,pk:Web.DockerHttpCore,n:AdministrationService.MenuItems
[administration-service_76245987-4]: [13:30:53 INF] Executing endpoint 'MZH.MHIBS.AdministrationService.Menus.MenuItemAppService.GetAllMenuAsync (MZH.MHIBS.AdministrationService.Application)'
[administration-service_76245987-4]: [13:30:53 INF] Route matched with {action = "GetAllMenu", controller = "MenuItem", area = "", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[System.Collections.Generic.List`1[MZH.MHIBS.AdministrationService.Menus.MenuItemDto]] GetAllMenuAsync() on controller MZH.MHIBS.AdministrationService.Menus.MenuItemAppService (MZH.MHIBS.AdministrationService.Application).
[administration-service_76245987-4]: [13:30:53 INF] Executing action method MZH.MHIBS.AdministrationService.Menus.MenuItemAppService.GetAllMenuAsync (MZH.MHIBS.AdministrationService.Application) - Validation state: Valid
[administration-service_76245987-4]: [13:30:53 INF] Executed action method MZH.MHIBS.AdministrationService.Menus.MenuItemAppService.GetAllMenuAsync (MZH.MHIBS.AdministrationService.Application), returned result Microsoft.AspNetCore.Mvc.ObjectResult in 5.0168ms.
[administration-service_76245987-4]: [13:30:53 DBG] Added 0 entity changes to the current audit log
[administration-service_76245987-4]: [13:30:53 INF] Executing ObjectResult, writing value of type 'System.Collections.Generic.List`1[[MZH.MHIBS.AdministrationService.Menus.MenuItemDto, MZH.MHIBS.AdministrationService.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]'.
[administration-service_76245987-4]: [13:30:53 INF] Executed action MZH.MHIBS.AdministrationService.Menus.MenuItemAppService.GetAllMenuAsync (MZH.MHIBS.AdministrationService.Application) in 8.5125ms
[administration-service_76245987-4]: [13:30:53 INF] Executed endpoint 'MZH.MHIBS.AdministrationService.Menus.MenuItemAppService.GetAllMenuAsync (MZH.MHIBS.AdministrationService.Application)'
[administration-service_76245987-4]: [13:30:53 DBG] Added 0 entity changes to the current audit log
[administration-service_76245987-4]: [13:30:53 INF] Request finished HTTP/1.1 GET http://mzh.mhibs.administrationservice.httpapi.host:7001/api/administration-service/menu-item/menu?api-version=1.0 - - - 200 - application/json;+charset=utf-8 24.7428ms
[administration-service_76245987-4]: [13:30:53 INF] Request starting HTTP/1.1 GET http://mzh.mhibs.administrationservice.httpapi.host:7001/api/administration-service/menu-item/menu?api-version=1.0 - -
[administration-service_76245987-4]: [13:30:53 DBG] PermissionStore.GetCacheItemAsync: pn:U,pk:67382431-cb1b-e66f-3384-3a0a1b180a20,n:AdministrationService.MenuItems
[administration-service_76245987-4]: [13:30:53 DBG] Found in the cache: pn:U,pk:67382431-cb1b-e66f-3384-3a0a1b180a20,n:AdministrationService.MenuItems
[administration-service_76245987-4]: [13:30:53 DBG] PermissionStore.GetCacheItemAsync: pn:R,pk:admin,n:AdministrationService.MenuItems
[administration-service_76245987-4]: [13:30:53 DBG] Found in the cache: pn:R,pk:admin,n:AdministrationService.MenuItems
[administration-service_76245987-4]: [13:30:53 DBG] PermissionStore.GetCacheItemAsync: pn:C,pk:Web.DockerHttpCore,n:AdministrationService.MenuItems
[administration-service_76245987-4]: [13:30:53 DBG] Found in the cache: pn:C,pk:Web.DockerHttpCore,n:AdministrationService.MenuItems
[administration-service_76245987-4]: [13:30:53 INF] Executing endpoint 'MZH.MHIBS.AdministrationService.Menus.MenuItemAppService.GetAllMenuAsync (MZH.MHIBS.AdministrationService.Application)'
[administration-service_76245987-4]: [13:30:53 INF] Route matched with {action = "GetAllMenu", controller = "MenuItem", area = "", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[System.Collections.Generic.List`1[MZH.MHIBS.AdministrationService.Menus.MenuItemDto]] GetAllMenuAsync() on controller MZH.MHIBS.AdministrationService.Menus.MenuItemAppService (MZH.MHIBS.AdministrationService.Application).
[administration-service_76245987-4]: [13:30:53 INF] Executing action method MZH.MHIBS.AdministrationService.Menus.MenuItemAppService.GetAllMenuAsync (MZH.MHIBS.AdministrationService.Application) - Validation state: Valid
[administration-service_76245987-4]: [13:30:53 INF] Executed action method MZH.MHIBS.AdministrationService.Menus.MenuItemAppService.GetAllMenuAsync (MZH.MHIBS.AdministrationService.Application), returned result Microsoft.AspNetCore.Mvc.ObjectResult in 5.5035ms.
[administration-service_76245987-4]: [13:30:53 DBG] Added 0 entity changes to the current audit log
[administration-service_76245987-4]: [13:30:53 INF] Executing ObjectResult, writing value of type 'System.Collections.Generic.List`1[[MZH.MHIBS.AdministrationService.Menus.MenuItemDto, MZH.MHIBS.AdministrationService.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]'.
[administration-service_76245987-4]: [13:30:53 INF] Executed action MZH.MHIBS.AdministrationService.Menus.MenuItemAppService.GetAllMenuAsync (MZH.MHIBS.AdministrationService.Application) in 9.3429ms
[administration-service_76245987-4]: [13:30:53 INF] Executed endpoint 'MZH.MHIBS.AdministrationService.Menus.MenuItemAppService.GetAllMenuAsync (MZH.MHIBS.AdministrationService.Application)'
[administration-service_76245987-4]: [13:30:53 DBG] Added 0 entity changes to the current audit log
[administration-service_76245987-4]: [13:30:53 INF] Request finished HTTP/1.1 GET http://mzh.mhibs.administrationservice.httpapi.host:7001/api/administration-service/menu-item/menu?api-version=1.0 - - - 200 - application/json;+charset=utf-8 19.2255ms

Hi,

How to reload granted permissions? I call await _dynamicPermissionDefinitionStore.GetPermissionsAsync(); as your suggestion but not work

private ApplicationMenuItem CreateApplicationMenuItem(MenuItemDto menuItem)
{
    return new ApplicationMenuItem(
        menuItem.DisplayName,
        menuItem.DisplayName,
        menuItem.Url,
        menuItem.Icon,
        menuItem.Order,
        menuItem.Target,
        menuItem.ElementId,
        menuItem.CssClass
    ).RequirePermissions(menuItem.Id.ToString());
}

When I remove .RequirePermissions(menuItem.Id.ToString()) the dynamic menu items show correctly

Showing 11 to 20 of 49 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11