2012-05-20 11 views
8

मैं उबंटू 12.04 सर्वर पर opscode cookbook के माध्यम से nginx स्थापित करने का प्रयास कर रहा हूं। मुझे पता है कि यह ओहई पर निर्भर करता है इसलिए मेरे पास उस कुकबुक को भी डाउनलोड किया गया है। जब मैंशेफ-एकल त्रुटि Errno :: ENOENT: ऐसी कोई फ़ाइल या निर्देशिका नहीं - solo.rb

$ sudo chef-solo -c solo.rb 

चलाने मैं

FATAL: Errno::ENOENT: No such file or directory - solo.rb 

लेकर सुनिश्चित नहीं हैं solo.rb जब यह मेरे वर्तमान निर्देशिका में है याद आ रही है कह रही है कोई त्रुटि मिलती है।

$ ls 
cache cookbooks node.json node.json~ solo.rb solo.rb~ 

यहाँ डिबग से उत्पादन होता है

$ sudo chef-solo -l debug -c solo.rb 
[Sun, 20 May 2012 14:00:10 -0400] INFO: *** Chef 0.10.10 *** 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Building node object for vagrant-ubuntu-precise 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Extracting run list from JSON attributes provided on command line 
[Sun, 20 May 2012 14:00:10 -0400] INFO: Setting the run_list to ["recipe[ohai]", "recipe[main]", "recipe[nginx]"] from JSON 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Applying attributes from json file 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Platform is ubuntu version 12.04 
[Sun, 20 May 2012 14:00:10 -0400] INFO: Run List is [recipe[ohai], recipe[main], recipe[nginx]] 
[Sun, 20 May 2012 14:00:10 -0400] INFO: Run List expands to [ohai, main, nginx] 
[Sun, 20 May 2012 14:00:10 -0400] INFO: Starting Chef Run for vagrant-ubuntu-precise 
[Sun, 20 May 2012 14:00:10 -0400] INFO: Running start handlers 
[Sun, 20 May 2012 14:00:10 -0400] INFO: Start handlers complete. 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: No chefignore file found at /var/chef/cookbooks/chefignore no files will be ignored 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Loading cookbook chef-jenkins's library file: /var/chef/cookbooks/chef-jenkins/libraries/manage_node.rb 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Loading cookbook chef-jenkins's providers from /var/chef/cookbooks/chef-jenkins/providers/job.rb 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Loaded contents of /var/chef/cookbooks/chef-jenkins/providers/job.rb into a provider named chef-jenkins_job defined in Chef::Provider::ChefJenkinsJob 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Loading cookbook chef-jenkins's providers from /var/chef/cookbooks/chef-jenkins/providers/execute.rb 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Loaded contents of /var/chef/cookbooks/chef-jenkins/providers/execute.rb into a provider named chef-jenkins_execute defined in Chef::Provider::ChefJenkinsExecute 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Loading cookbook chef-jenkins's providers from /var/chef/cookbooks/chef-jenkins/providers/node.rb 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Loaded contents of /var/chef/cookbooks/chef-jenkins/providers/node.rb into a provider named chef-jenkins_node defined in Chef::Provider::ChefJenkinsNode 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Loading cookbook chef-jenkins's providers from /var/chef/cookbooks/chef-jenkins/providers/cli.rb 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Loaded contents of /var/chef/cookbooks/chef-jenkins/providers/cli.rb into a provider named chef-jenkins_cli defined in Chef::Provider::ChefJenkinsCli 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Loading cookbook chef-jenkins's resources from /var/chef/cookbooks/chef-jenkins/resources/job.rb 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Loaded contents of /var/chef/cookbooks/chef-jenkins/resources/job.rb into a resource named chef-jenkins_job defined in Chef::Resource::ChefJenkinsJob 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Loading cookbook chef-jenkins's resources from /var/chef/cookbooks/chef-jenkins/resources/node.rb 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Loaded contents of /var/chef/cookbooks/chef-jenkins/resources/node.rb into a resource named chef-jenkins_node defined in Chef::Resource::ChefJenkinsNode 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Loading cookbook chef-jenkins's resources from /var/chef/cookbooks/chef-jenkins/resources/execute.rb 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Loaded contents of /var/chef/cookbooks/chef-jenkins/resources/execute.rb into a resource named chef-jenkins_execute defined in Chef::Resource::ChefJenkinsExecute 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Loading cookbook chef-jenkins's resources from /var/chef/cookbooks/chef-jenkins/resources/cli.rb 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Loaded contents of /var/chef/cookbooks/chef-jenkins/resources/cli.rb into a resource named chef-jenkins_cli defined in Chef::Resource::ChefJenkinsCli 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Node vagrant-ubuntu-precise loading cookbook nginx's attribute file /var/chef/cookbooks/nginx/attributes/default.rb 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Node vagrant-ubuntu-precise loading cookbook nginx's attribute file /var/chef/cookbooks/nginx/attributes/geoip.rb 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Node vagrant-ubuntu-precise loading cookbook nginx's attribute file /var/chef/cookbooks/nginx/attributes/source.rb 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Node vagrant-ubuntu-precise loading cookbook nginx's attribute file /var/chef/cookbooks/nginx/attributes/upload_progress.rb 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Node vagrant-ubuntu-precise loading cookbook ohai's attribute file /var/chef/cookbooks/ohai/attributes/default.rb 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Node vagrant-ubuntu-precise loading cookbook chef-jenkins's attribute file /var/chef/cookbooks/chef-jenkins/attributes/default.rb 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Loading cookbook nginx's definitions from /var/chef/cookbooks/nginx/definitions/nginx_site.rb 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Loading Recipe ohai via include_recipe 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Found recipe default in cookbook ohai 
[Sun, 20 May 2012 14:00:10 -0400] INFO: ohai plugins will be at: /etc/chef/ohai_plugins 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Platform ubuntu not found, using all defaults. (Unsupported platform?) 
[Sun, 20 May 2012 14:00:10 -0400] INFO: Processing remote_directory[/etc/chef/ohai_plugins] action create (ohai::default line 23) 
[Sun, 20 May 2012 14:00:10 -0400] INFO: Processing cookbook_file[/etc/chef/ohai_plugins/README] action create (dynamically defined) 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Platform ubuntu not found, using all defaults. (Unsupported platform?) 
[Sun, 20 May 2012 14:00:10 -0400] ERROR: Running exception handlers 
[Sun, 20 May 2012 14:00:10 -0400] ERROR: Exception handlers complete 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Re-raising exception: Errno::ENOENT - No such file or directory - solo.rb 
/var/chef/cookbooks/ohai/recipes/default.rb:41:in `read' 
/var/chef/cookbooks/ohai/recipes/default.rb:41:in `from_file' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/cookbook_version.rb:578:in `load_recipe' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/mixin/language_include_recipe.rb:46:in `load_recipe' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/mixin/language_include_recipe.rb:33:in `include_recipe' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/mixin/language_include_recipe.rb:27:in `each' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/mixin/language_include_recipe.rb:27:in `include_recipe' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/run_context.rb:72:in `load' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/run_context.rb:69:in `each' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/run_context.rb:69:in `load' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/client.rb:199:in `setup_run_context' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/client.rb:162:in `run' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/application/solo.rb:207:in `run_application' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/application/solo.rb:195:in `loop' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/application/solo.rb:195:in `run_application' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/application.rb:70:in `run' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/chef-solo:25 
/usr/local/bin/chef-solo:19:in `load' 
/usr/local/bin/chef-solo:19 
[Sun, 20 May 2012 14:00:10 -0400] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out 
[Sun, 20 May 2012 14:00:10 -0400] DEBUG: Errno::ENOENT: No such file or directory - solo.rb 
/var/chef/cookbooks/ohai/recipes/default.rb:41:in `read' 
/var/chef/cookbooks/ohai/recipes/default.rb:41:in `from_file' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/cookbook_version.rb:578:in `load_recipe' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/mixin/language_include_recipe.rb:46:in `load_recipe' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/mixin/language_include_recipe.rb:33:in `include_recipe' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/mixin/language_include_recipe.rb:27:in `each' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/mixin/language_include_recipe.rb:27:in `include_recipe' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/run_context.rb:72:in `load' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/run_context.rb:69:in `each' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/run_context.rb:69:in `load' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/client.rb:199:in `setup_run_context' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/client.rb:162:in `run' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/application/solo.rb:207:in `run_application' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/application/solo.rb:195:in `loop' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/application/solo.rb:195:in `run_application' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/application.rb:70:in `run' 
/var/lib/gems/1.8/gems/chef-0.10.10/bin/chef-solo:25 
/usr/local/bin/chef-solo:19:in `load' 
/usr/local/bin/chef-solo:19 
[Sun, 20 May 2012 14:00:10 -0400] FATAL: Errno::ENOENT: No such file or directory - solo.rb 
+0

इसके बजाय /solo.rb या /ome/ubuntu/solo.rb जैसे पूर्ण तरीके से प्रयास करें। –

+0

कोशिश की और यह काम नहीं किया। मुझे सटीक एक ही आउटपुट मिला। – Brandon

+0

कोई विचार नहीं। सुडो के बिना 'सुडो सु -' और फिर अपने' मुख्य-एकल 'कमांड को आज़माएं। –

उत्तर

15

यह शेफ के काम के तरीके के कारण है। यह किसी भी प्रकार के अनुमति मुद्दों से बचने के लिए निर्देशिका को बदलता है, लेकिन इसका मतलब यह है कि कमांड लाइन तर्कों तक पहुंच की आवश्यकता वाले प्लगइन्स को यह नहीं पता होगा कि आपके रिश्तेदार पथों को और कैसे प्राप्त किया जाए।

इस मुद्दे को हल करने के लिए शेफ कोड के साथ दायर एक बग है।

अभी के लिए, अपने chef-solo तर्कों के लिए पूर्ण पथ का उपयोग करके समस्याएं ठीक होती हैं। जैसे

$ chef-solo -c /full/path/to/solo.rb -j /full/path/to/node.json -l debug 

या किसी रूप में किसी और ने कहा, /etc/chef/ohai_plugins/README फ़ाइल को निकालना होगा समस्या "ठीक"। यद्यपि वास्तविक तरीके से नहीं, क्योंकि जो कुछ भी कर रहा है वह ओई_प्लगिन फ़ोल्डर पर एक संशोधन समय अद्यतन को ट्रिगर कर रहा है, जिससे सब कुछ पुनः लोड करने के लिए शेफ को ट्रिगर किया जा रहा है। उस कार्यक्षमता की गारंटी नहीं है और उपरोक्त बग तय होने से पहले तोड़ सकता है।

0

महाराज-एकल 0.10.10 अपने solo.rb यह आपके डीबग लॉग के शुरू में निम्न संदेश के साथ शिकायत नहीं मिला, तो:

$ chef-solo -c solo.rb -l debug 
[2012-06-18T23:27:32+03:00] WARN: ***************************************** 
[2012-06-18T23:27:32+03:00] WARN: Did not find config file: solo.rb, using command line options. 
[2012-06-18T23:27:32+03:00] WARN: ***************************************** 
[2012-06-18T23:27:32+03:00] INFO: *** Chef 0.10.10 *** 
... 

तो बग व्यंजनों के तर्क में है जो किसी भी तरह से इस कॉन्फ़िगर फ़ाइल नाम का उपयोग करते हैं।

2

समस्या सबसे अधिक संभावना है "/ etc/chef/ohai_plugins/README" जो प्रत्येक रन के साथ फिर से बनाई जाती है। शेफ-एकल चलाने से पहले आपको इसे हटाने की जरूरत है।

3

यह महाराज-एकल और बावर्ची-ग्राहक के साथ एक बग हो गया लगता है, मैं कुछ खुदाई किया था और यहां एक बग खोला: http://tickets.opscode.com/browse/COOK-1490?focusedCommentId=25572#comment-25572

की तरह पहले से ही वैकल्पिक हल सुझाव दिया गया है config का निरपेक्ष पथ का उपयोग करने के लिए है , किसी भी सापेक्ष पथ में एक ही समस्या है। यह तब भी होता है जब ओहाई नुस्खा किसी भी प्लगइन को बदले बिना चलाया जाता है, यह nginx cookbook के लिए विशिष्ट नहीं है।

संबंधित मुद्दे