ThreeMammals / Ocelot

.NET API Gateway
https://www.nuget.org/packages/Ocelot
MIT License
8.36k stars 1.64k forks source link

23.3.0 broken #2133

Closed LeonSchourek closed 2 months ago

LeonSchourek commented 2 months ago

Expected Behavior / New Feature

the routing via consul broke in 23.3+

"ServiceDiscoveryProvider": {
    "Scheme": "http",
    "Host": "consul",
    "Port": 8500,
    "Type": "PollConsul",
    "PollingInterval": 1000
}

Actual Behavior / Motivation for New Feature

warn: Ocelot.Responder.Middleware.ResponderMiddleware[0]
      requestId: 0HN5I4V77ST2E:00000002, previousRequestId: No PreviousRequestId, message: 'Error Code: ConnectionToDownstreamServiceError Message: Error connecting to downstream service, exception: System.Net.Http.HttpRequestException: Connection refused (consul:81)
       ---> 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|285_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.AddHttp2ConnectionAsync(QueueItem queueItem)
         at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(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 Ocelot.Requester.TimeoutDelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
         at Ocelot.Requester.MessageInvokerHttpRequester.GetResponse(HttpContext httpContext) errors found in ResponderMiddleware. Setting error response for request path:/some/path/to/accesss, request method: POST'

Steps to Reproduce the Problem

1. call something

Specifications

raman-m commented 2 months ago

Duplicate of #2119

raman-m commented 2 months ago

Hello Leon, Thank you for bringing the broken Service Discovery functionality in version 23.3.0 to our attention! The Consul provider was indeed affected by a significant redesign of the provider's internal interfaces. We are aware of this issue and are diligently working on the v23.3 Hotfixes milestone. However, we believe the stability of the provider in version 23.2.2 is quite solid. We recommend rolling back to version 23.2.2 and awaiting the upcoming 23.3.4 release, which will include the necessary hotfixes. Your patience is greatly appreciated.

raman-m commented 1 week ago

Fixed in version 23.3.4 ✔️