Ismail
Ismail

Reputation: 1316

Cloud Foundry : How use Java Buildpack specific version

I am trying to deploy a Spring Boot App to Cloud Foundry. I have given the build pack in manifest.yml as below

---
applications:
- name: gl-bo-sample
  path: ./target/gl-1.0-SNAPSHOT.jar
  buildpacks:
      - https://github.com/cloudfoundry/java-buildpack.git

Now I am trying to use it with a specific release, I tried changing the URL to

https://github.com/cloudfoundry/java-buildpack.git#4.26

but getting below Error

Staging app and tracing logs...
   Cell 42004a5d-c593-4393-a123-f76cb8abe8b5 creating container for instance 43c3e913-e5a2-4251-b138-1309e117dc23
   Cell 42004a5d-c593-4393-a123-f76cb8abe8b5 successfully created container for instance 43c3e913-e5a2-4251-b138-1309e117dc23
   Downloading app package...
   Downloaded app package (26.2M)
   Failed to clone git repository at https://github.com/cloudfoundry/java-buildpack.git
   Exit status 1
   Cell 42004a5d-c593-4393-a123-f76cb8abe8b5 stopping instance 43c3e913-e5a2-4251-b138-1309e117dc23
   Cell 42004a5d-c593-4393-a123-f76cb8abe8b5 destroying container for instance 43c3e913-e5a2-4251-b138-1309e117dc23
   Cell 42004a5d-c593-4393-a123-f76cb8abe8b5 successfully destroyed container for instance 43c3e913-e5a2-4251-b138-1309e117dc23
Error staging application: Staging error: staging failed
FAILED

Tried Adding #v4.26
Getting a different Error -

Downloaded app package (26.2M)
   -----> Java Buildpack v4.26 | https://github.com/cloudfoundry/java-buildpack.git#e25d6bf
   [Buildpack]                      ERROR Finalize failed with exception #<RuntimeError: Open Jdk JRE error: No version resolvable for '1.8.0_232' in 1.7.0_06, 1.7.0_07, 1.7.0_08, 1.7.0_09, 1.7.0_10, 1.7.0_11, 1.7.0_12, 1.7.0_13, 1.7.0_14, 1.7.0_15, 1.7.0_17, 1.7.0_21, 1.7.0_25, 1.7.0_40, 1.7.0_45, 1.7.0_51, 1.7.0_55, 1.7.0_60, 1.7.0_65, 1.7.0_71, 1.7.0_75, 1.7.0_79, 1.8.0_00, 1.8.0_05, 1.8.0_11, 1.8.0_20, 1.8.0_25, 1.8.0_31, 1.8.0_40, 1.8.0_45, 1.8.0_51, 1.8.0_60, 1.8.0_65, 1.8.0_71, 1.8.0_73, 1.8.0_77, 1.8.0_91, 1.8.0_91-unlimited-crypto, 1.8.0_101, 1.8.0_111, 1.8.0_121, 1.8.0_131, 1.8.0_141, 1.8.0_144, 1.8.0_152, 1.8.0_161, 1.8.0_162, 1.8.0_172, 1.8.0_181, 1.8.0_191, 1.8.0_192, 1.8.0_201, 1.8.0_202, 1.8.0_212, 1.8.0_222, 1.8.0_RC1, 9.0.0_181, 9.0.1_11, 9.0.4_11, 10.0.0_46, 10.0.1_10, 10.0.2_13, 11.0.0_28, 11.0.1_13, 11.0.2_07, 11.0.2_09, 11.0.3_07, 11.0.4_11, 12.0.0_33, 12.0.1_12, 12.0.2_10>
   Open Jdk JRE error: No version resolvable for '1.8.0_232' in 1.7.0_06, 1.7.0_07, 1.7.0_08, 1.7.0_09, 1.7.0_10, 1.7.0_11, 1.7.0_12, 1.7.0_13, 1.7.0_14, 1.7.0_15, 1.7.0_17, 1.7.0_21, 1.7.0_25, 1.7.0_40, 1.7.0_45, 1.7.0_51, 1.7.0_55, 1.7.0_60, 1.7.0_65, 1.7.0_71, 1.7.0_75, 1.7.0_79, 1.8.0_00, 1.8.0_05, 1.8.0_11, 1.8.0_20, 1.8.0_25, 1.8.0_31, 1.8.0_40, 1.8.0_45, 1.8.0_51, 1.8.0_60, 1.8.0_65, 1.8.0_71, 1.8.0_73, 1.8.0_77, 1.8.0_91, 1.8.0_91-unlimited-crypto, 1.8.0_101, 1.8.0_111, 1.8.0_121, 1.8.0_131, 1.8.0_141, 1.8.0_144, 1.8.0_152, 1.8.0_161, 1.8.0_162, 1.8.0_172, 1.8.0_181, 1.8.0_191, 1.8.0_192, 1.8.0_201, 1.8.0_202, 1.8.0_212, 1.8.0_222, 1.8.0_RC1, 9.0.0_181, 9.0.1_11, 9.0.4_11, 10.0.0_46, 10.0.1_10, 10.0.2_13, 11.0.0_28, 11.0.1_13, 11.0.2_07, 11.0.2_09, 11.0.3_07, 11.0.4_11, 12.0.0_33, 12.0.1_12, 12.0.2_10
   Failed to compile droplet: Failed to run finalize script: exit status 1
   Exit status 223
   Cell 87d0c251-800c-46b8-b342-84120765ba39 stopping instance c9c63305-110d-4688-ae86-7df857a1debd
   Cell 87d0c251-800c-46b8-b342-84120765ba39 destroying container for instance c9c63305-110d-4688-ae86-7df857a1debd
   Cell 87d0c251-800c-46b8-b342-84120765ba39 successfully destroyed container for instance c9c63305-110d-4688-ae86-7df857a1debd
Error staging application: App staging failed in the buildpack compile phase
FAILED
  1. What I am doing wrong

Upvotes: 3

Views: 10154

Answers (2)

fg78nc
fg78nc

Reputation: 5232

This happens when you alternate between offline and online buildpacks.

Please try this :

  • Clean your blobstore cache cf curl -X DELETE /v2/blobstores/buildpack_cache

  • Use offline buildpack:

    cf create-buildpack my-custom-java-bp https://github.com/cloudfoundry/java-buildpack#v4.26 100 --enable

And then refer to this buildpack in your manifest.

P.S. You can try both of these actions combined together, or just a first one.

Upvotes: 1

Scott Frederick
Scott Frederick

Reputation: 5125

The anchor in the buildpack git URL should be prefixed with v, as in

https://github.com/cloudfoundry/java-buildpack#v4.26

See https://stackoverflow.com/a/26127753/1299533

Upvotes: 4

Related Questions