Closed free0ldman closed 8 years ago
I got the same issue here.
8.0.2
12.13.37
CentOS 6.7
I used the sample recipe in mysql
cookbook documentation.
mysql_service 'foo' do
port '3306'
version '5.5'
initial_root_password 'changeme'
action [:create, :start]
end
mysql_config 'foo' do
source 'my.cnf.erb'
notifies :restart, 'mysql_service[foo]'
action :create
end
This is the exception
.
================================================================================
Error executing action `create` on resource 'mysql_service[instance-1]'
================================================================================
Chef::Exceptions::Package
-------------------------
mysql_server_installation_package[instance-1] (/tmp/kitchen/cache/cookbooks/mysql/libraries/mysql_service.rb line 36) had an error: Chef::Exceptions::Package: yum_package[mysql-community-server] (/tmp/kitchen/cache/cookbooks/mysql/libraries/mysql_server_installation_package.rb line 17) had an error: Chef::Exceptions::Package: No candidate version available for mysql-community-server
hi @free0ldman, I made it work by using the old version of mysql. I tested it both CentOS 6.7
and CentOS 6.8
.
I added this in metadata.rb
.
depends 'mysql', '~> 6.0'
This workaround works! I still wonder why the later versions of mysql won't work.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Cookbook version
8.0.2
Chef-client version
12.13.30
Platform Details
CentOS 6.8
Scenario:
In my recipe, I was trying to do a simple install and start of MySQL service, code as below:
mysql_service 'default' do port '3306' version '5.6' bind_address '0.0.0.0' initial_root_password 'MyPass' action [:create, :start] end
Steps to Reproduce:
Using above codes
Expected Result:
MySQL gets installed and started.
Actual Result:
Error shows no candidate for mysql-community-server was found:
mysql_service[test] action create
yum_package[mysql-community-server] action install
* No candidate version available for mysql-community-server
Error executing action
install
on resource 'yum_package[mysql-community-server]'Chef::Exceptions::Package
No candidate version available for mysql-community-server
Resource Declaration:
In /var/chef/cache/cookbooks/mysql/libraries/mysql_server_installation_package.rb
17: package package_name do 18: version package_version if package_version 19: options package_options if package_options 20: notifies :install, 'package[perl-Sys-Hostname-Long]', :immediately if platform_family?('suse') 21: notifies :run, 'execute[Initial DB setup script]', :immediately if platform_family?('suse') 22: action :install 23: end 24:
Compiled Resource:
Declared in /var/chef/cache/cookbooks/mysql/libraries/mysql_server_installation_package.rb:17:in `block in class:MysqlServerInstallationPackage'
yum_package("mysql-community-server") do package_name "mysql-community-server" action [:install] retries 0 retry_delay 2 default_guard_interpreter :default declared_type :package cookbook_name "MyCookbook" flush_cache {:before=>false, :after=>false} version "5.6.29-2.el6" end
Platform:
x86_64-linux