Migrating from Spring boot 3.5.11 to 4.0.3 : reregister-service-on-failure not working anymore
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- java, spring-boot
- Área
- backend, distributed-systems
Línea de trabajo
Empieza ejecutando los dos ejemplos adjuntos de consul-client y comparando el comportamiento de Spring Boot 3.5.11/Spring Cloud 2025.0.1 con Spring Boot 4.0.3/Spring Cloud 2025.1.1. Traza ConsulCatalogWatch y TtlScheduler en torno al reinicio del agente de Consul. Se considera terminado cuando el ejemplo más nuevo vuelve a registrar el servicio después de que Consul se reinicie, sin reiniciar la aplicación.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
I have a spring boot application (3.5.11) using spring-cloud-starter-consul-discovery (2025.0.1).
I have activated reregister-service-on-failure as the consul may sometimes be restarted.
That works perfectly fine.
Now I'm migrating the app to the lastest version (spring boot 4.03 ans spring cloud 2025.1.1).
Unfortunatly when I restart the consul agent, the app do not re-register anymore.
Sample
1- Here's an example with spring boot 3.5.11 and spring cloud 2025.0.1 (everything works as expected)
consul-client-3.5.9.zip
When I start the app, the service registered :
2026-03-03T15:23:40.271-10:00 INFO 15316 --- [DEMO-SERVICE] [ main] o.s.c.c.s.ConsulServiceRegistry : Registering service with consul: NewService{id='DEMO-SERVICE-9091', name='DEMO-SERVICE', tags=[], address='10.0.10.5', meta={secure=false}, port=9091, enableTagOverride=null, check=Check{script='null', dockerContainerID='null', shell='null', interval='null', ttl='30s', http='null', method='null', header=null, tcp='null', timeout='null', deregisterCriticalServiceAfter='null', tlsSkipVerify=null, status='null', grpc='null', grpcUseTLS=null}, checks=null}
When I stop the consul agent:
2026-03-03T15:24:39.807-10:00 INFO 9560 --- [DEMO-SERVICE] [TaskScheduler-1] o.apache.http.impl.execchain.RetryExec : I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}->http://localhost:8500: The target server failed to respond
2026-03-03T15:24:39.807-10:00 INFO 9560 --- [DEMO-SERVICE] [TaskScheduler-1] o.apache.http.impl.execchain.RetryExec : Retrying request to {}->http://localhost:8500
2026-03-03T15:24:39.821-10:00 ERROR 9560 --- [DEMO-SERVICE] [TaskScheduler-1] o.s.c.c.discovery.ConsulCatalogWatch : Error watching Consul CatalogServices
com.ecwid.consul.transport.TransportException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:8500 [localhost/127.0.0.1,
...
Caused by: java.net.ConnectException: Connection refused: getsockopt
When I restart the consult agent, the TtlScheduler is called and the service is re-registered :
2026-03-03T15:24:47.355-10:00 WARN 9560 --- [DEMO-SERVICE] [pool-2-thread-1] o.s.cloud.consul.discovery.TtlScheduler : OperationException(statusCode=404, statusMessage='Not Found', statusContent='Unknown check ID "service:DEMO-SERVICE-9091". Ensure that the check ID is passed, not the check name.')
2026-03-03T15:24:47.355-10:00 INFO 9560 --- [DEMO-SERVICE] [pool-2-thread-1] o.s.cloud.consul.discovery.TtlScheduler : Re-register NewService{id='DEMO-SERVICE-9091', name='DEMO-SERVICE', tags=[], address='10.0.10.5', meta={secure=false}, port=9091, enableTagOverride=null, check=Check{script='null', dockerContainerID='null', shell='null', interval='null', ttl='30s', http='null', method='null', header=null, tcp='null', timeout='null', deregisterCriticalServiceAfter='null', tlsSkipVerify=null, status='null', grpc='null', grpcUseTLS=null}, checks=null}
2- Here's the same example with spring boot 4.0.3 and spring cloud 2025.1.1 (re-registering doesn't occured)
consul-client-4.0.3.zip
At startup the service is registered :
2026-03-03T15:32:08.116-10:00 INFO 17028 --- [DEMO-SERVICE] [ main] o.s.c.c.s.ConsulServiceRegistry : Registering service with consul: [NewService@1d9af731 id = 'DEMO-SERVICE-9091', name = 'DEMO-SERVICE', tags = list[[empty]], address = '10.0.10.5', meta = map['secure' -> 'false'], port = 9091, enableTagOverride = [null], check = [NewService.Check@39afe59f args = [null], dockerContainerID = [null], shell = [null], interval = [null], ttl = '30s', http = [null], method = [null], header = [null], tcp = [null], timeout = [null], deregisterCriticalServiceAfter = [null], tlsSkipVerify = [null], status = [null], grpc = [null], grpcUseTLS = [null]], checks = [null]]
When I stop the consul agent:
2026-03-03T15:33:55.550-10:00 ERROR 17028 --- [DEMO-SERVICE] [TaskScheduler-1] o.s.c.c.discovery.ConsulCatalogWatch : Error watching Consul CatalogServices
org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://localhost:8500/v1/catalog/services": null
When I restart the consult agent, nothing happens (no log, no re-register). I have to restart the application.
- Lenguaje dominante
- Java
- Estrellas
- 821
- Forks
- 540
- Merge medio
- 12 h 56 min
- PR fusionados (30 d)
- 15
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de spring-cloud/spring-cloud-consul
-
waiting-for-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
spring-cloud/spring-cloud-consul#984 ·
Los mantenedores suelen responder en 1 día
-
spring.cloud.consul.config.prefixes documentation updateQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abiertodocumentation
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
spring-cloud/spring-cloud-consul#746 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
waiting-for-triage
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
spring-cloud/spring-cloud-consul#996 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
waiting-for-triage
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
spring-cloud/spring-cloud-consul#951 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
waiting-for-triage
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
spring-cloud/spring-cloud-consul#950 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de spring-cloud/spring-cloud-consul
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
code-maintenance
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
krizaka/krizaka-notifications#32 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
klikli-dev/occultism#1719 ·