cloudfoundry / java-buildpack

Cloud Foundry buildpack for running Java applications
Apache License 2.0
439 stars 2.58k forks source link

Open JDK Like Memory Calculator error: Unable to find cached file #387

Closed rauizab closed 7 years ago

rauizab commented 7 years ago

Hi

I can not use the java_builpack. It is strange because 2 weeks ago I tried that in bosh-lite and works when using cloud foundry. The error arise in cloud foundry deploy in amazon. I got this stacktrace.

2017-02-23T15:35:20.74+0100 [STG/0]      ERR [Buildpack]                      DEBUG Instantiating JavaBuildpack::Jre::OpenJdkJRE
2017-02-23T15:35:20.80+0100 [STG/0]      ERR [Buildpack]                      DEBUG Successfully required JavaBuildpack::Jre::OpenJdkJRE
2017-02-23T15:35:20.80+0100 [STG/0]      ERR [ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/ee95aca3a4e3b48af128b6527ec5e9c7/config/open_jdk_jre.yml: {"jre"=>{"version"=>"1.8.0_12+", "repository_root"=>"{default.repository.root}/openjdk/{platform}/{architecture}"}, "memory_calculator"=>{"version"=>"2.+", "repository_root"=>"{default.repository.root}/memory-calculator/{platform}/{architecture}", "stack_threads"=>300, "memory_sizes"=>{"heap"=>nil, "metaspace"=>"64m..", "native"=>nil, "permgen"=>"64m..", "stack"=>"228k.."}, "memory_heuristics"=>{"heap"=>65, "metaspace"=>10, "native"=>15, "permgen"=>10, "stack"=>10}, "memory_initials"=>{"heap"=>"100%", "metaspace"=>"100%", "permgen"=>"100%"}}}
2017-02-23T15:35:20.80+0100 [STG/0]      ERR [ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/ee95aca3a4e3b48af128b6527ec5e9c7/config/repository.yml: {"default_repository_root"=>"https://java-buildpack.cloudfoundry.org"}
2017-02-23T15:35:20.95+0100 [STG/0]      ERR [RepositoryIndex]                DEBUG {default.repository.root}/memory-calculator/{platform}/{architecture} expanded to https://java-buildpack.cloudfoundry.org/memory-calculator/trusty/x86_64
2017-02-23T15:35:20.95+0100 [STG/0]      ERR [ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/ee95aca3a4e3b48af128b6527ec5e9c7/config/cache.yml: {"remote_downloads"=>"enabled", "client_authentication"=>{"certificate_location"=>nil, "private_key_location"=>nil, "private_key_password"=>nil}}
2017-02-23T15:35:20.95+0100 [STG/0]      ERR [DownloadCache]                  DEBUG Proxy: , , , 
2017-02-23T15:35:20.95+0100 [STG/0]      ERR [DownloadCache]                  DEBUG Adding HTTP options for secure connection
2017-02-23T15:35:20.95+0100 [STG/0]      ERR [ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/ee95aca3a4e3b48af128b6527ec5e9c7/config/cache.yml: {"remote_downloads"=>"enabled", "client_authentication"=>{"certificate_location"=>nil, "private_key_location"=>nil, "private_key_password"=>nil}}
2017-02-23T15:36:20.95+0100 [STG/0]      ERR [DownloadCache]                  WARN  Unable to download https://java-buildpack.cloudfoundry.org/memory-calculator/trusty/x86_64/index.yml into cache /tmp: execution expired
2017-02-23T15:36:20.95+0100 [STG/0]      ERR [Buildpack]                      ERROR Compile failed with exception #<RuntimeError: Open JDK Like Memory Calculator error: Unable to find cached file for https://java-buildpack.cloudfoundry.org/memory-calculator/trusty/x86_64/index.yml>
2017-02-23T15:36:20.95+0100 [STG/0]      ERR [Buildpack]                      DEBUG Exception #<RuntimeError: Open JDK Like Memory Calculator error: Unable to find cached file for https://java-buildpack.cloudfoundry.org/memory-calculator/trusty/x86_64/index.yml> backtrace:
2017-02-23T15:36:20.95+0100 [STG/0]      ERR /tmp/buildpacks/ee95aca3a4e3b48af128b6527ec5e9c7/lib/java_buildpack/util/cache/download_cache.rb:75:in `get'
2017-02-23T15:36:20.95+0100 [STG/0]      ERR /tmp/buildpacks/ee95aca3a4e3b48af128b6527ec5e9c7/lib/java_buildpack/repository/repository_index.rb:41:in `initialize'
2017-02-23T15:36:20.95+0100 [STG/0]      ERR /tmp/buildpacks/ee95aca3a4e3b48af128b6527ec5e9c7/lib/java_buildpack/repository/configured_item.rb:62:in `new'
2017-02-23T15:36:20.95+0100 [STG/0]      ERR /tmp/buildpacks/ee95aca3a4e3b48af128b6527ec5e9c7/lib/java_buildpack/repository/configured_item.rb:62:in `index'
2017-02-23T15:36:20.95+0100 [STG/0]      ERR /tmp/buildpacks/ee95aca3a4e3b48af128b6527ec5e9c7/lib/java_buildpack/repository/configured_item.rb:47:in `find_item'
2017-02-23T15:36:20.95+0100 [STG/0]      ERR /tmp/buildpacks/ee95aca3a4e3b48af128b6527ec5e9c7/lib/java_buildpack/component/versioned_dependency_component.rb:40:in `initialize'
2017-02-23T15:36:20.95+0100 [STG/0]      ERR /tmp/buildpacks/ee95aca3a4e3b48af128b6527ec5e9c7/lib/java_buildpack/jre/open_jdk_like.rb:40:in `new'
2017-02-23T15:36:20.95+0100 [STG/0]      ERR /tmp/buildpacks/ee95aca3a4e3b48af128b6527ec5e9c7/lib/java_buildpack/jre/open_jdk_like.rb:40:in `sub_components'
2017-02-23T15:36:20.95+0100 [STG/0]      ERR /tmp/buildpacks/ee95aca3a4e3b48af128b6527ec5e9c7/lib/java_buildpack/component/modular_component.rb:39:in `initialize'
2017-02-23T15:36:20.95+0100 [STG/0]      ERR /tmp/buildpacks/ee95aca3a4e3b48af128b6527ec5e9c7/lib/java_buildpack/buildpack.rb:170:in `new'
2017-02-23T15:36:20.95+0100 [STG/0]      ERR /tmp/buildpacks/ee95aca3a4e3b48af128b6527ec5e9c7/lib/java_buildpack/buildpack.rb:170:in `block in instantiate'
2017-02-23T15:36:20.95+0100 [STG/0]      ERR /tmp/buildpacks/ee95aca3a4e3b48af128b6527ec5e9c7/lib/java_buildpack/buildpack.rb:156:in `map'
2017-02-23T15:36:20.95+0100 [STG/0]      ERR /tmp/buildpacks/ee95aca3a4e3b48af128b6527ec5e9c7/lib/java_buildpack/buildpack.rb:156:in `instantiate'
2017-02-23T15:36:20.95+0100 [STG/0]      ERR /tmp/buildpacks/ee95aca3a4e3b48af128b6527ec5e9c7/lib/java_buildpack/buildpack.rb:128:in `instantiate_components'
2017-02-23T15:36:20.95+0100 [STG/0]      ERR /tmp/buildpacks/ee95aca3a4e3b48af128b6527ec5e9c7/lib/java_buildpack/buildpack.rb:122:in `initialize'
2017-02-23T15:36:20.95+0100 [STG/0]      ERR /tmp/buildpacks/ee95aca3a4e3b48af128b6527ec5e9c7/lib/java_buildpack/buildpack.rb:227:in `new'
2017-02-23T15:36:20.95+0100 [STG/0]      ERR /tmp/buildpacks/ee95aca3a4e3b48af128b6527ec5e9c7/lib/java_buildpack/buildpack.rb:227:in `with_buildpack'
2017-02-23T15:36:20.95+0100 [STG/0]      ERR /tmp/buildpacks/ee95aca3a4e3b48af128b6527ec5e9c7/bin/compile:26:in `<main>'
2017-02-23T15:36:20.95+0100 [STG/0]      ERR Open JDK Like Memory Calculator error: Unable to find cached file for https://java-buildpack.cloudfoundry.org/memory-calculator/trusty/x86_64/index.yml
2017-02-23T15:36:20.95+0100 [STG/0]      ERR Failed to compile droplet
2017-02-23T15:36:20.95+0100 [STG/0]      OUT Exit status 223
2017-02-23T15:36:20.96+0100 [STG/0]      ERR Staging failed: Exited with status 223
rauizab commented 7 years ago

It seems related to https://github.com/cloudfoundry/cf-release/issues/855

nebhale commented 7 years ago

You're using an online version of the buildpack which needs to download its dependencies from the internet:

DEBUG Configuration from /tmp/buildpacks/ee95aca3a4e3b48af128b6527ec5e9c7/config/cache.yml: {"remote_downloads"=>"enabled", "client_authentication"=>{"certificate_location"=>nil, "private_key_location"=>nil, "private_key_password"=>nil}}

However, it was unable to do that download, possibly because of AWS' configuration preventing outgoing network connections:

WARN  Unable to download https://java-buildpack.cloudfoundry.org/memory-calculator/trusty/x86_64/index.yml into cache /tmp: execution expired

You'll need to configure AWS' to allow outbound connections or use the offline buildpack which does not need to make them.

rauizab commented 7 years ago

Hi thanks, we will try as you suggest.