Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent issue with CDS: [warning][cds] Dynamic archive cannot be used: static archive header checksum verification failed. #481

Closed
anthonydahanne opened this issue May 21, 2024 · 0 comments
Labels
type:bug A general bug

Comments

@anthonydahanne
Copy link
Member

If trying to apply CDS training run via spring-boot buildpack latest version, via pack (providing source code), it's possible the buildpack mixes up JDK and JRE during training run (using the JDK during the training run instead of the JRE that will be used for runtime)

Expected Behavior

the JRE should always be used for the training run (as long as the user did not specify BP_JVM_TYPE=jdk) and thus the CDS run should work fine

Current Behavior

Sometimes the JDK is used instead of the JRE

Possible Solution

find a way to conssitenly get the JRE at traing run

Steps to Reproduce

https://github.com/anthonydahanne/petclinic-efficient-container/blob/buildpacks/.github/workflows/tests.yml#L34C1-L46C70 or more simply:

pack build test --env BP_JVM_VERSION=21 --env BP_JVM_CDS_ENABLED=true --env BP_SPRING_AOT_ENABLED=true  -b gcr.io/paketo-buildpacks/bellsoft-liberica:latest   -b paketobuildpacks/syft:latest -b paketobuildpacks/maven:latest   -b paketobuildpacks/executable-jar:latest  -b  paketobuildpacks/spring-boot:latest -B paketobuildpacks/builder-jammy-buildpackless-tiny:latest

if during

docker run -it test

You see:

[warning][cds] Dynamic archive cannot be used: static archive header checksum verification failed.

CDS failed to apply because of a JVM mixup

Motivations

CDS should always work

@anthonydahanne anthonydahanne added the type:bug A general bug label May 21, 2024
anthonydahanne added a commit that referenced this issue May 23, 2024
* JRE_HOME is now set in libjvm, see paketo-buildpacks/libjvm#395
* thanks to that, we know for sure that the JRE_HOME/bin/java will be used for the training run
anthonydahanne added a commit that referenced this issue May 23, 2024
Fix #481: Rely on JRE_HOME for Java location
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant