2016-06-28 91 views
0

我試圖按照現有的廚師獨奏政黨成員在http://gettingstartedwithchef.com/first-steps-with-chef.html廚師獨奏 - 政黨成員:錯誤解決食譜的運行列表

但是當我鍵入「廚師獨奏-c solo.rb -j網絡。 json「,我有以下錯誤消息

[email protected]:/vagrant/chef-repo$ sudo chef-solo -c solo.rb -j web.json 
Starting Chef Client, version 12.11.18 
resolving cookbooks for run list: ["apt", "phpapp"] 

================================================================================ 
Error Resolving Cookbooks for Run List: 
================================================================================ 

Missing Cookbooks: 
------------------ 
No such cookbook: compat_resource 

Expanded Run List: 
------------------ 
* apt 
* phpapp 

Platform: 
--------- 
x86_64-linux 

Running handlers: 
[2016-06-28T16:30:44+00:00] ERROR: Running exception handlers 
Running handlers complete 
[2016-06-28T16:30:44+00:00] ERROR: Exception handlers complete 
Chef Client failed. 0 resources updated in 05 seconds 
[2016-06-28T16:30:44+00:00] FATAL: Stacktrace dumped to /vagrant/chef-solo/chef-stacktrace.out 
[2016-06-28T16:30:44+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report 
[2016-06-28T16:30:44+00:00] ERROR: 412 "Precondition Failed" 
[2016-06-28T16:30:45+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1) 
[email protected]:/vagrant/chef-repo$ 

我正在使用一個虛擬的盒子虛擬機(Ubuntu Precise)。 我正在使用vagrant目錄來存儲文件,並且我與vagrant用戶一起登錄,與tuto只有這些差異。 所以,我已經取代

echo "cookbook_path [ '/root/chef-repo/cookbooks' ]" > .chef/knife.rb 

通過

echo "cookbook_path [ '/vagrant/chef-repo/cookbooks' ]" > .chef/knife.rb 

,並在solo.rb文件

file_cache_path "/root/chef-solo" 
cookbook_path "/root/chef-repo/cookbooks" 

通過

file_cache_path "/vagrant/chef-solo" 
cookbook_path "/vagrant/chef-repo/cookbooks" 

哪裏錯了嗎?

請參閱下面的廚師stacktrace.out文件的內容:

Generated at 2016-06-28 16:30:44 +0000 
Net::HTTPServerException: 412 "Precondition Failed" 
/opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:119:in `error!' 
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/http.rb:146:in `request' 
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/http.rb:127:in `post' 
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/policy_builder/expand_node_object.rb:204:in `sync_cookbooks' 
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/policy_builder/expand_node_object.rb:83:in `setup_run_context' 
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/client.rb:510:in `setup_run_context' 
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/client.rb:280:in `run' 
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:286:in `block in fork_chef_client' 
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:274:in `fork' 
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:274:in `fork_chef_client' 
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:239:in `block in run_chef_client' 
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/local_mode.rb:44:in `with_server_connectivity' 
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:227:in `run_chef_client' 
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:456:in `sleep_then_run_chef_client' 
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:443:in `block in interval_run_chef_client' 
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:442:in `loop' 
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:442:in `interval_run_chef_client' 
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/client.rb:426:in `run_application' 
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application.rb:59:in `run' 
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/lib/chef/application/solo.rb:217:in `run' 
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.11.18/bin/chef-solo:25:in `<top (required)>' 
/usr/bin/chef-solo:52:in `load' 
/usr/bin/chef-solo:52:in `<main>' 

回答

0

不幸的教程是幾年過時的,你可以從廚師客戶端的自我報告的版本是幾歲告訴顯示爲。您可以在https://learn.chef.io/

當前廚師教程要回答這個問題實際:您使用本例中的食譜一個對另一個社區菜譜的依賴,所以依賴性必須存在於它的功能。這由Berkshelf和Policyfiles等較新的Cookbook下載工具自動處理。

+0

感謝您的回答。我不知道這個教程比較老。沒有日期。我們可以看到Chef-solo的版本是11.4.0。我不認爲這是一個非常老的版本。 – ManWithNoName