3

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
Ismail
  • 1,188
  • 13
  • 31

2 Answers2

4

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

Scott Frederick
  • 4,184
  • 19
  • 22
  • Thanks, I tried but getting different Error, Edited in the question – Ismail Dec 04 '19 at 04:05
  • This is the correct answer. The problem you're getting now is different. It's because you're requesting a version of Java not supported by the version of the buildpack that you've selected. This can happen if you're setting `JBP_CONFIG_OPEN_JDK_JRE` and requesting a specific Java version. It can also happen if you were previously running a JBP version that had a version of Java and the new JBP version does not. I have seen cases where the cache retains the previous version. If that's the case, you need to `cf delete` your app and push again to clear the cache. – Daniel Mikusa Dec 04 '19 at 13:51
  • I tried deleting the app and pushing again. Still the issue is to resolved. Getting same error. Any idea what can be the cause or you need an additional details – Ismail Dec 06 '19 at 11:36
1

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.

fg78nc
  • 4,774
  • 3
  • 19
  • 32
  • Does this command ```cf curl -X DELETE /v2/blobstores/buildpack_cache``` affect other apps/builds in the SPACE, because there are other apps running there – Ismail Dec 09 '19 at 07:06
  • I am using a custom build-pack now. Thanks for your answer. – Ismail Dec 09 '19 at 07:23