Ends in:
4 DAYS
10 HRS
51 MIN
26 SEC
Ends in:
4 D
10 H
51 M
26 S
Open Closed

Cannot request to api/abp/application-configuration from Angular to GatewayWeb #6285


User avatar
0
triet.nguyen created
  • ABP Framework version: v5.2.2
  • NET Framework: 6.0
  • UI Type: Angular
  • Database System: EF Core SQL Server
  • Tiered (for MVC) or Auth Server Separated (for Angular): AuthServer separated for Angular
  • Architecture: Microservices ABP template
  • Steps to reproduce the issue:
    1. Either to open Angular app or Tab browser or Postman
    2. Request to http://gateway-web.mvm.local/api/abp/application-configuration (local custom domain). We use file hosts for the custom domain.
    3. The whole applications are frozen. Minikube cluster is overloading and not reachable.

It's looping and ending up with the log file's size is 24.7 MB. It's just a single request from Angular http://angular.mvm.local to Gateway-Web http://gateway-web.mvm.local/api/abp/application-configuration

The good points are: - We use Gateway-Web Swagger UI, open on Administration Service API and request to http://administration.mvm.local/api/abp/application-configuration is successful. (Figure 1) - We can reach to AuthServer site (Login page) and authorize successfully using Swagger!!! (Figure 2 & 3)

  • ocelot.k8s.json
{
    "GlobalConfiguration": {
        "BaseUrl": "http://gateway-web.mvm.local"
    },
    "Routes": [
        ...,
        {
            "DownstreamHostAndPorts": [
                {
                    "Host": "administration.mvm.local",
                    "Port": 80
                }
            ],
            "DownstreamPathTemplate": "/api/abp/{everything}",
            "DownstreamScheme": "http",
            "ServiceKey": "Administration Service",
            "UpstreamHttpMethod": [
                "Put",
                "Delete",
                "Get",
                "Post"
            ],
            "UpstreamPathTemplate": "/api/abp/{everything}"
        },
        ...
    ]
}

<br/>

  • Figure 1

  • Figure 2

  • Figure 3

<br/> <br/> Please use Control + F on your browser to highlight the logging message message: ocelot pipeline started is looping infinitely. If you want to have a full log. Please access this https://drive.google.com/file/d/1UTuotJqR-i5bmTP-j8G-GM50GfkFnQ5D/view

  • Exception message and full stack trace:
[16:56:54 INF] Now listening on: http://[::]:80
[16:56:54 DBG] Loaded hosting startup assembly mvm.WebGateway
[16:56:54 INF] Application started. Press Ctrl+C to shut down.
[16:56:54 INF] Hosting environment: k8s
[16:56:54 INF] Content root path: /app/
[16:56:54 DBG] Hosting started

...

[17:03:35 DBG] Connection id "0HMVLMCT4QRFB" accepted.
[17:03:35 DBG] Connection id "0HMVLMCT4QRFB" started.
[17:03:35 INF] Request starting HTTP/1.1 GET http://administration.mvm.local/api/abp/application-configuration - 0
[17:03:35 VRB] All hosts are allowed.
[17:03:35 VRB] requestId: no request id, previousRequestId: no previous request id, message: MiddlewareStarting: Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass6_1; /api/abp/application-configuration
[17:03:35 DBG] The request has an origin header: 'http://angular.mvm.local'.
[17:03:35 INF] CORS policy execution successful.
[17:03:35 DBG] The request path  does not match the path filter
[17:03:35 DBG] requestId: 0HMVLMCT4QRFB:00000002, previousRequestId: no previous request id, message: ocelot pipeline started
[17:03:35 DBG] requestId: 0HMVLMCT4QRFB:00000002, previousRequestId: no previous request id, message: Upstream url path is /api/abp/application-configuration
[17:03:35 DBG] requestId: 0HMVLMCT4QRFB:00000002, previousRequestId: no previous request id, message: downstream templates are /api/abp/{everything}
[17:03:35 INF] requestId: 0HMVLMCT4QRFB:00000002, previousRequestId: no previous request id, message: EndpointRateLimiting is not enabled for /api/abp/{everything}
[17:03:35 INF] requestId: 0HMVLMCT4QRFB:00000002, previousRequestId: no previous request id, message: No authentication needed for /api/abp/application-configuration
[17:03:35 INF] requestId: 0HMVLMCT4QRFB:00000002, previousRequestId: no previous request id, message: /api/abp/{everything} route does not require user to be authorized
[17:03:35 DBG] requestId: 0HMVLMCT4QRFB:00000002, previousRequestId: no previous request id, message: Downstream url is http://administration.mvm.local/api/abp/application-configuration
[17:03:35 DBG] Connection id "0HMVLMCT4QRFC" accepted.
[17:03:35 DBG] Connection id "0HMVLMCT4QRFC" started.
[17:03:35 INF] Request starting HTTP/1.1 GET http://administration.mvm.local/api/abp/application-configuration - 0
[17:03:35 VRB] All hosts are allowed.
[17:03:35 VRB] requestId: no request id, previousRequestId: no previous request id, message: MiddlewareStarting: Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass6_1; /api/abp/application-configuration
[17:03:35 DBG] The request has an origin header: 'http://angular.mvm.local'.
[17:03:35 INF] CORS policy execution successful.
[17:03:35 DBG] The request path  does not match the path filter
[17:03:35 DBG] requestId: 0HMVLMCT4QRFC:00000002, previousRequestId: no previous request id, message: ocelot pipeline started
[17:03:35 DBG] requestId: 0HMVLMCT4QRFC:00000002, previousRequestId: no previous request id, message: Upstream url path is /api/abp/application-configuration
[17:03:35 DBG] requestId: 0HMVLMCT4QRFC:00000002, previousRequestId: no previous request id, message: downstream templates are /api/abp/{everything}
[17:03:35 INF] requestId: 0HMVLMCT4QRFC:00000002, previousRequestId: no previous request id, message: EndpointRateLimiting is not enabled for /api/abp/{everything}
[17:03:35 INF] requestId: 0HMVLMCT4QRFC:00000002, previousRequestId: no previous request id, message: No authentication needed for /api/abp/application-configuration
[17:03:35 INF] requestId: 0HMVLMCT4QRFC:00000002, previousRequestId: no previous request id, message: /api/abp/{everything} route does not require user to be authorized
[17:03:35 DBG] requestId: 0HMVLMCT4QRFC:00000002, previousRequestId: no previous request id, message: Downstream url is http://administration.mvm.local/api/abp/application-configuration
[17:03:35 DBG] Connection id "0HMVLMCT4QRFD" accepted.
[17:03:35 DBG] Connection id "0HMVLMCT4QRFD" started.
[17:03:35 INF] Request starting HTTP/1.1 GET http://administration.mvm.local/api/abp/application-configuration - 0
[17:03:35 VRB] All hosts are allowed.
[17:03:35 VRB] requestId: no request id, previousRequestId: no previous request id, message: MiddlewareStarting: Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass6_1; /api/abp/application-configuration
[17:03:35 DBG] The request has an origin header: 'http://angular.mvm.local'.
[17:03:35 INF] CORS policy execution successful.
[17:03:35 DBG] The request path  does not match the path filter
[17:03:35 DBG] requestId: 0HMVLMCT4QRFD:00000002, previousRequestId: no previous request id, message: ocelot pipeline started
[17:03:35 DBG] requestId: 0HMVLMCT4QRFD:00000002...

Took more than 2 minutes...

[17:04:40 DBG] requestId: 0HMVLMCT4R88R:00000002, previousRequestId: no previous request id, message: Downstream url is http://administration.mvm.local/api/abp/application-configuration
[17:05:06 DBG] Connection id "0HMVLMCT4QRH1" received FIN.
[17:05:10 DBG] requestId: 0HMVLMCT4QRGK:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:10 DBG] requestId: 0HMVLMCT4QRG4:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:10 DBG] requestId: 0HMVLMCT4QRFQ:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:10 DBG] requestId: 0HMVLMCT4QRGE:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:10 DBG] requestId: 0HMVLMCT4QRH0:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:10 DBG] requestId: 0HMVLMCT4QRGA:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:10 DBG] requestId: 0HMVLMCT4QRGM:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:10 DBG] requestId: 0HMVLMCT4QRGP:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:10 DBG] requestId: 0HMVLMCT4QRGR:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:10 DBG] requestId: 0HMVLMCT4QRFC:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:10 DBG] requestId: 0HMVLMCT4QRFH:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:10 DBG] requestId: 0HMVLMCT4QRFI:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:10 DBG] requestId: 0HMVLMCT4QRFP:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:10 DBG] requestId: 0HMVLMCT4QRGU:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:10 DBG] requestId: 0HMVLMCT4QRFS:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:10 DBG] requestId: 0HMVLMCT4QRFT:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:10 DBG] requestId: 0HMVLMCT4QRFA:00000003, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:10 DBG] requestId: 0HMVLMCT4QRG6:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:10 DBG] requestId: 0HMVLMCT4QRGC:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:10 DBG] requestId: 0HMVLMCT4QRG5:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:10 DBG] requestId: 0HMVLMCT4QRFB:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:10 DBG] requestId: 0HMVLMCT4QRGI:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:10 DBG] requestId: 0HMVLMCT4QRFK:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:11 DBG] requestId: 0HMVLMCT4QRG7:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:11 DBG] requestId: 0HMVLMCT4QRGJ:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:11 DBG] requestId: 0HMVLMCT4QRG3:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:11 DBG] requestId: 0HMVLMCT4QRGQ:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:11 DBG] requestId: 0HMVLMCT4R88Q:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:11 DBG] requestId: 0HMVLMCT4QRFU:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:11 DBG] requestId: 0HMVLMCT4QRFE:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:10 DBG] requestId: 0HMVLMCT4QRGG:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:11 DBG] requestId: 0HMVLMCT4QRFD:00000002, previousRequestId: no previous request id, message: IHttpRequester returned an error, setting pipeline error
[17:05:11 WRN] requestId: 0HMVLMCT4QRG6:00000002, previousRequestId: no previous request id, message: Error Code: RequestTimedOutError Message: Timeout making http request, exception: System.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 90 seconds elapsing.
 ---> System.TimeoutException: The operation was canceled.
 ---> System.Threading.Tasks.TaskCanceledException: The operation was canceled.
 ---> System.IO.IOException: Unable to read data from the transport connection: Operation canceled.
 ---> System.Net.Sockets.SocketException (125): Operation canceled
   --- End of inner exception stack trace ---
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token)
   at System.Net.Http.HttpConnection.InitialFillAsync(Boolean async)
   at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at Ocelot.Requester.HttpClientHttpRequester.GetResponse(HttpContext httpContext) errors found in ResponderMiddleware. Setting error response for request path:/api/abp/application-configuration, request method: GET

This is Angular UI is freezing at getting application-configuration response

Please us know any information that we will provide for you to easily investigate. Thank you in advance!


3 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    HI,

    Can you check those? https://github.com/ThreeMammals/Ocelot/issues/579 https://github.com/ThreeMammals/Ocelot/issues/271

  • User Avatar
    0
    triet.nguyen created

    Hi,

    Thank your for your response.

    Those issues did not provide helpful my case. However, I've used self-signed certificate with custom domain at my local machine. Therefore, I have to enable TLS for all services. Somehow it won't loop the request anymore.

    • But I'm facing 2 other issues:

    Essentially, If not yet authorized, I can receive a response from AdministrationService/api/abp/application-configuration. However after authorized, It returns 500 error due to CORS issue.

    From my understanding, if the header has Authorization entry, It needs to retrieve the configuration from /.well-known/openid-configuration of the AuthServer to validate the token. But the AdministrationService cannot reach to AuthServer via HTTPS.

    Prior to this, It was successfully authorized with the AuthServer on SwaggerUI and obtained the access_token via HTTPS.

    => A part of log messages:

    ---> System.IO.IOException: IDX20804: Unable to retrieve document from: 'https://authserver.mvm.local/.well-known/openid-configuration'. ---> System.Net.Http.HttpRequestException: Connection refused (authserver.mvm.local:443) ---> System.Net.Sockets.SocketException (111): Connection refused

    • Might be related to some previously posted issues.:

      • https://support.abp.io/QA/Questions/3112/Unable-to-obtain-configuration-from-'SystemString'
      • https://support.abp.io/QA/Questions/3932/InvalidOperationException-IDX20803-Unable-to-obtain-configuration-from-%27SystemString%27-error
      • https://support.abp.io/QA/Questions/3027
    • This is exception and stacktrace:

    [16:29:18 INF] Request starting HTTP/1.1 GET http://administration.mvm.local/api/abp/application-configuration - -
    [16:29:18 DBG] Wildcard detected, all requests with hosts will be allowed.
    [16:29:18 VRB] All hosts are allowed.
    [16:29:18 DBG] The request path /api/abp/application-configuration does not match a supported file type
    [16:29:18 DBG] 1 candidate(s) found for the request path '/api/abp/application-configuration'
    [16:29:18 DBG] Endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc)' with route pattern 'api/abp/application-configuration' is valid for the request path '/api/abp/application-configuration'
    [16:29:18 DBG] Request matched endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
    [16:29:18 ERR] Exception occurred while processing message.
    System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'https://authserver.mvm.local/.well-known/openid-configuration'.
     ---> System.IO.IOException: IDX20804: Unable to retrieve document from: 'https://authserver.mvm.local/.well-known/openid-configuration'.
     ---> System.Net.Http.HttpRequestException: Connection refused (authserver.mvm.local:443)
     ---> System.Net.Sockets.SocketException (111): Connection refused
       at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
       at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
       at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|277_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
       at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
       --- End of inner exception stack trace ---
       at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
       at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
       at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
       at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(HttpRequestMessage request)
       at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
       at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
       at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
       at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
       at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
       at System.Net.Http.HttpClient.&lt;SendAsync&gt;g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
       at Microsoft.IdentityModel.Protocols.HttpDocumentRetriever.GetDocumentAsync(String address, CancellationToken cancel)
       --- End of inner exception stack trace ---
       at Microsoft.IdentityModel.Protocols.HttpDocumentRetriever.GetDocumentAsync(String address, CancellationToken cancel)
       at Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfigurationRetriever.GetAsync(String address, IDocumentRetriever retriever, CancellationToken cancel)
       at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel)
       --- End of inner exception stack trace ---
       at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel)
       at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
       at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
       at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()
       at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
       at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.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.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.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.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
    
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    The HTTP internal address should be used in the container.

    You can check the MS template.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 02, 2024, 12:35