英文:
Error to connect on server using Spring Cloud Config: `Connect: Timeout Exception on Url`
问题
我正在执行一个Spring应用程序,该应用程序在本地从运行在K8s上的服务器应用程序中获取属性数据。起初一切正常,但是今天连接停止了。当启动Spring客户端应用程序时,我收到以下消息:
2020-07-24 11:16:58.780 INFO 24372 --- [ main] c.c.c.ConfigServicePropertySourceLocator : 正在从服务器获取配置: https://my-server-url:443
2020-07-24 11:16:59.151 INFO 24372 --- [ main] c.c.c.ConfigServicePropertySourceLocator : 在URL https://my-server-url:443 上发生连接超时异常。如果可用,将尝试下一个URL
2020-07-24 11:16:59.151 WARN 24372 --- [ main] c.c.c.ConfigServicePropertySourceLocator : 无法定位属性源: 在GET请求“https://my-server-url:443/app-name/local”时出现I/O错误: PKIX路径构建失败: sun.security.provider.certpath.SunCertPathBuilderException: 无法找到到所请求目标的有效证书路径; 嵌套异常是javax.net.ssl.SSLHandshakeException: PKIX路径构建失败: sun.security.provider.certpath.SunCertPathBuilderException: 无法找到所请求目标的有效证书路径
2020-07-24 11:16:59.153 INFO 24372 --- [ main] .s.g.TransactionSearchGatewayApplication : 激活的配置文件如下: local
bootstrap.yml
spring:
application:
name: app-name
---
spring:
profiles: local
cloud:
config:
enabled: true
uri: https://my-server-url:443
skipSslValidation: true
本地 <-> K8s之间的连接是正常的,因为我从浏览器尝试并获得了连接状态。
https://my-server-url:443/actuator/health
我尝试过:
- 在K8s上重新启动应用程序;
- 在bootstrap.yml上设置
fail-fast
和retry
属性; - 重置路由器;
- 重新克隆应用程序;
- 清除缓存并重新启动;
- 重新安装JDK 13。
但什么都没有起作用。
英文:
I'm executing a Spring application local that get properties data from a server application on k8s. At first moment everything working fine, but today the connection is stopped. When start Spring app client I got:
2020-07-24 11:16:58.780 INFO 24372 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at : https://my-server-url:443
2020-07-24 11:16:59.151 INFO 24372 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Connect Timeout Exception on Url - https://my-server-url:443. Will be trying the next url if available
2020-07-24 11:16:59.151 WARN 24372 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Could not locate PropertySource: I/O error on GET request for "https://my-server-url:443/app-name/local": PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target; nested exception is javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
2020-07-24 11:16:59.153 INFO 24372 --- [ main] .s.g.TransactionSearchGatewayApplication : The following profiles are active: local
bootstrap.yml
spring:
application:
name: app-name
---
spring:
profiles: local
cloud:
config:
enabled: true
uri: https://my-server-url:443
skipSslValidation: true
The connection between local <-> k8s is working because I tried from browser and got UP connection.
https://my-server-url:443/actuator/health
I tried:
- Restart app on k8s;
- Set
fail-fast
andretry
props on bootstrap.yml; - Reset router;
- Re-clone application;
- Invalidate caches and restart;
- Reinstall JDK 13.
Nothing works.
专注分享java语言的经验与见解,让所有开发者获益!
评论