Creating a new MySQL instance fails with the install hanging at service start
Steps to Reproduce:
My cookbook:
Chef::Log.info('Update package repository')
apt_update 'apt update' do
action :update
only_if { platform_family?('debian') }
end
Chef::Log.info('Installing MySQL')
mysql_service 'rangerdb' do
action [:create, :start]
port '3306'
initial_root_password 'whatever'
end
Vagrantfile:
config.vm.box = "ubuntu/trusty64"
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
end
config.vm.provision "file", source: "~/.chef", destination: "~/"
config.vm.provision "chef_client" do |chef|
chef.chef_server_url = "https://api.chef.io/organizations/xx"
chef.validation_key_path = "~/.chef/xx-validator.pem"
chef.validation_client_name = "~/.chef/xx-validator.pem"
chef.add_recipe "mysql_test"
chef.validation_client_name = "xx-validator"
end
Expected Result:
Install completes without errors
Actual Result:
==> default: * bash[rangerdb initial records] action run
==> default:
==> default: [execute] Installing MySQL system tables...
==> default: Could not open required defaults file: /etc/mysql-rangerdb/my.cnf
==> default: Fatal error in defaults handling. Program aborted
==> default:
==> default: Installation of system tables failed! Examine the logs in
==> default: /var/lib/mysql-rangerdb for more information.
==> default:
==> default: You can try to start the mysqld daemon with:
==> default:
==> default:
==> default: shell> /usr/sbin/mysqld --skip-grant &
==> default:
...
==> default: +
==> default: +kill timeout 300
==> default: +
==> default: +pre-start script
==> default: +[ -d /run/mysql-rangerdb ] || install -m 755 -o mysql -g mysql -d /run/mysql-rangerdb
==> default: +[ -d /run/mysql-rangerdb ] || install -m 755 -o mysql -g mysql -d /run/mysql-rangerdb
==> default: +end script
==> default: +
==> default: +exec /usr/sbin/mysqld --defaults-file=/etc/mysql-rangerdb/my.cnf
==> default: +
==> default: +post-start script
==> default: +/usr/sbin/mysql-rangerdb-wait-ready
==> default: +end script
==> default: [2016-08-11T16:46:28+00:00] INFO: template[/etc/init/mysql-rangerdb.conf] owner changed to 0
==> default: [2016-08-11T16:46:28+00:00] INFO: template[/etc/init/mysql-rangerdb.conf] group changed to 0
==> default: [2016-08-11T16:46:28+00:00] INFO: template[/etc/init/mysql-rangerdb.conf] mode changed to 644
==> default:
==> default: - change mode from '' to '0644'
==> default:
==> default: - change owner from '' to 'root'
==> default:
==> default: - change group from '' to 'root'
==> default:
==> default:
==> default:
==> default: * service[mysql-rangerdb] action start
bash[rangerdb initial records] fails but does not block the cookbook and then MySQL service start hangs because of the uninitialized database.
Cookbook version
8.0.1
Chef-client version
12.12.15
Platform Details
Vagrant with ubuntu/trusty64
Scenario:
Creating a new MySQL instance fails with the install hanging at service start
Steps to Reproduce:
My cookbook:
Vagrantfile:
Expected Result:
Install completes without errors
Actual Result:
...
bash[rangerdb initial records]
fails but does not block the cookbook and then MySQL service start hangs because of the uninitialized database.error.log is empty
/var/log/kern/log: