5

I have updated spring boot to 2.5.2 from 2.1.8.RELEASE. Before that liveness and readiness probe was fine. Now after updating the spring boot I have updated my application properties file:

management.endpoints.web.exposure.include=*
management.endpoints.jmx.exposure.include=health,info
management.endpoint.metrics.enabled=true
management.endpoint.prometheus.enabled=true
management.metrics.enable.*=true
management.metrics.enable.all=true
management.metrics.export.prometheus.enabled=true
management.metrics.use-global-registry=true




management.endpoint.health.probes.enabled=true
management.health.livenessstate.enabled=true
management.health.readinessstate.enabled=true
management.endpoint.health.show-details=always

I have added last 4 lines respective to some documents.

After starting the project locally and checking from browser:

http://localhost:8090/actuator/health/liveness gives {"status":"UP"}

But http://localhost:8090/actuator/health/readiness gives {"status":"OUT_OF_SERVICE"} which is 503 status.

{
    "status": "OUT_OF_SERVICE",
    "components": {
        "diskSpace": {
            "status": "UP",
            "details": {
                "total": 499963174912,
                "free": 326313852928,
                "threshold": 10485760,
                "exists": true
            }
        },
        "livenessState": {
            "status": "UP"
        },
        "ping": {
            "status": "UP"
        },
        "readinessState": {
            "status": "OUT_OF_SERVICE"
        }
    },
    "groups": [
        "liveness",
        "readiness"
    ]

}

In my pom file under dependency:

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>${spring-boot.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
            <version>${spring-boot.version}</version>
            <scope>runtime</scope>
        </dependency>
seenukarthi
  • 8,241
  • 10
  • 47
  • 68
Fay007
  • 2,707
  • 3
  • 28
  • 58
  • There have been changes in the actuator/probes in Spring Boot 2.3. Do you do something in your code working on the states? – grekier Aug 10 '21 at 12:06
  • No I didn't change anything in the code base, like I mentioned only updated the application property. Is there any requirements in the code base? – Fay007 Aug 10 '21 at 12:09
  • No but it might be something existing in the codebase that acts different now than what it was earlier because of the changes in ReadinessState – grekier Aug 10 '21 at 12:13
  • Anything particular you are suggesting? – Fay007 Aug 10 '21 at 12:20
  • Why is the starter-web on runtime scope? And furthermore why is starter-acutator on scope runtime? – khmarbaise Aug 10 '21 at 12:23
  • Throws Dependency problems found without putting them as scope runtime and also throws warning unused. – Fay007 Aug 10 '21 at 12:38
  • Because of the enforcer – Fay007 Aug 11 '21 at 12:42
  • Can you provide a sample reproducing the error? – Shawrup Aug 14 '21 at 09:56
  • what kind of sample do you require? It is a full fledged project @Shawrup – Fay007 Aug 16 '21 at 13:30
  • I tried with your code but I could not reproduce the issue. readiness works perfectly in my sample app. So I could not figure out the issue. A sample project reproducing the issue might be helpful. – Shawrup Aug 16 '21 at 13:53
  • Can you check if you get more output if you set: `endpoints.health.sensitive : false`? – Lukas Eichler Aug 17 '21 at 08:38
  • I don't know how can I provide you a sample application, it's a full fledge project @Shawrup – Fay007 Aug 19 '21 at 12:14
  • Adding management.endpoints.health.sensitive=false doesn't show anything extra @LukasEichler – Fay007 Aug 19 '21 at 12:15
  • I am facing the same issue after updating 2.4.5 to 2.5.4. – user9717940 Aug 25 '21 at 12:09
  • 1
    So readinnes probe is showing UP after this method is called `EventPublishingRunListener.running(..)`. Doc says: `Called immediately before the run method finishes, when the application context has been refreshed and all CommandLineRunners and ApplicationRunners have been called.` So i added breakpoint to all my run methods of ApplicationRunner, CommandLineRunner implementations and find out that one of those realy gets stucked. In my case it has something to do with azure blob storage library. – user9717940 Aug 25 '21 at 14:16

0 Answers0