流浪厨师食谱校验和计算

时间:2012-03-28 20:16:11

标签: mysql chef vagrant

我正在运行一个失败的mysql配方。当我在停止后进行流浪时,它声称grants.sql模板的校验和已经改变,导致它不应该重新运行。

[default] [Wed, 28 Mar 2012 12:58:48 -0700] INFO: Processing template[/etc/mysql/grants.sql] action create (mysql::server line 128)
: stdout
[default] [Wed, 28 Mar 2012 12:58:48 -0700] DEBUG: Current content's checksum:  3992e44304b56cebdbd4bf23183ddd78f877539c025227546e19098b0b5872ca
: stdout
[default] [Wed, 28 Mar 2012 12:58:48 -0700] DEBUG: Rendered content's checksum: f967f212b3e7b25a08ed35d086938846c188f6e9980a1ecc42635136841587a4
: stdout
[default] [Wed, 28 Mar 2012 12:58:48 -0700] INFO: template[/etc/mysql/grants.sql] backed up to /var/chef/backup/etc/mysql/grants.sql.chef-20120328125848
: stdout
[default] [Wed, 28 Mar 2012 12:58:48 -0700] INFO: template[/etc/mysql/grants.sql] updated content
: stdout
[default] [Wed, 28 Mar 2012 12:58:48 -0700] INFO: template[/etc/mysql/grants.sql] sending run action to execute[mysql-install-privileges] (immediate)
: stdout
[default] [Wed, 28 Mar 2012 12:58:48 -0700] INFO: Processing execute[mysql-install-privileges] action run (mysql::server line 137)
: stdout
[default] [Wed, 28 Mar 2012 12:58:48 -0700] INFO: execute[mysql-install-privileges] sh(/usr/bin/mysql -u root -p"evanta" < /etc/mysql/grants.sql)
: stdout
[default] [Wed, 28 Mar 2012 12:58:48 -0700] ERROR: execute[mysql-install-privileges] (mysql::server line 137) has had an error
[Wed, 28 Mar 2012 12:58:48 -0700] ERROR: template[/etc/mysql/grants.sql] (/tmp/vagrant-chef-1/chef-solo-1/mysql/recipes/server.rb:128:in `rescue in from_file') had an error:
execute[mysql-install-privileges] (mysql::server line 137) had an error: Chef::Exceptions::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /usr/bin/mysql -u root -p"evanta" < /etc/mysql/grants.sql ----
STDOUT: 
STDERR: ERROR 1396 (HY000) at line 12: Operation CREATE USER failed for 'root'@'%'
---- End output of /usr/bin/mysql -u root -p"evanta" < /etc/mysql/grants.sql ----
Ran /usr/bin/mysql -u root -p"evanta" < /etc/mysql/grants.sql returned 1

有关这些校验和如何完成以及如何解决此问题的任何想法?

1 个答案:

答案 0 :(得分:2)

调试这些问题的最佳方法是查看它创建的新文件,在本例中为/etc/mysql/grants.sql,然后查看/var/chef/backup/etc/mysql/grants.sql.chef-20120328125848处的备份(从日志中查看)发布)。始终进行备份,因此您可以比较两者的内容,然后继续修复Chef配方以确保它生成相同的内容。