【问题标题】:Webclient SslHandshakeTimeoutException: handshake timed out after 10000msWebclient SslHandshakeTimeoutException:握手在 10000 毫秒后超时
【发布时间】:2023-01-10 05:09:42
【问题描述】:

我最近使用 webflux 和 webclient 制作了一个组件。 有一些请求使用外部资源来检索一些数据。 在本地工作一切正常,从外部资源检索数据并正确显示给用户。 当我在远程服务器上进行部署时,它不再工作,并向我显示以下错误:


i.n.r.DefaultHostsFileEntriesResolver    : -Dio.netty.hostsFileRefreshInterval: 0
Jan 08 23:59:31 dlv-izac-user app/web.1 2023-01-09 07:59:30.715 DEBUG 4 --- [or-http-epoll-7] i.n.util.ResourceLeakDetectorFactory     : Loaded default ResourceLeakDetector: io.netty.util.ResourceLeakDetector@5abf28c7
Jan 08 23:59:31 dlv-izac-user app/web.1 2023-01-09 07:59:30.717 DEBUG 4 --- [or-http-epoll-7] io.netty.resolver.dns.DnsQueryContext    : [id: 0x477cca20] WRITE: UDP, [45834: /10.1.0.2:53], DefaultDnsQuestion(izac-dlv.herokuapp.com. IN A)
Jan 08 23:59:31 dlv-izac-user app/web.1 2023-01-09 07:59:30.722  WARN 4 --- [or-http-epoll-7] io.netty.channel.epoll.EpollEventLoop    : Unexpected exception in the selector loop.
Jan 08 23:59:31 dlv-izac-user app/web.1 io.netty.channel.unix.Errors$NativeIoException: epoll_wait(..) failed: Function not implemented
Jan 08 23:59:32 dlv-izac-user app/web.1 2023-01-09 07:59:31.722  WARN 4 --- [or-http-epoll-7] io.netty.channel.epoll.EpollEventLoop    : Unexpected exception in the selector loop.
Jan 08 23:59:32 dlv-izac-user app/web.1 io.netty.channel.unix.Errors$NativeIoException: epoll_wait(..) failed: Function not implemented
Jan 08 23:59:33 dlv-izac-user app/web.1 2023-01-09 07:59:32.723  WARN 4 --- [or-http-epoll-7] io.netty.channel.epoll.EpollEventLoop    : Unexpected exception in the selector loop.
Jan 08 23:59:33 dlv-izac-user app/web.1 io.netty.channel.unix.Errors$NativeIoException: epoll_wait(..) failed: Function not implemented
Jan 08 23:59:34 dlv-izac-user app/web.1 2023-01-09 07:59:33.723  WARN 4 --- [or-http-epoll-7] io.netty.channel.epoll.EpollEventLoop    : Unexpected exception in the selector loop.
Jan 08 23:59:34 dlv-izac-user app/web.1 io.netty.channel.unix.Errors$NativeIoException: epoll_wait(..) failed: Function not implemented
Jan 08 23:59:35 dlv-izac-user app/web.1 2023-01-09 07:59:34.724  WARN 4 --- [or-http-epoll-7] io.netty.channel.epoll.EpollEventLoop    : Unexpected exception in the selector loop.
Jan 08 23:59:35 dlv-izac-user app/web.1 io.netty.channel.unix.Errors$NativeIoException: epoll_wait(..) failed: Function not implemented
Jan 08 23:59:36 dlv-izac-user app/web.1 2023-01-09 07:59:35.734 DEBUG 4 --- [or-http-epoll-7] io.netty.resolver.dns.DnsNameResolver    : [id: 0x477cca20] RECEIVED: UDP [45834: /10.1.0.2:53], DatagramDnsResponse(from: /10.1.0.2:53, 45834, QUERY(0), NoError(0), RD RA)
Jan 08 23:59:36 dlv-izac-user app/web.1     DefaultDnsQuestion(izac-dlv.herokuapp.com. IN A)
Jan 08 23:59:36 dlv-izac-user app/web.1     DefaultDnsRawRecord(izac-dlv.herokuapp.com. 9 IN A 4B)
Jan 08 23:59:36 dlv-izac-user app/web.1     DefaultDnsRawRecord(izac-dlv.herokuapp.com. 9 IN A 4B)
Jan 08 23:59:36 dlv-izac-user app/web.1     DefaultDnsRawRecord(izac-dlv.herokuapp.com. 9 IN A 4B)
Jan 08 23:59:36 dlv-izac-user app/web.1     DefaultDnsRawRecord(OPT flags:0 udp:4096 0B)

Jan 09 00:00:16 dlv-izac-user app/web.1 2023-01-09 08:00:15.814  WARN 4 --- [or-http-epoll-8] r.netty.http.client.HttpClientConnect    : [fc253c96, L:/172.19.105.50:34258 - R:izac-dlv.herokuapp.com/46.137.15.86:443] The connection observed an error
Jan 09 00:00:16 dlv-izac-user app/web.1 io.netty.handler.ssl.SslHandshakeTimeoutException: handshake timed out after 10000ms
Jan 09 00:00:16 dlv-izac-user app/web.1     at io.netty.handler.ssl.SslHandler$7.run(SslHandler.java:2113) ~[netty-handler-4.1.76.Final.jar!/:4.1.76.Final]
Jan 09 00:00:16 dlv-izac-user app/web.1     at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98) ~[netty-common-4.1.76.Final.jar!/:4.1.76.Final]
Jan 09 00:00:16 dlv-izac-user app/web.1     at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:170) ~[netty-common-4.1.76.Final.jar!/:4.1.76.Final]
Jan 09 00:00:16 dlv-izac-user app/web.1     at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) ~[netty-common-4.1.76.Final.jar!/:4.1.76.Final]
Jan 09 00:00:16 dlv-izac-user app/web.1     at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469) ~[netty-common-4.1.76.Final.jar!/:4.1.76.Final]
Jan 09 00:00:16 dlv-izac-user app/web.1     at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:391) ~[netty-transport-classes-epoll-4.1.76.Final.jar!/:4.1.76.Final]
Jan 09 00:00:16 dlv-izac-user app/web.1     at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) ~[netty-common-4.1.76.Final.jar!/:4.1.76.Final]
Jan 09 00:00:16 dlv-izac-user app/web.1     at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.76.Final.jar!/:4.1.76.Final]
Jan 09 00:00:16 dlv-izac-user app/web.1     at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.76.Final.jar!/:4.1.76.Final]
Jan 09 00:00:16 dlv-izac-user app/web.1     at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]

这是我使用 webClient 的调用

  URI uri = UriComponentsBuilder.fromHttpUrl(izacComponentUrl)
                .queryParam("request", request)
                .build().toUri();

            WebClient client = WebClient.builder()
                .defaultHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
                .build();

        return  client.get()
                .uri(uri)
                .retrieve()
                .bodyToFlux(RestaurantInfoResponseBody.class)
                .onErrorContinue(RuntimeException.class, (ex, o) -> log.error("Errore durante il recupero dei dati tramite il servizio esterno!"));
    }

【问题讨论】:

    标签: spring-boot heroku deployment spring-webflux webclient


    【解决方案1】:

    你有一个超时。 您是否检查过两台服务器之间的网络流量是否打开?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-14
      • 2021-05-28
      • 2021-08-23
      • 2021-04-23
      • 2019-09-16
      • 2021-06-29
      • 1970-01-01
      • 2022-07-25
      相关资源
      最近更新 更多