2012-01-06 96 views
2

我剛剛開始使用流浪和廚師,但我得到了我認爲很奇怪的錯誤。配置失敗廚師,Mac上的流浪漢10.7.2

任何事情都可以用一個簡單的VM和沒有廚師,但是當我堅持幾個接受者在它失敗。

這是我從vagrantfile調用的主要配方的當前default.rb。它主要是從這個blog/tutorial

r = execute "apt-get update" do 
    user "root" 
    command "apt-get update" 
    action :nothing 
end 
r.run_action(:run) 

include_recipe "php" 
include_recipe "apache2" 
include_recipe "mysql" 

的Apache2的PHP和MySQL的食譜是直接從Opscode公司社區網站。

如果我只是把這些食譜之一,然後它加載罰款。 有時候兩個都很好,但是如果我把所有三個都放在最後,那麼最後一個似乎會導致錯誤。我已經改變了順序,它總是最後一個導致錯誤。以下是錯誤 - 每天同一時間,但在這種情況下,PHP是最後三個,你可以看到它安裝失敗的:

[default] [Fri, 06 Jan 2012 10:01:33 -0800] INFO: Processing package[php5] action install (php::package line 32) 
: stdout 
[default] [Fri, 06 Jan 2012 10:04:52 -0800] ERROR: package[php5] (php::package line 32) has had an error 
: stdout 
[default] [Fri, 06 Jan 2012 10:04:52 -0800] ERROR: Running exception handlers 
: stdout 
[default] [Fri, 06 Jan 2012 10:04:52 -0800] ERROR: Exception handlers complete 
: stdout 
[default] /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/file_cache.rb:54:in `initialize': stderr 
[default] : : stderr 
[default] Read-only file system - /tmp/vagrant-chef-1/chef-stacktrace.out: stderr 
[default] (: stderr 
[default] Errno::EROFS: stderr 
[default]) 
: stderr 
[default] from /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/file_cache.rb:54:in `open' 
: stderr 
[default] from /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/file_cache.rb:54:in `store' 
: stderr 
[default] from /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/application.rb:133:in `debug_stacktrace' 
: stderr 
[default] from /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/application/solo.rb:210:in `run_application' 
: stderr 
[default] from /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/application/solo.rb:183:in `loop' 
: stderr 
[default] from /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/application/solo.rb:183:in `run_application' 
: stderr 
[default] from /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/../lib/chef/application.rb:66:in `run' 
: stderr 
[default] from /opt/ruby/lib/ruby/gems/1.8/gems/chef-0.10.2/bin/chef-solo:25 
    from /opt/ruby/bin/chef-solo:19:in `load' 
    from /opt/ruby/bin/chef-solo:19 
: stderr 
The following SSH command responded with a non-zero exit status. 
Vagrant assumes that this means the command failed! 

chef-solo -c /tmp/vagrant-chef-1/solo.rb -j /tmp/vagrant-chef-1/dna.json 

The output of the command prior to failing is outputted below: 

[no output] 

通常我破壞了虛擬機和做無業遊民爲每一個新的嘗試,但有幾次我嘗試了流浪漢重新加載和流浪漢提供相同的結果。

此外,我不知道這是否正常,但我的Mac幾乎完全鎖定,而它的供應。我通常可以同時運行2個或3個vmware虛擬機,而不會覺得它掙扎太多,所以它完全鎖定是......奇怪。

回答

2

爲響應而歡呼。

原來,我有一些依賴寶石的舊版本。一旦我完成寶石更新,問題就消失了。

+0

確認,爲我工作 - 我得到'只讀文件系統 - /var/chef/cache/chef-stacktrace.out(Errno :: EROFS)'錯誤,'sudo gem update'使它們消失。謝謝! – 2014-05-20 15:18:29

2

我有一個非常類似的錯誤,但似乎已經找到了一個解決方案。

在嘗試了很多東西(不同的基礎盒子,不同的VirtualBox版本,一次又一次地嘗試)之後,我最終通過構建自己的Vagrant基礎盒子而取得了進展。我遵循了流浪者(base box build)和廚師(chef-solo install)網站上的說明。雖然這花了一段時間,而且很棘手,我現在對底盒的狀態有了更好的信心,並且更開心。

我還不知道是什麼原因導致了我們的問題。也許這是VirtualBox guest添加版本中的不匹配,或者是lucid32或lucid64基礎框中的腐敗/不兼容。

僅供參考,我安裝了Ubuntu服務器11.10並從軟件包安裝了Chef。如果有需求,我很樂意將我的(700mb)oneiric64基本圖像上傳到某處。

+0

嗯,我也得到這個。我已經升級了廚師寶石(幾個月前),但是得到了這個錯誤,除了警告「這個虛擬機上的guest虛擬機添加與VirtualBox的安裝版本不匹配」 – 2012-09-17 04:01:50