You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
spring gateway to invoke http api meet error
1.The error only occurs after the interface has not been called for a long time; it appears immediately when the interface is called again.
2.Removing the newly added filter functionality still results in the same issue, indicating that the problem is unrelated to the new code.
3.This issue only occurs in the production environment; it cannot be reproduced in the staging environment or locally.
Dependencies:
spring:6.1.6
spring boot: 3.2.5
spring cloud: 4.1.2
netty:4.1.109.Final
netty-reactor: 1.1.18
Error message:
2024-12-19 07:34:48.719 [reactor-http-epoll-1] trace_id=6763cc98b7580915df2015741d955008 span_id=df2015741d955008 ERROR c.p.h.g.auth.AuthExceptionHandler - recvAddress(..) failed: Connection reset by peer
io.netty.channel.unix.Errors$NativeIoException: recvAddress(..) failed: Connection reset by peer
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
*__checkpoint ⇢ org.springframework.cloud.gateway.filter.WeightCalculatorWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ AuthorizationWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ ExceptionTranslationWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ LogoutWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ ServerRequestCacheWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ SecurityContextServerWebExchangeWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ ReactorContextWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ HttpHeaderWriterWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ ServerWebExchangeReactorContextWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ org.springframework.security.web.server.WebFilterChainProxy [DefaultWebFilterChain]
*__checkpoint ⇢ HTTP GET "/api/v1/customers/me/ads?accountId=1547060389" [ExceptionHandlingWebHandler]
Original Stack Trace:
The text was updated successfully, but these errors were encountered:
I have resolved this issue. The root cause was that AWS's firewall has a default maximum TCP idle timeout of 350 seconds. When a connection is reused after being idle for a long time, it gets blocked by the firewall. By adding the following HTTP client configuration, the problem can be resolved by reclaiming connections after 300 seconds and setting the maximum idle time to 60 seconds:
spring:
cloud:
gateway:
httpclient:
pool:
max-life-time: 300s# Reclaim connections after 300 secondsmax-idle-time: 60s# Maximum idle time for connections
spring gateway to invoke http api meet error
1.The error only occurs after the interface has not been called for a long time; it appears immediately when the interface is called again.
2.Removing the newly added filter functionality still results in the same issue, indicating that the problem is unrelated to the new code.
3.This issue only occurs in the production environment; it cannot be reproduced in the staging environment or locally.
Dependencies:
spring:6.1.6
spring boot: 3.2.5
spring cloud: 4.1.2
netty:4.1.109.Final
netty-reactor: 1.1.18
Error message:
2024-12-19 07:34:48.719 [reactor-http-epoll-1] trace_id=6763cc98b7580915df2015741d955008 span_id=df2015741d955008 ERROR c.p.h.g.auth.AuthExceptionHandler - recvAddress(..) failed: Connection reset by peer
io.netty.channel.unix.Errors$NativeIoException: recvAddress(..) failed: Connection reset by peer
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
*__checkpoint ⇢ org.springframework.cloud.gateway.filter.WeightCalculatorWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ AuthorizationWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ ExceptionTranslationWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ LogoutWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ ServerRequestCacheWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ SecurityContextServerWebExchangeWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ ReactorContextWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ HttpHeaderWriterWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ ServerWebExchangeReactorContextWebFilter [DefaultWebFilterChain]
*__checkpoint ⇢ org.springframework.security.web.server.WebFilterChainProxy [DefaultWebFilterChain]
*__checkpoint ⇢ HTTP GET "/api/v1/customers/me/ads?accountId=1547060389" [ExceptionHandlingWebHandler]
Original Stack Trace:
The text was updated successfully, but these errors were encountered: