无法连接到服务器,使用Spring Cloud Config:`在URL上连接超时异常`。

huangapple 未分类评论51阅读模式
英文:

Error to connect on server using Spring Cloud Config: `Connect: Timeout Exception on Url`

问题

我正在执行一个Spring应用程序,该应用程序在本地从运行在K8s上的服务器应用程序中获取属性数据。起初一切正常,但是今天连接停止了。当启动Spring客户端应用程序时,我收到以下消息:

  1. 2020-07-24 11:16:58.780 INFO 24372 --- [ main] c.c.c.ConfigServicePropertySourceLocator : 正在从服务器获取配置: https://my-server-url:443
  2. 2020-07-24 11:16:59.151 INFO 24372 --- [ main] c.c.c.ConfigServicePropertySourceLocator : URL https://my-server-url:443 上发生连接超时异常。如果可用,将尝试下一个URL
  3. 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: 无法找到所请求目标的有效证书路径
  4. 2020-07-24 11:16:59.153 INFO 24372 --- [ main] .s.g.TransactionSearchGatewayApplication : 激活的配置文件如下: local

bootstrap.yml

  1. spring:
  2. application:
  3. name: app-name
  4. ---
  5. spring:
  6. profiles: local
  7. cloud:
  8. config:
  9. enabled: true
  10. uri: https://my-server-url:443
  11. skipSslValidation: true

本地 <-> K8s之间的连接是正常的,因为我从浏览器尝试并获得了连接状态。

  1. https://my-server-url:443/actuator/health

我尝试过:

  • 在K8s上重新启动应用程序;
  • 在bootstrap.yml上设置fail-fastretry属性;
  • 重置路由器;
  • 重新克隆应用程序;
  • 清除缓存并重新启动;
  • 重新安装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:

  1. 2020-07-24 11:16:58.780 INFO 24372 --- [ main] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at : https://my-server-url:443
  2. 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
  3. 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 &quot;https://my-server-url:443/app-name/local&quot;: 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
  4. 2020-07-24 11:16:59.153 INFO 24372 --- [ main] .s.g.TransactionSearchGatewayApplication : The following profiles are active: local

bootstrap.yml

  1. spring:
  2. application:
  3. name: app-name
  4. ---
  5. spring:
  6. profiles: local
  7. cloud:
  8. config:
  9. enabled: true
  10. uri: https://my-server-url:443
  11. skipSslValidation: true

The connection between local <-> k8s is working because I tried from browser and got UP connection.

  1. https://my-server-url:443/actuator/health

I tried:

  • Restart app on k8s;
  • Set fail-fast and retry props on bootstrap.yml;
  • Reset router;
  • Re-clone application;
  • Invalidate caches and restart;
  • Reinstall JDK 13.

Nothing works.

huangapple
  • 本文由 发表于 2020年7月24日 22:23:24
  • 转载请务必保留本文链接:https://java.coder-hub.com/63075579.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定