Springboot error I/O error on post request for“ http://10.10.195.199:9411/api/v2/spans “: connect timed out; nested exception is java.net.SocketTimeoutException: connect timed out
Problem background solution experience Lyric: a sack of love and happiness
Problem background
When using Zipkin, the following error occurs when accessing the URL
2022-01-11 11:22:35.554 WARN [service-one,,,] 40592 --- [ender@131ff6fa}] z.r.AsyncReporter$BoundedAsyncReporter : Spans were dropped due to exceptions. All subsequent errors will be logged at FINE level.
2022-01-11 11:22:35.557 WARN [service-one,,,] 40592 --- [ender@131ff6fa}] z.r.AsyncReporter$BoundedAsyncReporter : Dropped 1 spans due to ResourceAccessException(I/O error on POST request for "http://10.10.195.199:9411/api/v2/spans": connect timed out; nested exception is java.net.SocketTimeoutException: connect timed out)
org.springframework.web.client.ResourceAccessException: I/O error on POST request for "http://10.10.195.199:9411/api/v2/spans": connect timed out; nested exception is java.net.SocketTimeoutException: connect timed out
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:751) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.cloud.sleuth.zipkin2.sender.ZipkinRestTemplateWrapper.doExecute(ZipkinRestTemplateSenderConfiguration.java:228) ~[spring-cloud-sleuth-zipkin-2.2.0.RELEASE.jar:2.2.0.RELEASE]
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:644) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.cloud.sleuth.zipkin2.sender.RestTemplateSender.post(RestTemplateSender.java:129) ~[spring-cloud-sleuth-zipkin-2.2.0.RELEASE.jar:2.2.0.RELEASE]
at org.springframework.cloud.sleuth.zipkin2.sender.RestTemplateSender$HttpPostCall.doExecute(RestTemplateSender.java:142) ~[spring-cloud-sleuth-zipkin-2.2.0.RELEASE.jar:2.2.0.RELEASE]
at org.springframework.cloud.sleuth.zipkin2.sender.RestTemplateSender$HttpPostCall.doExecute(RestTemplateSender.java:132) ~[spring-cloud-sleuth-zipkin-2.2.0.RELEASE.jar:2.2.0.RELEASE]
at zipkin2.Call$Base.execute(Call.java:380) ~[zipkin-2.19.0.jar:na]
at zipkin2.reporter.AsyncReporter$BoundedAsyncReporter.flush(AsyncReporter.java:285) ~[zipkin-reporter-2.11.0.jar:na]
at zipkin2.reporter.AsyncReporter$Flusher.run(AsyncReporter.java:354) [zipkin-reporter-2.11.0.jar:na]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_172]
Caused by: java.net.SocketTimeoutException: connect timed out
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method) ~[na:1.8.0_172]
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85) ~[na:1.8.0_172]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[na:1.8.0_172]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_172]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_172]
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) ~[na:1.8.0_172]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_172]
at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_172]
at sun.net.NetworkClient.doConnect(NetworkClient.java:175) ~[na:1.8.0_172]
at sun.net.www.http.HttpClient.openServer(HttpClient.java:463) ~[na:1.8.0_172]
at sun.net.www.http.HttpClient.openServer(HttpClient.java:558) ~[na:1.8.0_172]
at sun.net.www.http.HttpClient.<init>(HttpClient.java:242) ~[na:1.8.0_172]
at sun.net.www.http.HttpClient.New(HttpClient.java:339) ~[na:1.8.0_172]
at sun.net.www.http.HttpClient.New(HttpClient.java:357) ~[na:1.8.0_172]
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220) ~[na:1.8.0_172]
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156) ~[na:1.8.0_172]
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050) ~[na:1.8.0_172]
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984) ~[na:1.8.0_172]
at org.springframework.http.client.SimpleBufferingClientHttpRequest.executeInternal(SimpleBufferingClientHttpRequest.java:76) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:742) ~[spring-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
... 9 common frames omitted
Solution
1. The firewall is not turned off
systemctl stop firewalld
Experience
1. I was tired of finding the problem. Another time, I just introduced Zipkin dependency, which was not used, and a similar error occurred.
Read More:
- Microservice call exceptions: error feign.RetryableException: Read timed out executing POST http://xxx…….
- [Solved] Jedis connect and operate Redis error: Failed to create socket和connect timed out
- [Solved] nacos Error: com.alibaba.nacos.api.exception.NacosException: failed to req API:/nacos/v1/ns/instance
- [Solved] xxl-job Error: xxl-rpc remoting error(connect timed out)
- [Solved] “status“:405,“error“ Request method ‘POST‘ not supported“
- I/O error while reading input message; nested exception is java.io.IOException: Stream closed
- Weibo API api Called Error: error:appkey not bind domain! error_code:10017/2/statuses/share.json
- API Failed to Connect phoenix Error: java.sql.SQLException: ERROR 726 (43M10): Inconsistent namespace mapping properties
- [Solved] o2o Error: addShopImg error:null / character to be escaped is missing
- SpringCloud Use openFeign Multipartfile to Upload Files Error: Current request is not a multipart request
- [Solved] Unable to connect to a as user root com.jcraft.jsch.JSchException: Auth failUnable to connect
- Using Post no Body Error: socket hang up [How to Solve]
- Java Web uses AJAX POST Method 405 terror [Solved]
- o.s.boot.SpringApplication, Error creating bean with name ‘paymentImpl‘, xml Configuration file error
- [Solved] nested exception is org.flowable.common.engine.api.FlowableException: Error initialising dmn data mo
- The node requests the API address written by java to report an error error:getaddrinfo ENOTFOUND
- Xdoc generates API documents based on Java annotations
- Request processing failed; nested exception is java.lang.NullPointerException or UnsatisfiedDependencyE
- [Solved] The Bean Validation API is on the classpath but no implementation could be found
- [Solved] JAVA HttpClient Send Https request certificate error:PKIX path building failed: