Recipe error on centos -- (grant/access denied)


#1

It looks like mysql::server is trying to setup grants passing -p<> but immediately after installation there is no password.

[root@s1 ~]# chef-client -V
[Wed, 29 Dec 2010 22:59:59 +0000] INFO: Starting Chef Run (Version 0.9.8)
[Wed, 29 Dec 2010 22:59:59 +0000] INFO: Starting Chef Run (Version 0.9.8)
[Wed, 29 Dec 2010 23:00:03 +0000] INFO: Installing package[mysql-devel] version
5.0.77-4.el5_5.4
[Wed, 29 Dec 2010 23:00:03 +0000] INFO: Installing package[mysql-devel] version
5.0.77-4.el5_5.4
[Wed, 29 Dec 2010 23:00:16 +0000] WARN: Could not find previously defined
grants.sql resource
[Wed, 29 Dec 2010 23:00:16 +0000] WARN: Could not find previously defined
grants.sql resource
[Wed, 29 Dec 2010 23:00:17 +0000] INFO: Ran execute[generate-module-list]
successfully
[Wed, 29 Dec 2010 23:00:17 +0000] INFO: Ran execute[generate-module-list]
successfully
[Wed, 29 Dec 2010 23:00:17 +0000] INFO: Upgrading package[php-mysql] version
from uninstalled to 5.1.6-27.el5_5.3
[Wed, 29 Dec 2010 23:00:17 +0000] INFO: Upgrading package[php-mysql] version
from uninstalled to 5.1.6-27.el5_5.3
[Wed, 29 Dec 2010 23:00:24 +0000] INFO: Installing package[ruby-mysql] version
2.7.3-1.el5
[Wed, 29 Dec 2010 23:00:24 +0000] INFO: Installing package[ruby-mysql] version
2.7.3-1.el5
[Wed, 29 Dec 2010 23:00:31 +0000] INFO: Installing package[mysql-server]
version 5.0.77-4.el5_5.4
[Wed, 29 Dec 2010 23:00:31 +0000] INFO: Installing package[mysql-server]
version 5.0.77-4.el5_5.4
[Wed, 29 Dec 2010 23:00:40 +0000] INFO: Writing updated content for
template[/etc/my.cnf] to /etc/my.cnf
[Wed, 29 Dec 2010 23:00:40 +0000] INFO: Writing updated content for
template[/etc/my.cnf] to /etc/my.cnf
[Wed, 29 Dec 2010 23:00:40 +0000] INFO: Backing up template[/etc/my.cnf] to
/var/chef/backup/etc/my.cnf.chef-20101229230040
[Wed, 29 Dec 2010 23:00:40 +0000] INFO: Backing up template[/etc/my.cnf] to
/var/chef/backup/etc/my.cnf.chef-20101229230040
[Wed, 29 Dec 2010 23:00:40 +0000] INFO: template[/etc/my.cnf] sending restart
action to service[mysql] (immediate)
[Wed, 29 Dec 2010 23:00:40 +0000] INFO: template[/etc/my.cnf] sending restart
action to service[mysql] (immediate)
[Wed, 29 Dec 2010 23:00:42 +0000] INFO: service[mysql]: restarted successfully
[Wed, 29 Dec 2010 23:00:42 +0000] INFO: service[mysql]: restarted successfully
[Wed, 29 Dec 2010 23:00:48 +0000] INFO: Writing updated content for
template[/etc/mysql/grants.sql] to /etc/mysql_grants.sql
[Wed, 29 Dec 2010 23:00:48 +0000] INFO: Writing updated content for
template[/etc/mysql/grants.sql] to /etc/mysql_grants.sql
[Wed, 29 Dec 2010 23:00:48 +0000] INFO: template[/etc/mysql/grants.sql] sending
run action to execute[mysql-install-privileges] (immediate)
[Wed, 29 Dec 2010 23:00:48 +0000] INFO: template[/etc/mysql/grants.sql] sending
run action to execute[mysql-install-privileges] (immediate)
[Wed, 29 Dec 2010 23:00:48 +0000] ERROR: template[/etc/mysql/grants.sql]
(/var/chef/cache/cookbooks/mysql/recipes/server.rb:95:in from_file') had an error: /usr/bin/mysql -u root -pedUnXmswsyRVosSUpwrE < /etc/mysql_grants.sql returned 1, expected 0 /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:184:inhandle_command_failures’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/mixin/command.rb:131:in
run_command' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/provider/execute.rb:49:inaction_run’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:51:in send' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:inrun_action’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:58:in
run_action' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:56:ineach’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:56:in
run_action' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:109:inconverge’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:108:in each' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:108:inconverge’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection.rb:94:in
execute_each_resource' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:incall’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:116:in
call_iterator_block' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:instep’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:104:in
iterate' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:ineach_with_index’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection.rb:92:in
execute_each_resource' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:82:inconverge’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/client.rb:304:in
converge' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/client.rb:106:inrun’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application/client.rb:212:in
run_application' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/client.rb:202:inloop’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application/client.rb:202:in
run_application' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application.rb:62:inrun’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/chef-client:26
/usr/bin/chef-client:19:in load' /usr/bin/chef-client:19 [Wed, 29 Dec 2010 23:00:48 +0000] ERROR: template[/etc/mysql/grants.sql] (/var/chef/cache/cookbooks/mysql/recipes/server.rb:95:infrom_file’) had an
error:
/usr/bin/mysql -u root -pedUnXmswsyRVosSUpwrE < /etc/mysql_grants.sql returned
1, expected 0
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/mixin/command.rb:184:in
handle_command_failures' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:131:inrun_command’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/provider/execute.rb:49:in
action_run' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:insend’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:51:in
run_action' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:58:inrun_action’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:56:in each' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:56:inrun_action’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:109:in
converge' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:108:ineach’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:108:in
converge' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection.rb:94:inexecute_each_resource’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:116:in
call' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:incall_iterator_block’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:85:in
step' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:initerate’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:55:in
each_with_index' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection.rb:92:inexecute_each_resource’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:82:in
converge' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/client.rb:304:inconverge’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/client.rb:106:in run' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/client.rb:212:inrun_application’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application/client.rb:202:in
loop' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/client.rb:202:inrun_application’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application.rb:62:in
run' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/chef-client:26 /usr/bin/chef-client:19:inload’
/usr/bin/chef-client:19
[Wed, 29 Dec 2010 23:00:48 +0000] ERROR: Running exception handlers
[Wed, 29 Dec 2010 23:00:48 +0000] ERROR: Running exception handlers
[Wed, 29 Dec 2010 23:00:48 +0000] ERROR: Exception handlers complete
[Wed, 29 Dec 2010 23:00:48 +0000] ERROR: Exception handlers complete
[Wed, 29 Dec 2010 23:00:48 +0000] ERROR: Re-raising exception:
Chef::Exceptions::Exec - /usr/bin/mysql -u root -pedUnXmswsyRVosSUpwrE <
/etc/mysql_grants.sql returned 1, expected 0
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/mixin/command.rb:184:in
`handle_command_failures’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/mixin/command.rb:131:in
`run_command’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/provider/execute.rb:49:in
action_run' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:insend’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:51:in
run_action' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:58:inrun_action’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:56:in each' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:56:inrun_action’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:109:in
converge' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:108:ineach’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:108:in
`converge’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection.rb:94:in
`execute_each_resource’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:116:in
`call’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:116:in
`call_iterator_block’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:85:in
`step’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:104:in
`iterate’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:55:in
`each_with_index’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection.rb:92:in
execute_each_resource' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:82:inconverge’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/client.rb:304:in
converge' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/client.rb:106:inrun’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application/client.rb:212:in
`run_application’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application/client.rb:202:in
`loop’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application/client.rb:202:in
run_application' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application.rb:62:inrun’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/chef-client:26
/usr/bin/chef-client:19:in load' /usr/bin/chef-client:19 [Wed, 29 Dec 2010 23:00:48 +0000] ERROR: Re-raising exception: Chef::Exceptions::Exec - /usr/bin/mysql -u root -pedUnXmswsyRVosSUpwrE < /etc/mysql_grants.sql returned 1, expected 0 /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:184:inhandle_command_failures’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/mixin/command.rb:131:in
`run_command’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/provider/execute.rb:49:in
action_run' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:insend’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:51:in
run_action' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:58:inrun_action’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:56:in each' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:56:inrun_action’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:109:in
converge' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:108:ineach’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:108:in
`converge’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection.rb:94:in
`execute_each_resource’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:116:in
`call’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:116:in
`call_iterator_block’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:85:in
`step’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:104:in
`iterate’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:55:in
`each_with_index’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection.rb:92:in
execute_each_resource' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:82:inconverge’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/client.rb:304:in
converge' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/client.rb:106:inrun’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application/client.rb:212:in
`run_application’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application/client.rb:202:in
`loop’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application/client.rb:202:in
run_application' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application.rb:62:inrun’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/chef-client:26
/usr/bin/chef-client:19:in load' /usr/bin/chef-client:19 /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:184:inhandle_command_failures’: /usr/bin/mysql -u root -pedUnXmswsyRVosSUpwrE <
/etc/mysql_grants.sql returned 1, expected 0 (Chef::Exceptions::Exec)
from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/mixin/command.rb:131:in
run_command' from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/provider/execute.rb:49:inaction_run’
from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:51:in send' from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:inrun_action’
from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:58:in
run_action' from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:56:ineach’
from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:56:in
run_action' from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:109:inconverge’
… 15 levels…
from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application.rb:62:in
run' from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/chef-client:26 from /usr/bin/chef-client:19:inload’
from /usr/bin/chef-client:19
[root@s1 ~]# /usr/bin/mysql -u root -pedUnXmswsyRVosSUpwrE <
/etc/mysql_grants.sql
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password:
YES)


#2

This is an easy fix…just need to execute:

mysqladmin -u root password NEWPASSWORD

on non-debian platforms (where no preseeding occurs). I will test my fix on CentOS and push a new version of the mysql cookbook to cookbooks.opscode.com shortly.

-Seth


Opscode, Inc.
Seth Chisamore, Technical Evangelist
T: (404) 348-0505 E: schisamo@opscode.com
Twitter, IRC, Github: schisamo

On Wednesday, December 29, 2010 at 8:39 PM, E Camden Fisher wrote:

It looks like mysql::server is trying to setup grants passing -p<> but immediately after installation there is no password.

[root@s1 ~]# chef-client -V
[Wed, 29 Dec 2010 22:59:59 +0000] INFO: Starting Chef Run (Version 0.9.8)
[Wed, 29 Dec 2010 22:59:59 +0000] INFO: Starting Chef Run (Version 0.9.8)
[Wed, 29 Dec 2010 23:00:03 +0000] INFO: Installing package[mysql-devel] version
5.0.77-4.el5_5.4
[Wed, 29 Dec 2010 23:00:03 +0000] INFO: Installing package[mysql-devel] version
5.0.77-4.el5_5.4
[Wed, 29 Dec 2010 23:00:16 +0000] WARN: Could not find previously defined
grants.sql resource
[Wed, 29 Dec 2010 23:00:16 +0000] WARN: Could not find previously defined
grants.sql resource
[Wed, 29 Dec 2010 23:00:17 +0000] INFO: Ran execute[generate-module-list]
successfully
[Wed, 29 Dec 2010 23:00:17 +0000] INFO: Ran execute[generate-module-list]
successfully
[Wed, 29 Dec 2010 23:00:17 +0000] INFO: Upgrading package[php-mysql] version
from uninstalled to 5.1.6-27.el5_5.3
[Wed, 29 Dec 2010 23:00:17 +0000] INFO: Upgrading package[php-mysql] version
from uninstalled to 5.1.6-27.el5_5.3
[Wed, 29 Dec 2010 23:00:24 +0000] INFO: Installing package[ruby-mysql] version
2.7.3-1.el5
[Wed, 29 Dec 2010 23:00:24 +0000] INFO: Installing package[ruby-mysql] version
2.7.3-1.el5
[Wed, 29 Dec 2010 23:00:31 +0000] INFO: Installing package[mysql-server]
version 5.0.77-4.el5_5.4
[Wed, 29 Dec 2010 23:00:31 +0000] INFO: Installing package[mysql-server]
version 5.0.77-4.el5_5.4
[Wed, 29 Dec 2010 23:00:40 +0000] INFO: Writing updated content for
template[/etc/my.cnf] to /etc/my.cnf
[Wed, 29 Dec 2010 23:00:40 +0000] INFO: Writing updated content for
template[/etc/my.cnf] to /etc/my.cnf
[Wed, 29 Dec 2010 23:00:40 +0000] INFO: Backing up template[/etc/my.cnf] to
/var/chef/backup/etc/my.cnf.chef-20101229230040
[Wed, 29 Dec 2010 23:00:40 +0000] INFO: Backing up template[/etc/my.cnf] to
/var/chef/backup/etc/my.cnf.chef-20101229230040
[Wed, 29 Dec 2010 23:00:40 +0000] INFO: template[/etc/my.cnf] sending restart
action to service[mysql] (immediate)
[Wed, 29 Dec 2010 23:00:40 +0000] INFO: template[/etc/my.cnf] sending restart
action to service[mysql] (immediate)
[Wed, 29 Dec 2010 23:00:42 +0000] INFO: service[mysql]: restarted successfully
[Wed, 29 Dec 2010 23:00:42 +0000] INFO: service[mysql]: restarted successfully
[Wed, 29 Dec 2010 23:00:48 +0000] INFO: Writing updated content for
template[/etc/mysql/grants.sql] to /etc/mysql_grants.sql
[Wed, 29 Dec 2010 23:00:48 +0000] INFO: Writing updated content for
template[/etc/mysql/grants.sql] to /etc/mysql_grants.sql
[Wed, 29 Dec 2010 23:00:48 +0000] INFO: template[/etc/mysql/grants.sql] sending
run action to execute[mysql-install-privileges] (immediate)
[Wed, 29 Dec 2010 23:00:48 +0000] INFO: template[/etc/mysql/grants.sql] sending
run action to execute[mysql-install-privileges] (immediate)
[Wed, 29 Dec 2010 23:00:48 +0000] ERROR: template[/etc/mysql/grants.sql]
(/var/chef/cache/cookbooks/mysql/recipes/server.rb:95:in from_file') had an error: /usr/bin/mysql -u root -pedUnXmswsyRVosSUpwrE < /etc/mysql_grants.sql returned 1, expected 0 /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:184:inhandle_command_failures’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/mixin/command.rb:131:in
run_command' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/provider/execute.rb:49:inaction_run’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:51:in send' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:inrun_action’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:58:in
run_action' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:56:ineach’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:56:in
run_action' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:109:inconverge’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:108:in each' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:108:inconverge’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection.rb:94:in
execute_each_resource' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:incall’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:116:in
call_iterator_block' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:instep’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:104:in
iterate' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:ineach_with_index’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection.rb:92:in
execute_each_resource' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:82:inconverge’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/client.rb:304:in
converge' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/client.rb:106:inrun’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application/client.rb:212:in
run_application' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/client.rb:202:inloop’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application/client.rb:202:in
run_application' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application.rb:62:inrun’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/chef-client:26
/usr/bin/chef-client:19:in load' /usr/bin/chef-client:19 [Wed, 29 Dec 2010 23:00:48 +0000] ERROR: template[/etc/mysql/grants.sql] (/var/chef/cache/cookbooks/mysql/recipes/server.rb:95:infrom_file’) had an
error:
/usr/bin/mysql -u root -pedUnXmswsyRVosSUpwrE < /etc/mysql_grants.sql returned
1, expected 0
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/mixin/command.rb:184:in
handle_command_failures' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:131:inrun_command’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/provider/execute.rb:49:in
action_run' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:insend’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:51:in
run_action' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:58:inrun_action’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:56:in each' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:56:inrun_action’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:109:in
converge' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:108:ineach’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:108:in
converge' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection.rb:94:inexecute_each_resource’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:116:in
call' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:incall_iterator_block’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:85:in
step' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:initerate’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:55:in
each_with_index' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/resource_collection.rb:92:inexecute_each_resource’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:82:in
converge' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/client.rb:304:inconverge’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/client.rb:106:in run' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/client.rb:212:inrun_application’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application/client.rb:202:in
loop' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application/client.rb:202:inrun_application’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application.rb:62:in
run' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/chef-client:26 /usr/bin/chef-client:19:inload’
/usr/bin/chef-client:19
[Wed, 29 Dec 2010 23:00:48 +0000] ERROR: Running exception handlers
[Wed, 29 Dec 2010 23:00:48 +0000] ERROR: Running exception handlers
[Wed, 29 Dec 2010 23:00:48 +0000] ERROR: Exception handlers complete
[Wed, 29 Dec 2010 23:00:48 +0000] ERROR: Exception handlers complete
[Wed, 29 Dec 2010 23:00:48 +0000] ERROR: Re-raising exception:
Chef::Exceptions::Exec - /usr/bin/mysql -u root -pedUnXmswsyRVosSUpwrE <
/etc/mysql_grants.sql returned 1, expected 0
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/mixin/command.rb:184:in
`handle_command_failures’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/mixin/command.rb:131:in
`run_command’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/provider/execute.rb:49:in
action_run' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:insend’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:51:in
run_action' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:58:inrun_action’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:56:in each' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:56:inrun_action’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:109:in
converge' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:108:ineach’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:108:in
`converge’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection.rb:94:in
`execute_each_resource’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:116:in
`call’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:116:in
`call_iterator_block’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:85:in
`step’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:104:in
`iterate’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:55:in
`each_with_index’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection.rb:92:in
execute_each_resource' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:82:inconverge’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/client.rb:304:in
converge' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/client.rb:106:inrun’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application/client.rb:212:in
`run_application’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application/client.rb:202:in
`loop’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application/client.rb:202:in
run_application' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application.rb:62:inrun’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/chef-client:26
/usr/bin/chef-client:19:in load' /usr/bin/chef-client:19 [Wed, 29 Dec 2010 23:00:48 +0000] ERROR: Re-raising exception: Chef::Exceptions::Exec - /usr/bin/mysql -u root -pedUnXmswsyRVosSUpwrE < /etc/mysql_grants.sql returned 1, expected 0 /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:184:inhandle_command_failures’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/mixin/command.rb:131:in
`run_command’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/provider/execute.rb:49:in
action_run' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:insend’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:51:in
run_action' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:58:inrun_action’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:56:in each' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:56:inrun_action’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:109:in
converge' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:108:ineach’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:108:in
`converge’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection.rb:94:in
`execute_each_resource’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:116:in
`call’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:116:in
`call_iterator_block’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:85:in
`step’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:104:in
`iterate’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection/stepable_iterator.rb:55:in
`each_with_index’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/resource_collection.rb:92:in
execute_each_resource' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:82:inconverge’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/client.rb:304:in
converge' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/client.rb:106:inrun’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application/client.rb:212:in
`run_application’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application/client.rb:202:in
`loop’

/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application/client.rb:202:in
run_application' /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/application.rb:62:inrun’
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/chef-client:26
/usr/bin/chef-client:19:in load' /usr/bin/chef-client:19 /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/mixin/command.rb:184:inhandle_command_failures’: /usr/bin/mysql -u root -pedUnXmswsyRVosSUpwrE <
/etc/mysql_grants.sql returned 1, expected 0 (Chef::Exceptions::Exec)
from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/mixin/command.rb:131:in
run_command' from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/provider/execute.rb:49:inaction_run’
from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:51:in send' from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:51:inrun_action’
from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:58:in
run_action' from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:56:ineach’
from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/runner.rb:56:in
run_action' from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/runner.rb:109:inconverge’
… 15 levels…
from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/…/lib/chef/application.rb:62:in
run' from /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/bin/chef-client:26 from /usr/bin/chef-client:19:inload’
from /usr/bin/chef-client:19
[root@s1 ~]# /usr/bin/mysql -u root -pedUnXmswsyRVosSUpwrE <
/etc/mysql_grants.sql
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password:
YES)