Closed shashankram closed 2 years ago
cc @wbpcode
Figured out the issue. Envoy is operating correctly. There was a misconfiguration in my environment where the cluster hostname resolved to an IP address that did not have endpoints in k8s. After fixing this misconfiguration, rate limiting works as expected.
Thanks!
Title: One line description Envoy fails to connect to external rate limit service:
connection failure, transport failure reason: delayed connect error: 111
. I have a global network rate limit filter on the ingress listener's filter_chain.Description:
I have set up an external Rate Limit Service (RLS) using https://github.com/envoyproxy/ratelimit. I am experiencing an issue where the Envoy instance is unable to communicate with the RLS.
Envoy version: v1.22.2
Admin and Stats Output:
Relevant config dump: RLS cluster:
Rate limit filter config on ingress listener:
Stats pertaining to the RLS cluster and global rate limit:
Logs:
[2022-07-22 16:38:21.666][24][debug][pool] [source/common/http/conn_pool_base.cc:76] queueing stream due to no available connections [2022-07-22 16:38:21.667][24][debug][pool] [source/common/conn_pool/conn_pool_base.cc:268] trying to create new connection [2022-07-22 16:38:21.667][24][trace][pool] [source/common/conn_pool/conn_pool_base.cc:269] ConnPoolImplBase 0x71ebea0d450, readyclients.size(): 0, busyclients.size(): 0, connectingclients.size(): 0, connecting_streamcapacity: 0, num_activestreams: 0, pendingstreams.size(): 1 per upstream preconnect ratio: 1 [2022-07-22 16:38:21.667][24][debug][pool] [source/common/conn_pool/conn_pool_base.cc:145] creating a new connection [2022-07-22 16:38:21.668][24][trace][http2] [source/common/http/http2/codec_impl.cc:1922] Codec does not have Metadata frame support. [2022-07-22 16:38:21.670][24][debug][http2] [source/common/http/http2/codec_impl.cc:1729] [C242] updating connection-level initial window size to 268435456 [2022-07-22 16:38:21.670][24][debug][connection] [./source/common/network/connection_impl.h:89] [C242] current connecting state: true [2022-07-22 16:38:21.670][24][debug][client] [source/common/http/codec_client.cc:57] [C242] connecting [2022-07-22 16:38:21.670][24][debug][connection] [source/common/network/connection_impl.cc:912] [C242] connecting to 10.96.227.8:8081 [2022-07-22 16:38:21.671][24][debug][connection] [source/common/network/connection_impl.cc:931] [C242] connection in progress [2022-07-22 16:38:21.671][24][trace][pool] [source/common/conn_pool/conn_pool_base.cc:131] not creating a new connection, shouldCreateNewConnection returned false. [2022-07-22 16:38:21.672][24][trace][router] [source/common/router/upstream_request.cc:256] [C0][S11366889662080980910] buffering 33 bytes [2022-07-22 16:38:21.672][24][debug][conn_handler] [source/server/active_tcp_listener.cc:142] [C241] new connection from 10.244.1.9:59536 [2022-07-22 16:38:21.673][24][trace][connection] [source/common/network/connection_impl.cc:563] [C241] socket event: 2 [2022-07-22 16:38:21.673][24][trace][connection] [source/common/network/connection_impl.cc:674] [C241] write ready [2022-07-22 16:38:21.679][24][trace][connection] [source/extensions/transport_sockets/tls/ssl_handshaker.cc:52] [C241] ssl error occurred while read: WANT_READ [2022-07-22 16:38:21.679][24][trace][connection] [source/common/network/connection_impl.cc:563] [C242] socket event: 3 [2022-07-22 16:38:21.679][24][trace][connection] [source/common/network/connection_impl.cc:674] [C242] write ready [2022-07-22 16:38:21.679][24][debug][connection] [source/common/network/connection_impl.cc:695] [C242] delayed connect error: 111 [2022-07-22 16:38:21.679][24][debug][connection] [source/common/network/connection_impl.cc:250] [C242] closing socket: 0 [2022-07-22 16:38:21.679][24][trace][connection] [source/common/network/connection_impl.cc:418] [C242] raising connection event 0 [2022-07-22 16:38:21.679][24][debug][client] [source/common/http/codec_client.cc:107] [C242] disconnect. resetting 0 pending requests [2022-07-22 16:38:21.680][24][debug][pool] [source/common/conn_pool/conn_pool_base.cc:439] [C242] client disconnected, failure reason: delayed connect error: 111 [2022-07-22 16:38:21.680][24][debug][router] [source/common/router/router.cc:1170] [C0][S11366889662080980910] upstream reset: reset reason: connection failure, transport failure reason: delayed connect error: 111 [2022-07-22 16:38:21.680][24][trace][main] [source/common/event/dispatcher_impl.cc:249] item added to deferred deletion list (size=1) [2022-07-22 16:38:21.680][24][debug][http] [source/common/http/async_client_impl.cc:101] async http request response headers (end_stream=true): ':status', '200' 'content-type', 'application/grpc' 'grpc-status', '14' 'grpc-message', 'upstream connect error or disconnect/reset before headers. reset reason: connection failure, transport failure reason: delayed connect error: 111'
[2022-07-22 16:38:21.680][24][debug][filter] [source/extensions/filters/common/ratelimit/ratelimit_impl.cc:117] rate limit fail, status=14 msg=upstream connect error or disconnect/reset before headers. reset reason: connection failure, transport failure reason: delayed connect error: 111 [2022-07-22 16:38:21.680][24][debug][connection] [source/common/network/connection_impl.cc:139] [C241] closing data_to_write=0 type=1 [2022-07-22 16:38:21.680][24][debug][connection] [source/common/network/connection_impl.cc:250] [C241] closing socket: 1