Failing to install/recognize install on Amazon Linux 2017.03
This is failing to install or even recognize that it is already installed on Amazon Linux 2017.03 running Chef 13.2, it worked fine on Chef 12.9.41 causing the rest of whatever recipe comes after including java to fail.
Error message:
* No candidate version available for openjdk-8-jdk
================================================================================
Error executing action `install` on resource 'yum_package[openjdk-8-jdk]'
================================================================================
Chef::Exceptions::Package
-------------------------
No candidate version available for openjdk-8-jdk
Resource Declaration:
---------------------
# In /provision/local-mode-cache/cache/cookbooks/java/recipes/openjdk.rb
53: package pkg do
54: version node['java']['openjdk_version'] if node['java']['openjdk_version']
55: notifies :write, 'log[jdk-version-changed]', :immediately
56: end
57: end
Compiled Resource:
------------------
# Declared in /provision/local-mode-cache/cache/cookbooks/java/recipes/openjdk.rb:53:in `block in from_file'
yum_package("openjdk-8-jdk") do
package_name "openjdk-8-jdk"
action [:install]
default_guard_interpreter :default
declared_type :package
cookbook_name "java"
recipe_name "openjdk"
end
System Info:
------------
chef_version=13.2.20
platform=amazon
platform_version=2017.03
ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
program_name=chef-solo worker: ppid=28811;start=01:32:40;
executable=/opt/chef/bin/chef-solo
[2017-09-01T01:32:49+00:00] INFO: Running queued delayed notifications before re-raising exception
Running handlers:
[2017-09-01T01:32:49+00:00] ERROR: Running exception handlers
Running handlers complete
[2017-09-01T01:32:49+00:00] ERROR: Exception handlers complete
Chef Client failed. 3 resources updated in 08 seconds
[2017-09-01T01:32:49+00:00] FATAL: Stacktrace dumped to /provision/local-mode-cache/cache/chef-stacktrace.out
[2017-09-01T01:32:49+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-09-01T01:32:49+00:00] ERROR: yum_package[openjdk-8-jdk] (java::openjdk line 53) had an error: Chef::Exceptions::Package: No candidate version available for openjdk-8-jdk
[2017-09-01T01:32:49+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
recipe is pretty simple in terms of java:
include_recipe 'java'
attributes:
default['java']['jdk_version'] = '8'
although I have tried including the openjdk version as 1.8.0.131-2.b11.30 which ends up with a similar error message.
@rhealitycheck Same issue here. I think it's possibly due to some naming convention changes in the Amazon Linux repos
[ec2-user@ip-10-0-3-46 ~]$ sudo yum -q list java*8*openjdk
Available Packages
java-1.8.0-openjdk.x86_64 1:1.8.0.151-1.b12.35.amzn1 amzn-updates
As a workaround, it works when using install_flavor: "oracle"
@cbalducci nice! I'm going to try that. Thanks for finding this workaround!
Closing due to inactivity.
If this is still an issue please reopen or open another issue. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help!
Thanks, Sous-Chefs