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

java buildpack giving error while creating offline package with OFFLINE=true #1080

Open
ashijay opened this issue Jun 21, 2024 · 5 comments
Open

Comments

@ashijay
Copy link

ashijay commented Jun 21, 2024

Hi there!

I am trying to create cloudfoundry offline java package which is giving error as below.

Per instructions provided at https://github.com/cloudfoundry/java-buildpack#offline-package:
bundle install --- worked fine
bundle exec rake clean package --- worked fine
bundle exec rake clean package PINNED=true --- also worked fine
bundle exec rake clean package OFFLINE=true PINNED=true --- gives error

I am building this on ubuntu machine (details below):
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.3 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

Error snapshot:

bundle exec rake clean package OFFLINE=true PINNED=true

[DownloadCache] WARN Unable to download https://java-buildpack.cloudfoundry.org/groovy/index.yml into cache build/staging/resources/cache: SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate)
rake aborted!
Unable to find cached file for https://java-buildpack.cloudfoundry.org/groovy/index.yml
java-buildpack/lib/java_buildpack/util/cache/download_cache.rb:79:in get' java-buildpack/rakelib/dependency_cache_task.rb:147:in get_from_cache'
java-buildpack/rakelib/dependency_cache_task.rb:139:in block (2 levels) in uris' java-buildpack/rakelib/dependency_cache_task.rb:137:in each'
java-buildpack/rakelib/dependency_cache_task.rb:137:in block in uris' java-buildpack/rakelib/dependency_cache_task.rb:136:in each'
java-buildpack/rakelib/dependency_cache_task.rb:136:in uris' java-buildpack/rakelib/dependency_cache_task.rb:48:in initialize'
java-buildpack/Rakefile:42:in new' java-buildpack/Rakefile:42:in <top (required)>'
/var/lib/gems/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'

Tried to start on a solution with https://stackoverflow.com/questions/44227963/cloudfoundry-buildpack-compilation-fails-due-to-certificate-issue but the file container_certificate_trust_store.rb itself is not present in the path lib\java_buildpack\framework

Additionally bundle exec rake versions gives the same error.

Thank you for any input on this.

@ashijay
Copy link
Author

ashijay commented Jun 21, 2024

Realized one more mis-match while pinning the version for offline buildpack.
bionic/jammy has jvmkill-1.17.0-RELEASE version released but not in trusty.

https://java-buildpack.cloudfoundry.org/jvmkill/bionic/x86_64/index.yml
https://java-buildpack.cloudfoundry.org/jvmkill/jammy/x86_64/index.yml

https://java-buildpack.cloudfoundry.org/jvmkill/trusty/x86_64/index.yml

@ArvindChaturvedi
Copy link

@ashijay : Were you able to resolve this? I am also facing the same and seems like it is happening for Trusty machines as I was able to build an offline build-pack for this release in my local.

$ bundle exec rake versions
[VersionResolver] WARN Discarding illegal version 1.28.0-RC2: Invalid micro version '0-RC2'
[VersionResolver] WARN Discarding illegal version 1.28.0-RC3: Invalid micro version '0-RC3'
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Java Buildpack 9064578 |
+----------------------------------+----------------+------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+
| AppDynamics Agent | 24.5.0_36037 | | Release Notes |
| Azure Application Insights Agent | 3.5.3 | | Release Notes |
| CA Introscope APM Framework | 24.4.2_8 | | |
| Client Certificate Mapper | 2.0.1 | Included inline above | Included inline above |
| Container Security Provider | 1.20.0_RELEASE | Included inline above | Included inline above |
| Contrast Security Agent | 6.5.3 | | Release Notes |
| Datadog APM Javaagent | 1.35.2 | | Release Notes |
| Elastic APM Agent | 1.50.0 | | Release Notes |
| Gemalto Luna Security Provider | 7.4.0 | | Release Notes |
| Geode Tomcat Session Store | 1.14.9 | | |
| Google Stackdriver Profiler | 0.1.0 | | Release Notes |
| Groovy | 2.5.23 | | Release Notes |
| JaCoCo Agent | 0.8.12 | | Release Notes |
| Java CFEnv | 3.1.5 | | Release Notes |
| Java Memory Assistant Agent | 0.5.0 | | |
| Java Memory Assistant Clean Up | 0.1.0 | | |
| JProfiler Profiler | 13.0.7 | | ChangeLog |
| JRebel Agent | 2024.2.2 | | ChangeLog |
| jvmkill Agent | 1.17.0_RELEASE | Included inline above | Included inline above |
| MariaDB JDBC Driver | 2.7.9 | | Release Notes |
| Memory Calculator | 3.13.0_RELEASE | Included inline above | Included inline above |
| Metric Writer | 3.5.0_RELEASE | Included inline above | Included inline above |
| New Relic Agent | 8.12.0 | | Release Notes |
| Open Telemetry Agent | 2.5.0 | | Release Notes |
| OpenJDK JRE 11 | 11.0.23_10 | Risk Matrix | Release Notes |
| OpenJDK JRE 17 | 17.0.11_10 | Risk Matrix | Release Notes |
| OpenJDK JRE 21 | 21.0.3_10 | Risk Matrix | Release Notes |
| OpenJDK JRE 8 | 1.8.0_412 | Risk Matrix | Release Notes |
| PostgreSQL JDBC Driver | 42.7.3 | | ChangeLog |
| Redis Session Store | 1.3.6_RELEASE | Included inline above | Included inline above |
| Riverbed Appinternals Agent | 11.8.5_BL527 | | |
| SeaLights Agent | 4.0.2528 | | |
| SkyWalking | 9.2.0 | | ChangeLog |
| Splunk OpenTelemetry Java Agent | 1.32.2 | | Release Notes |
| Spring Auto-reconfiguration | 2.12.0_RELEASE | Included inline above | Included inline above |
| Spring Boot CLI | 2.7.18 | | |
| Spring Boot Container Customizer | 2.6.0_RELEASE | Included inline above | Included inline above |
| Takipi Agent | 4.73.3 | | Release Notes |
| Tomcat 10.1 | 10.1.25 | Security | ChangeLog |
| Tomcat 9 | 9.0.90 | Security | ChangeLog |
| Tomcat Access Logging Support | 3.4.0_RELEASE | Included inline above | Included inline above |
| Tomcat Lifecycle Support | 3.4.0_RELEASE | Included inline above | Included inline above |
| Tomcat Logging Support | 3.4.0_RELEASE | Included inline above | Included inline above |
| YourKit Profiler | 2024.3.157 | | Release Notes |
+----------------------------------+----------------+------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+

@ashijay
Copy link
Author

ashijay commented Jun 24, 2024

Hi @ArvindChaturvedi,
Heard no solutions yet. I was also able to build offline too taking the latest code source but its not compatible.

It throws error which malformed the URL and remove trusty from it.

Error:
[Buildpack] ERROR Finalize failed with exception #<RuntimeError: Jvmkill Agent error: Unable to find cached file for https://java-buildpack.cloudfoundry.org/jvmkill//x86_64/index.yml>

@pivotal-david-osullivan
Copy link
Contributor

Hi, the buildpack supports Bionic and Jammy and publishes binaries for these where relevant.

There were binaries available for Trusty when it was under general support, however you would need to fork the buildpack, specify Trusty as a packaging platform, and return to older versions of binaries to package, which would not be recommended.

Have you investigated migrating to Jammy?

@riddhichheda03
Copy link

Anyone found any solution or workaround to this ?
I am facing similar issue :
[DownloadCache] WARN Unable to download https://java-buildpack.cloudfoundry.org/jvmkill/trusty/x86_64/index.yml into cache /tmp/cache/final: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
[Buildpack] ERROR Finalize failed with exception #<RuntimeError: Jvmkill Agent error: Unable to find cached file for https://java-buildpack.cloudfoundry.org/jvmkill/trusty/x86_64/index.yml>
Jvmkill Agent error: Unable to find cached file for https://java-buildpack.cloudfoundry.org/jvmkill/trusty/x86_64/index.yml
Failed to compile droplet: Failed to run finalize script: exit status 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants