paketo-buildpacks / health-checker

A Cloud Native Buildpack that provides a health check binary compatible with Docker health checks
Apache License 2.0
6 stars 0 forks source link

HealthCheck is failing with Health Checkers 1.13.0 #113

Closed sivaprasadreddy closed 3 months ago

sivaprasadreddy commented 3 months ago

I have a simple Spring Boot 3.2.4 application with the following configuration:

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <pullPolicy>IF_NOT_PRESENT</pullPolicy>
        <image>
            <builder>dashaun/builder:tiny</builder>
            <name>${dockerImageName}</name>
            <env>
                <BP_JVM_VERSION>${java.version}</BP_JVM_VERSION>
                <BP_HEALTH_CHECKER_ENABLED>true</BP_HEALTH_CHECKER_ENABLED>
            </env>
            <buildpacks>
                <buildpack>urn:cnb:builder:paketo-buildpacks/java</buildpack>
                <buildpack>gcr.io/paketo-buildpacks/health-checker:latest</buildpack>
            </buildpacks>
        </image>
    </configuration>
</plugin>

Expected Behavior

Running ./mvnw spring-boot:build-image should build image successfully.

Current Behavior

This was working fine till yesterday, but today when I ran ./mvnw spring-boot:build-image it is failing with the following error:

[INFO]     [creator]     Paketo Buildpack for Health Checkers 1.13.0
[INFO]     [creator]       https://github.com/paketo-buildpacks/health-checker
[INFO]     [creator]       Build Configuration:
[INFO]     [creator]         $BP_HEALTH_CHECKER_DEPENDENCY  thc   which health checker to contribute
[INFO]     [creator]         $BP_HEALTH_CHECKER_ENABLED     true  contributes a health checker if enabled
[INFO]     [creator]
[INFO]     [creator]     Paketo Buildpack for Health Checkers 1.13.0
[INFO]     [creator]       unable to find dependency
[INFO]     [creator]       no valid dependencies for thc, *, and io.buildpacks.stacks.jammy.tiny in [(thc, 0.22.0, [io.buildpacks.stacks.bionic io.paketo.stacks.tiny *])]
[INFO]     [creator]     ERROR: failed to build: exit status 1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  10.914 s
[INFO] Finished at: 2024-03-28T06:49:20+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.2.4:build-image (default-cli) on project catalog-service: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:3.2.4:build-image failed: Builder lifecycle 'creator' failed with status code 51 -> [Help 1]
[ERROR]

If I explicitly set the health-checker version to 1.12.0 (ie <buildpack>gcr.io/paketo-buildpacks/health-checker:1.12.0</buildpack>) then it is working fine.

lpicquet commented 3 months ago

I also have the same issue using gradle

anthonydahanne commented 3 months ago

Hello 👋 I see you're using dashaun/builder:tiny which is not supported by the Paketo community, as its name implies.

Now, we are currently doing the official arm64 / dualarch work, and just yesterday we published the official healthchecker dual arch image to DockerHub and GCR

Unfortunately, we don't have the official composites nor builders published yet. But, could you please try the following and tell us if that works:

        <image>
            <builder>swigmore/builder-jammy-buildpackless-tiny:latest</builder>
            <name>${dockerImageName}</name>
            <env>
                <BP_JVM_VERSION>${java.version}</BP_JVM_VERSION>
                <BP_HEALTH_CHECKER_ENABLED>true</BP_HEALTH_CHECKER_ENABLED>
            </env>
            <buildpacks>
                <buildpack>anthonydahanne/java-native-image:dual-arch</buildpack>
                <buildpack>gcr.io/paketo-buildpacks/health-checker:latest</buildpack>
            </buildpacks>
        </image>

(I have a doubt it's gonna work cause it will want to build a native image - and I haven't yet created a composite java non native with all dual arch java buildpacks - we're rolling out slowly)

If that does not work, or you're not comfortable using yet other unofficials composites / builders, then you could just simply grab the latest health checker that was released before we pushed the dual arch. In that case, change:

gcr.io/paketo-buildpacks/health-checker:latest

for

gcr.io/paketo-buildpacks/health-checker:1.12.0

In any case, please let us know! Thank you for your patience while we make arm64 support official

dmikusa commented 3 months ago

OK, I think this is my fault. I added in the stuff to publish a multi-arch image but forgot to add in the arm64 dependency for tiny health checker. With the multi-arch image published, your machine is picking that one because it's an ARM64 system, however there's no compatible dependency.

I've got ARM64 dependencies added and all that published and cut a release with the arm64 dependency.

https://github.com/paketo-buildpacks/health-checker/releases/tag/v1.14.0

Can you give it another try with 1.14.0 and see if that helps?

sivaprasadreddy commented 3 months ago

I can confirm that health-checker is working fine with 1.14.0. Thanks a lot for fixing it so quickly.