UnknownHostException with spring.config.import https
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- java, spring-boot
- 领域
- backend
调研方向
从最小复现程序开始,跟踪堆栈跟踪中显示的 ConsulConfigDataLoader 和 ConsulPropertySources 入口点。比较 consul 和 configserver 导入的解析方式,然后验证复现程序可以使用报告的 HTTPS 导入进行连接,而不会将 https 解析为主机名。
由索引模型根据 Issue 内容生成。
描述
Spring Boot 2.6.3, Spring Cloud 2021.0.0
Getting an java.net.UnknownHostException: https: nodename nor servname provided, or not known exception when trying to connect to consul with spring.config.import=consul:https://localhost:8500.
P.S. Same config works for configserver: spring.config.import=configserver:https://localhost:8888
Stacktrace:
org.springframework.boot.context.config.ConfigDataResourceNotFoundException: Config data resource '[ConsulConfigDataResource@315f43d5 context = '/localhost:8500/', optional = true, properties = [ConsulConfigProperties@68fa0ba8 enabled = true, prefixes = list['config'], defaultContext = 'application', profileSeparator = ',', format = KEY_VALUE, dataKey = 'data', aclToken = [null], watch = [ConsulConfigProperties.Watch@6c5945a7 waitTime = 55, enabled = true, delay = 1000], failFast = true, name = 'application'], profile = [null]]' via location 'consul:https://localhost:8500' cannot be found
at org.springframework.boot.context.config.ConfigDataResourceNotFoundException.withLocation(ConfigDataResourceNotFoundException.java:97)
at org.springframework.boot.context.config.ConfigDataImporter.handle(ConfigDataImporter.java:145)
at org.springframework.boot.context.config.ConfigDataImporter.load(ConfigDataImporter.java:136)
at org.springframework.boot.context.config.ConfigDataImporter.resolveAndLoad(ConfigDataImporter.java:86)
at org.springframework.boot.context.config.ConfigDataEnvironmentContributors.withProcessedImports(ConfigDataEnvironmentContributors.java:116)
at org.springframework.boot.context.config.ConfigDataEnvironment.processWithProfiles(ConfigDataEnvironment.java:311)
at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:232)
at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:102)
at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:94)
at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:102)
at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:87)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:85)
at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:66)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:114)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:65)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:338)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:296)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292)
at com.example.consulconfigdemo.ConsulConfigDemoApplication.main(ConsulConfigDemoApplication.java:10)
Caused by: org.springframework.cloud.consul.config.ConsulPropertySources$PropertySourceNotFoundException: com.ecwid.consul.transport.TransportException: java.net.UnknownHostException: https: nodename nor servname provided, or not known
at org.springframework.cloud.consul.config.ConsulPropertySources.createPropertySource(ConsulPropertySources.java:143)
at org.springframework.cloud.consul.config.ConsulConfigDataLoader.doLoad(ConsulConfigDataLoader.java:66)
at org.springframework.cloud.consul.config.ConsulConfigDataLoader.load(ConsulConfigDataLoader.java:57)
at org.springframework.cloud.consul.config.ConsulConfigDataLoader.load(ConsulConfigDataLoader.java:38)
at org.springframework.boot.context.config.ConfigDataLoaders.load(ConfigDataLoaders.java:107)
at org.springframework.boot.context.config.ConfigDataImporter.load(ConfigDataImporter.java:128)
... 23 common frames omitted
Caused by: com.ecwid.consul.transport.TransportException: java.net.UnknownHostException: https: nodename nor servname provided, or not known
at com.ecwid.consul.transport.AbstractHttpTransport.executeRequest(AbstractHttpTransport.java:83)
at com.ecwid.consul.transport.AbstractHttpTransport.makeGetRequest(AbstractHttpTransport.java:36)
at com.ecwid.consul.v1.ConsulRawClient.makeGetRequest(ConsulRawClient.java:139)
at com.ecwid.consul.v1.ConsulRawClient.makeGetRequest(ConsulRawClient.java:128)
at com.ecwid.consul.v1.kv.KeyValueConsulClient.getKVValues(KeyValueConsulClient.java:147)
at com.ecwid.consul.v1.ConsulClient.getKVValues(ConsulClient.java:644)
at org.springframework.cloud.consul.config.ConsulPropertySource.init(ConsulPropertySource.java:70)
at org.springframework.cloud.consul.config.ConsulPropertySources.create(ConsulPropertySources.java:155)
at org.springframework.cloud.consul.config.ConsulPropertySources.createPropertySource(ConsulPropertySources.java:134)
... 28 common frames omitted
Caused by: java.net.UnknownHostException: https: nodename nor servname provided, or not known
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.base/java.net.InetAddress$PlatformNameService.lookupAllHostAddr(InetAddress.java:933)
at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1519)
at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:852)
at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1509)
at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1367)
at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1301)
at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:112)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:221)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:165)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:140)
at com.ecwid.consul.transport.AbstractHttpTransport.executeRequest(AbstractHttpTransport.java:70)
... 36 common frames omitted
- 主要语言
- Java
- 星标
- 821
- 派生
- 539
- 平均合并
- 5 小时 34 分钟
- 30 天内合并 PR
- 13
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
spring-cloud/spring-cloud-consul 的其他 Issue
-
Consul 5.0.1 drops stale and consistent flags from health and catalog HTTP requests可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug
难度 2/5 1-3 小时 新手友好度 75/100
spring-cloud/spring-cloud-consul#1029 ·
维护者通常 1 天内回复
-
waiting-for-triage
难度 2/5 1-3 小时 新手友好度 68/100
spring-cloud/spring-cloud-consul#984 ·
维护者通常 1 天内回复
-
spring.cloud.consul.config.prefixes documentation update可能重新可做 关联的 PR 已关闭且未合并。 未关闭documentation
难度 1/5 1-3 小时 新手友好度 78/100
spring-cloud/spring-cloud-consul#746 · 5 条评论 ·
维护者通常 1 天内回复
-
waiting-for-triage
难度 4/5 3-5 天 新手友好度 45/100
spring-cloud/spring-cloud-consul#996 · 1 条评论 ·
维护者通常 1 天内回复
-
waiting-for-triage
难度 4/5 3-5 天 新手友好度 48/100
spring-cloud/spring-cloud-consul#954 · 1 条评论 · 5 个 reaction ·
维护者通常 1 天内回复
查看 spring-cloud/spring-cloud-consul 的全部 Issue
相似的 Issue
-
human-required sync-failed
难度 2/5 1-3 小时 新手友好度 68/100
Azure/osdu-spi-file#63 ·
维护者通常 1 天内回复
-
frontend quick win
难度 2/5 1-3 小时 新手友好度 65/100
CodeForPhilly/benefit-decision-toolkit#571 ·
维护者通常 1 天内回复
-
approved
难度 2/5 1-3 小时 新手友好度 67/100
checkstyle/checkstyle#22129 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
Add Hardcharger JDBC driver可能已有人在做 @prmoore77 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复