ConfigWatch scheduled refresh throws errors after initial Consul config load
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 52/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- java, spring, spring-boot
调研方向
从 ConfigWatch.watchConfigKeyValues 开始,使用此处描述的 WebFlux 示例、Consul KV 条目和 application.yaml 重现该问题。比较计划刷新与 WebMVC 的行为,同时检查报告的 ReadTimeoutException 和 ResourceAccessException。当 WebFlux 下的计划刷新能够无错误地工作,且初始 Consul 导入仍能正常工作时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
Spring Cloud Consul Сonfig 5.0.0
When starting a project, the initial initialization of properties with consul occurs correctly.
But each subsequent scheduled call to the ConfigWatch::watchConfigKeyValues method generates an error
2026-01-27T16:04:49.322+02:00 WARN 21920 --- [gateway] [ctor-http-nio-4] r.netty.http.client.HttpClientConnect : [0fd22999-1, L:/127.0.0.1:49984 - R:localhost/127.0.0.1:8500] The connection observed an error
io.netty.handler.timeout.ReadTimeoutException
2026-01-27T16:04:49.325+02:00 ERROR 21920 --- [gateway] [TaskScheduler-1] o.s.cloud.consul.config.ConfigWatch : Fail fast is set and there was an error reading configuration from consul.
2026-01-27T16:04:49.325+02:00 ERROR 21920 --- [gateway] [TaskScheduler-1] o.s.s.s.TaskUtils$LoggingErrorHandler : Unexpected error occurred in scheduled task
org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://localhost:8500/v1/kv/config/gateway,default/": null
I want to say once again that the initial initialization via spring.config.import: 'consul:' was successful. Also, if you disable watch config, there are no errors. All of the above suggests that the problem is not in Consul, but in the functionality of the ConfigWatch::watchConfigKeyValues method.
I tested the project with both WebMVC and WebFlux. I found that errors occur only when using WebFlux.
When using WebMVC, everything works correctly.
Sample
Create Spring Boot project with webflux and spring-cloud-starter-consul-config starter.
Your project will start on port 8082 since the initial initialization was successful. But later on, errors will start to be generated due to ConfigWatch::watchConfigKeyValues.
application.yaml
spring:
application:
name: gateway
config:
import: 'consul:'
cloud:
consul:
host: localhost
port: 8500
Consul KV
Key: config/gateway,default/server.port
Value: 8082
- 主要语言
- Java
- 星标
- 821
- 派生
- 540
- 平均合并
- 12 小时 56 分钟
- 30 天内合并 PR
- 15
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
spring-cloud/spring-cloud-consul 的其他 Issue
-
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 天内回复
-
Migrating from Spring boot 3.5.11 to 4.0.3 : reregister-service-on-failure not working anymore可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭waiting-for-triage
难度 4/5 3-5 天 新手友好度 48/100
spring-cloud/spring-cloud-consul#954 · 1 条评论 · 5 个 reaction ·
维护者通常 1 天内回复
-
waiting-for-triage
难度 4/5 3-5 天 新手友好度 45/100
spring-cloud/spring-cloud-consul#950 · 4 条评论 ·
维护者通常 1 天内回复
查看 spring-cloud/spring-cloud-consul 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 85/100
-
[Bug]: REST API URL starting with "http" but no scheme (e.g. httpbin.org/get) is not given an http:// prefix可能已有人在做 @ItsDeadlyProgrammer 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
appsmithorg/appsmith#42471 · 1 条评论 ·
维护者通常 2 天内回复
-
code-maintenance
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
-
bug priority: medium Review effort [1-5]: 3 status: needs-triage type: bug
难度 2/5 1-3 小时 新手友好度 82/100
carlos-emr/carlos#5258 ·
维护者通常 1 天内回复