Open Closed

Exception while calling profileAppService.GetAsync() #5129


User avatar
0
Dina created
  • ABP Framework version: v7.2.2
  • UI type: MVC
  • DB provider: EF Core
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

Hi,

We have upgraded from abp version 7 to 7.2.2, then we got an exception while calling profileAppService.GetAsync() at the production only

System.InvalidOperationException: The exception handler configured on ExceptionHandlerOptions produced a 404 status response. This InvalidOperationException containing the original exception was thrown since this is often due to a misconfigured ExceptionHandlingPath. If the exception handler is expected to return 404 status responses then set AllowStatusCode404Response to true. ---> Volo.Abp.Http.Client.AbpRemoteCallException: Service Unavailable at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.ThrowExceptionForResponseAsync(HttpResponseMessage response) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync(ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](String methodName, ClientProxyRequestTypeValue arguments) at Volo.Abp.Account.ProfileClientProxy.GetAsync()

Note: we have 2 production servers, only one has this issue and the other is working fine!

Waiting for your reply Thanks.


10 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please share the logs of api or authserver website.

  • User Avatar
    0
    Dina created

    There are no errors in auth logs

    it exists at the public site

    2023-05-28 11:37:43.878 +03:00 [ERR] Connection ID "15060037207077160688", Request ID "800006f1-000c-d100-b63f-84710c7967bb": An unhandled exception was thrown by the application. System.InvalidOperationException: The exception handler configured on ExceptionHandlerOptions produced a 404 status response. This InvalidOperationException containing the original exception was thrown since this is often due to a misconfigured ExceptionHandlingPath. If the exception handler is expected to return 404 status responses then set AllowStatusCode404Response to true. ---> Volo.Abp.Http.Client.AbpRemoteCallException: Service Unavailable at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.ThrowExceptionForResponseAsync(HttpResponseMessage response) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync(ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](ClientProxyRequestContext requestContext) at Volo.Abp.Http.Client.ClientProxying.ClientProxyBase1.RequestAsync[T](String methodName, ClientProxyRequestTypeValue arguments) at Volo.Abp.Account.ProfileClientProxy.GetAsync() at WTIR.EquipmentSharing.Public.Web.Pages.Profile.PersonalInfoModel.OnGetAsync() in D:\Work\Jawda\WTIR\src\Public\WTIR.EquipmentSharing.Public.Web\Pages\Profile\PersonalInfo.cshtml.cs:line 49 at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Convert[T](Object taskAsObject) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Execute(Object receiver, Object[] arguments) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync() at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync() at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Rethrow(PageHandlerExecutedContext context) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeInnerFilterAsync() at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ExceptionContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Volo.Abp.AspNetCore.Serilog.AbpSerilogMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Volo.Abp.AspNetCore.Security.AbpSecurityHeadersMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|8_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task) --- End of inner exception stack trace --- at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.HandleException(HttpContext context, ExceptionDispatchInfo edi) at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|8_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task) at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Volo.CmsKit.Public.Web.DefaultHomePageMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT`1.ProcessRequestAsync() 2023-05-28 11:37:43.878 +03:00 [INF] Request finished HTTP/2 GET https://wtir.local/Profile/PersonalInfo - - - 500 - - 37989.9632ms

    although the user is logged in normally.

  • User Avatar
    0
    Dina created

    also, we have other issues that exist at deployment which work fine in development mode

    We set the default language to be Arabic at the auth server appModule

    app.UseAbpRequestLocalization( options => { options.RequestCultureProviders.RemoveAll(x => x.GetType() == typeof(AcceptLanguageHeaderRequestCultureProvider)); options.SetDefaultCulture("ar-EG"); });

    so it is loaded with the Arabic language correctly on the first page, but when moving to the second one, the language becomes English at the cookies although the currentCulture.RequestCulture.Culture.Name gets the language Arabic correctly!

    and the page is loaded with English language

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    options.SetDefaultCulture("ar-EG");

    Abp has a setting you can set its default value.

    https://github.com/abpframework/abp/blob/22bc56e2794f0f323084df1ea680a1d1bdcded3c/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationSettingNames.cs

    https://docs.abp.io/en/abp/latest/Settings#setting-values-in-the-application-configuration

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    he exception handler configured on ExceptionHandlerOptions produced a 404 status response. This InvalidOperationException containing the original exception was thrown since this is often due to a misconfigured ExceptionHandlingPath. If the exception handler is expected to return 404 status responses then set AllowStatusCode404Response to true.

    Please set the MinimumLevel as Debug to see more logs.

    Maybe the request URL is wrong.

    Program.cs

            Log.Logger = new LoggerConfiguration()
                .MinimumLevel.Debug()
                .Enrich.FromLogContext()
                .WriteTo.Async(c => c.File("Logs/logs.txt"))
                .WriteTo.Async(c => c.Console())
                .CreateLogger();
    
  • User Avatar
    0
    Dina created

    hi

    options.SetDefaultCulture("ar-EG");

    Abp has a setting you can set its default value.

    https://github.com/abpframework/abp/blob/22bc56e2794f0f323084df1ea680a1d1bdcded3c/framework/src/Volo.Abp.Localization/Volo/Abp/Localization/LocalizationSettingNames.cs

    https://docs.abp.io/en/abp/latest/Settings#setting-values-in-the-application-configuration

    The issue is not in setting the default language, it is set to ar-eg correctly and the localization works fine, but the issue is that the AspNetCore.Culture cookie is not correct

    which I depend on while setting the layout to be RTL or LTR

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you try to delete this cookie?

    The app will set the cookie again.

  • User Avatar
    0
    Dina created

    hi

    Can you try to delete this cookie?

    The app will set the cookie again.

    yes sure, after i delete the cookie everything is ok, but the cookie is set again after moving to the second page!

  • User Avatar
    0
    Dina created

    he exception handler configured on ExceptionHandlerOptions produced a 404 status response. This InvalidOperationException containing the original exception was thrown since this is often due to a misconfigured ExceptionHandlingPath. If the exception handler is expected to return 404 status responses then set AllowStatusCode404Response to true.

    Please set the MinimumLevel as Debug to see more logs.

    Maybe the request URL is wrong.

    Program.cs

            Log.Logger = new LoggerConfiguration() 
                .MinimumLevel.Debug() 
                .Enrich.FromLogContext() 
                .WriteTo.Async(c => c.File("Logs/logs.txt")) 
                .WriteTo.Async(c => c.Console()) 
                .CreateLogger(); 
    

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    but the cookie is set again after moving to the second page!

    Is your browser language ar-EG? Can you share an online website so I can reproduce it? liming.ma@volosoft.com

    https://support.google.com/chrome/answer/173424?hl=en&co=GENIE.Platform%3DDesktop

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