2012-03-28 94 views
3

我正在運行一個失敗的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 

任何想法如何完成這些校驗和以及如何解決這個問題?

回答

2

調試這些問題的最佳方法是查看它創建的新文件,在此例中爲/etc/mysql/grants.sql,然後查看/var/chef/backup/etc/mysql/grants.sql.chef-20120328125848(來自您發佈的日誌)的備份。總是進行備份,因此您可以比較兩者的內容,並繼續修復Chef配方,以確保其生成相同的內容。

+1

謝謝!那樣做了。我能夠看到確實存在差異。謝謝@Mitchell – NathanBrakk 2012-03-29 18:53:41

+0

這也適用於我。 – 2012-03-29 20:22:27

+0

@NathanBrakk你改變了什麼來解決這個問題? – Autodidact 2012-07-12 08:22:01