I am using
- spring-boot-starter-parent:2.6.6
- spring-cloud-server-starter-config:3.1.0
- spring-cloud-server-config-server:3.1.0
After I recently upgraded to Spring Boot 2.6.6 from 2.1.8.RELEASE, I am seeing /actuator/health now invoking one of EnvironmentController endpoints .
Instead of seeing:
{
"status": "UP"
...
}
I am getting:
{
"name": "actuator",
"profiles": [
"health"
]
..
"propertySources": [
{
"name": "{default}/application.yml"
"source": ...
}
]
}
We use /actuator/health as health checks - kube liveness or readiness probe, and we've observed k8s pod frequently restarting since it is no longer just a inexpensive health check, instead it tries to load configurations from the git repo.
After some search, I've tried property such as spring.cloud.config.server.health.enabled=false to no avail.
Comment From: roman-masiar
I have the issue. When combined with @EnableConfigServer the actuator suddenly reacts to ANY endpoint (like .../actuator/foobar) and returns complete environment from git
Setup details in my stackoverflow question: https://stackoverflow.com/questions/73623046/spring-cloud-configuration-server-leaks-git-environment-via-actuator-endpoints
Comment From: ahlianko
I had the same issue, I was able to solve it using
spring.cloud.config.server.prefix=/config
so, now I have http://configserver:port/actuator/health and http://configserver:port/config/{application}/{profile}/ and they do not clash anymore
Comment From: ryanjbaxter
Have you tried using the endpoints specifically for liveliness and readiness from spring boot? https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html#actuator.endpoints.kubernetes-probes
Comment From: YangfanCheng1
It seems to invoke the EnvironmentController logic as well:
2022-11-07 09:04:11.468 WARN [myapp-config-server,2532bc71f8163b80,2532bc71f8163b80] 76877 --- [nio-8888-exec-1] o.s.c.c.s.e.EnvironmentController : Error getting the Environment with name=actuator profiles=health label=liveness includeOrigin=false
org.springframework.cloud.config.server.environment.NoSuchLabelException: No such label: liveness
at org.springframework.cloud.config.server.environment.JGitEnvironmentRepository.refresh(JGitEnvironmentRepository.java:314)
at org.springframework.cloud.config.server.environment.JGitEnvironmentRepository.getLocations(JGitEnvironmentRepository.java:262)
at org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository.getLocations(MultipleJGitEnvironmentRepository.java:139)
at org.springframework.cloud.config.server.environment.AbstractScmEnvironmentRepository.findOne(AbstractScmEnvironmentRepository.java:55)
at org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository.findOneFromCandidate(MultipleJGitEnvironmentRepository.java:188)
at org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository.findOne(MultipleJGitEnvironmentRepository.java:173)
at org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository$$FastClassBySpringCGLIB$$c3345d0b.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
...
Comment From: spring-cloud-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Comment From: spring-cloud-issues
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.