Activities of "327992883@qq.com"

  • ABP Framework version: v7.2.3
  • UI Type: Blazor Server
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

I upgraded the version of Blazorise. Currently, I am using Blazorise 1.5.3 because I need some components and functions of the new version. However, I see that starting from version 1.4, there will be some limitations without a license.we are using commercial version of abp to develop blazor server application and would like the commercial key please,

  • ABP Framework version: v7.2.3
  • UI Type: Blazor Server
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:
  • In the development and testing environments, there is no reconnect prompt when the page is idle for a long time. However, in the production environment, sometimes there is a reconnect prompt after just a few seconds of inactivity, while other times, it may take several hours without a reconnect prompt. When the service is just restarted, the page remains stable without needing to reconnect for half an hour or even several hours. However, after running for a few hours post-restart, frequent reconnect prompts occur, sometimes less than a minute apart. This is critical in the production environment, and customers have started to complain. The code and configuration in my production and testing environments are identical, with the only difference being the user load and similar factors. I checked the server's memory and CPU usage; memory usage is around 69%, and CPU usage is around 40%.

hi

You can try to get access token from HttpContext in 7.2.3

var httpContext = HttpContextAccessor?.HttpContext; 
if (httpContext == null) 
{ 
    return null; 
} 
 
return await httpContext.GetTokenAsync("access_token"); 

I use this method to get the token, but the result is null

  • ABP Framework version: v7.2.3
  • UI Type: Blazor Server
  • Database System: EF Core (SQL Server,) /
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:
  • This is my code. When I use await _hubContext.Clients.Users(stringUserIds).SendAsync(message.MessageType.ToString(), message); No messages received in blazor page
public async Task SendToUsersAsync<T>(T message) where T : SigalRMessage
 {
     try
     {
         if (!message.UserIds.HasItems())
             return;

         var stringUserIds = message.UserIds.Where(s => !s.IsNullOrEmpty()).Select(x => x.Value.ToString()).ToList();
         await _hubContext.Clients.Users(stringUserIds).SendAsync(message.MessageType.ToString(), message);
     }
     catch (Exception ex)
     {
         _logger.LogError(ex, "error");
     }
 }
protected override async Task OnInitializedAsync()
{
    SetTableOption();

    var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
    var user = authState.User;
    var claims = CurrentUser.GetAllClaims();
    var headers = new Dictionary<string, string>();
    foreach (var claim in claims)
    {
        if (!headers.Keys.Contains(claim.Type))
            headers.Add(claim.Type, claim.Value);
    }

    _userToken = user.FindFirstValue("access_token"); 

    var signalRUrl = "wss://localhost:44320".EnsureEndsWith('/') + Configuration["HubUrl"].TrimStart('/');

    HubConnection = new HubConnectionBuilder()
        .WithUrl(signalRUrl, options =>
        {
            options.Headers = headers;
            options.AccessTokenProvider = () => Task.FromResult(_userToken);
        }).WithAutomaticReconnect().Build();

    // 2. 定义客户端方法以接收服务器消息
    HubConnection.On<SigalRMessage<Dictionary<string, string>>>(SigalRMessageTypeEnum.OrderSyncSuccess.ToString(), async message =>
    {
        await JSRuntime.InvokeVoidAsync("console.log", $"收到sigalr消息:{message.ToJson()} {DateTime.Now:yyyy-MM-dd HH:mm:ss}");
        StateHasChanged(); 
    });

    await HubConnection.StartAsync();
}

I looked at some sample code

 [Inject]
    protected IAbpAccessTokenProvider AccessTokenProvider { get; set; }

    [Inject]
    protected IOptions<ChatBlazorMauiBlazorOptions> ChatBlazorMauiBlazorOptions { get; set; }

    [Inject]
    protected IOptions<AbpRemoteServiceOptions> AbpRemoteServiceOptions { get; set; }

    protected async override Task SetChatHubConnectionAsync()
    {
        var accessToken = await AccessTokenProvider.GetTokenAsync();

        var signalrUrl = ChatBlazorMauiBlazorOptions.Value.SignalrUrl ?? AbpRemoteServiceOptions.Value.RemoteServices.Default.BaseUrl;

        HubConnection = new HubConnectionBuilder()
            .WithUrl(signalrUrl.EnsureEndsWith('/') + "signalr-hubs/chat", options =>
            {
                options.AccessTokenProvider = () => Task.FromResult(accessToken);
            })
            .Build();
    }

But IAbpAccessTokenProvider does not seem to exist in abp7.2.3 version

Will it work if you comment app.UseErrorPage(); ?

It's normal, thank you.

Could you share the full logs? (both local and deployed) thanks. server logs : 2024-04-01 15:32:49.553 +08:00 [WRN] ---------- RemoteServiceErrorInfo ---------- { "code": "Volo.Authorization:010001", "message": "Authorization failed! Given policy has not granted.", "details": null, "data": {}, "validationErrors": null } 2024-04-01 15:32:49.554 +08:00 [WRN] Exception of type 'Volo.Abp.Authorization.AbpAuthorizationException' was thrown. Volo.Abp.Authorization.AbpAuthorizationException: Exception of type 'Volo.Abp.Authorization.AbpAuthorizationException' was thrown. at Microsoft.AspNetCore.Authorization.AbpAuthorizationServiceExtensions.CheckAsync(IAuthorizationService authorizationService, AuthorizationPolicy policy) at Volo.Abp.Authorization.MethodInvocationAuthorizationService.CheckAsync(MethodInvocationAuthorizationContext context) at Volo.Abp.Authorization.AuthorizationInterceptor.AuthorizeAsync(IAbpMethodInvocation invocation) at Volo.Abp.Authorization.AuthorizationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync() at Volo.Abp.GlobalFeatures.GlobalFeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync() at Volo.Abp.Auditing.AuditingInterceptor.ProceedByLoggingAsync(IAbpMethodInvocation invocation, AbpAuditingOptions options, IAuditingHelper auditingHelper, IAuditLogScope auditLogScope) at Volo.Abp.Auditing.AuditingInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync() at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed) at lambda_method5145(Closure, Object) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.&lt;InvokeActionMethodAsync&gt;g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) 2024-04-01 15:32:49.556 +08:00 [WRN] Code:Volo.Authorization:010001 2024-04-01 15:32:49.556 +08:00 [INF] AuthenticationScheme: Identity.Application was challenged. 2024-04-01 15:32:49.556 +08:00 [INF] Executed action PDT.Platform.Controllers.QuarantineRecords.QuarantineRecordController.GetListAsync (PDT.Platform.HttpApi) in 8.3655ms 2024-04-01 15:32:49.556 +08:00 [INF] Executed endpoint 'PDT.Platform.Controllers.QuarantineRecords.QuarantineRecordController.GetListAsync (PDT.Platform.HttpApi)' 2024-04-01 15:32:49.578 +08:00 [INF] Request finished HTTP/1.0 GET http://pdtapi.loda.net.cn/api/quarantine-records/backend/getlist application/json - - 302 0 - 35.3289ms 2024-04-01 15:32:49.593 +08:00 [INF] Request starting HTTP/1.0 GET http://pdtapi.loda.net.cn/Error?httpStatusCode=401 - - 2024-04-01 15:32:49.596 +08:00 [INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Controllers.ErrorController.Index (Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared)' 2024-04-01 15:32:49.596 +08:00 [INF] Route matched with {action = "Index", controller = "Error", area = "", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Microsoft.AspNetCore.Mvc.IActionResult] Index(Int32) on controller Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Controllers.ErrorController (Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared). 2024-04-01 15:32:49.597 +08:00 [INF] Executing ViewResult, running view ~/Views/Error/401.cshtml. 2024-04-01 15:32:49.598 +08:00 [WRN] The cookie 'XSRF-TOKEN' has set 'SameSite=None' and must also set 'Secure'. 2024-04-01 15:32:49.601 +08:00 [INF] Executed ViewResult - view ~/Views/Error/401.cshtml executed in 3.984ms.

<br> local logs: 2024-04-01 15:30:55.682 +08:00 [WRN] ---------- RemoteServiceErrorInfo ---------- { "code": "Volo.Authorization:010001", "message": "Authorization failed! Given policy has not granted.", "details": null, "data": {}, "validationErrors": null } 2024-04-01 15:30:55.682 +08:00 [WRN] Exception of type 'Volo.Abp.Authorization.AbpAuthorizationException' was thrown. Volo.Abp.Authorization.AbpAuthorizationException: Exception of type 'Volo.Abp.Authorization.AbpAuthorizationException' was thrown. at Microsoft.AspNetCore.Authorization.AbpAuthorizationServiceExtensions.CheckAsync(IAuthorizationService authorizationService, AuthorizationPolicy policy) at Volo.Abp.Authorization.MethodInvocationAuthorizationService.CheckAsync(MethodInvocationAuthorizationContext context) at Volo.Abp.Authorization.AuthorizationInterceptor.AuthorizeAsync(IAbpMethodInvocation invocation) at Volo.Abp.Authorization.AuthorizationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync() at Volo.Abp.GlobalFeatures.GlobalFeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync() at Volo.Abp.Auditing.AuditingInterceptor.ProceedByLoggingAsync(IAbpMethodInvocation invocation, AbpAuditingOptions options, IAuditingHelper auditingHelper, IAuditLogScope auditLogScope) at Volo.Abp.Auditing.AuditingInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync() at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed) at lambda_method3659(Closure, Object) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.&lt;InvokeActionMethodAsync&gt;g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) 2024-04-01 15:30:55.682 +08:00 [WRN] Code:Volo.Authorization:010001 2024-04-01 15:30:55.683 +08:00 [INF] AuthenticationScheme: Identity.Application was challenged. 2024-04-01 15:30:55.683 +08:00 [INF] Executed action PDT.Platform.Controllers.QuarantineRecords.QuarantineRecordController.GetListAsync (PDT.Platform.HttpApi) in 11.8705ms 2024-04-01 15:30:55.683 +08:00 [INF] Executed endpoint 'PDT.Platform.Controllers.QuarantineRecords.QuarantineRecordController.GetListAsync (PDT.Platform.HttpApi)' 2024-04-01 15:30:55.727 +08:00 [DBG] Added 0 entity changes to the current audit log 2024-04-01 15:30:55.729 +08:00 [DBG] Added 0 entity changes to the current audit log 2024-04-01 15:30:55.731 +08:00 [INF] Request finished HTTP/1.1 GET https://localhost:44312/api/quarantine-records/backend/getlist application/json 328 - 401 - - 68.1606ms 2024-04-01 15:31:04.981 +08:00 [DBG] Executing HealthCheck collector HostedService. 2024-04-01 15:31:04.982 +08:00 [INF] Start processing HTTP request GET https://localhost:44312/health-status 2024-04-01 15:31:04.982 +08:00 [INF] Sending HTTP request GET https://localhost:44312/health-status

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, and please first use the search on the homepage. Provide us with the following info:

  • ABP Framework version: v7.2.3
    • Database System: EF Core
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace:
  • Steps to reproduce the issue:API Unauthorized 401 Redirection Error,My goal is not to redirect, just return to the normal HTTP state,I added the request header X-Requested With: XMLHttpRequest, which works normally during local debugging, but when deployed to the server using nginx reverse proxy, it has no effect. Still redirect the login page.

Hi,you can try running the project and stay on the testing book list. After an hour of token expiration, clicking the query button again will cause the page to flicker continuously until the program crashes.

hi

The page will keep flashing. AbpComponentsBase is not used, but a custom base class, in which the exception handling code:

Please share a test template project with your custom code. liming.ma@volosoft.com

Thanks.

Already send for your email

Showing 1 to 10 of 45 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 01, 2024, 05:35