2012-01-20 6 views
5

आवारा, मैक ओएस एक्स 10.7.2 पर उबंटू 11.04 चल रहा है। शेफ सर्वर चल रहा है।बावर्ची उपयुक्त (apt-get अद्यतन) नुस्खा नहीं चल रहा है। अपार्टमेंट रिटर्न 100

PostgreSQL समुदाय महाराज नुस्खा स्थापित करने के लिए कोशिश कर रहा है, मैं निम्नलिखित त्रुटि मिलती है, भले ही मेरा आधार भूमिका (मैं उपयुक्त नुस्खा जोड़ा अद्यतन करने के लिए प्रयास करने के लिए apt-get) इस तरह दिखता है:

name "base" 
description "The base role for systems" 
run_list(
     "recipe[apt]", 
     "recipe[vim]" 
) 

एक महाराज रन करने के लिए कोशिश कर रहा है:

$ vagrant reload db1dev 
[db1dev] Attempting graceful shutdown of linux... 
[db1dev] Preparing host only network... 
[db1dev] Clearing any previously set forwarded ports... 
[db1dev] Forwarding ports... 
[db1dev] -- ssh: 22 => 2222 (adapter 1) 
[db1dev] Cleaning previously set shared folders... 
[db1dev] Creating shared folders metadata... 
[db1dev] Running any VM customizations... 
[db1dev] Booting VM... 
[db1dev] Waiting for VM to boot. This can take a few minutes. 
[db1dev] VM booted and ready for use! 
[db1dev] Enabling host only network... 
[db1dev] Mounting shared folders... 
[db1dev] -- v-root: /vagrant 
[db1dev] Running provisioner: Vagrant::Provisioners::ChefClient... 
[db1dev] Creating folder to hold client key... 
[db1dev] Uploading chef client validation key... 
[db1dev] Generating chef JSON and uploading... 
[db1dev] Running chef-client... 
[db1dev] stdin: is not a tty 
: stderr 
[db1dev] [Thu, 19 Jan 2012 21:44:45 -0800] INFO: *** Chef 0.10.2 *** 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:46 -0800] INFO: Client key /etc/chef/client.pem is not present - registering 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:46 -0800] INFO: HTTP Request Returned 404 Not Found: Cannot load node dev-vagrant-db1-andres 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Setting the run_list to ["role[base]", "role[db_master]"] from JSON 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Run List is [role[base], role[db_master]] 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Run List expands to [base_server, vim, postgresql::server] 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Starting Chef Run for dev-vagrant-db1-andres 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Loading cookbooks [base_server, openssl, postgresql, vim] 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Removing cookbooks/apt/resources/repository.rb from the cache; its cookbook is no longer needed on this client. 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Removing cookbooks/apt/metadata.rb from the cache; its cookbook is no longer needed on this client. 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Removing cookbooks/apt/providers/repository.rb from the cache; its cookbook is no longer needed on this client. 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Removing cookbooks/apt/recipes/cacher.rb from the cache; its cookbook is no longer needed on this client. 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Removing cookbooks/apt/recipes/cacher-client.rb from the cache; its cookbook is no longer needed on this client. 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Removing cookbooks/apt/recipes/default.rb from the cache; its cookbook is no longer needed on this client. 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Removing cookbooks/apt/metadata.json from the cache; its cookbook is no longer needed on this client. 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Removing cookbooks/apt/README.md from the cache; its cookbook is no longer needed on this client. 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Storing updated cookbooks/base_server/recipes/default.rb in the cache. 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Storing updated cookbooks/base_server/README.rdoc in the cache. 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Storing updated cookbooks/base_server/metadata.rb in the cache. 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Processing package[postgresql-client] action install (postgresql::client line 37) 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:48 -0800] ERROR: package[postgresql-client] (postgresql::client line 37) has had an error 
[Thu, 19 Jan 2012 21:44:48 -0800] ERROR: Running exception handlers 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:48 -0800] FATAL: Saving node information to /srv/chef/file_store/failed-run-data.json 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:48 -0800] ERROR: Exception handlers complete 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:48 -0800] FATAL: Stacktrace dumped to /srv/chef/file_store/chef-stacktrace.out 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:48 -0800] FATAL: Chef::Exceptions::Exec: package[postgresql-client] (postgresql::client line 37) had an error: apt-get -q -y install postgresql-client=8.4.8-0ubuntu0.10.04 returned 100, expected 0 
: stdout 
The following SSH command responded with a non-zero exit status. 
Vagrant assumes that this means the command failed! 

chef-client -c /etc/chef/client.rb -j /etc/chef/dna.json 

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

[no output] 

मैं स्वयं एक $ sudo करते हैं सर्वर अंदर से अद्यतन apt-get, महाराज-ग्राहक का एक और रन कर एक समस्या के बिना postgres स्थापित करें। एपीटी रेसिपी क्यों नहीं चल रही है इस पर कोई विचार? (मुझे यह भी पता है कि यह नहीं चल रहा है क्योंकि apt-get के लिए टाइमस्टैम्प फ़ाइल उबंटू में नहीं बनाई गई है)। कोई भी सहायताकाफी प्रशंसनीय होगी।

उत्तर

6

तो, त्रुटि आप प्रिंट किए गए, यह उस आदेश

apt-get -q -y install postgresql-client=8.4.8-0ubuntu0.10.04 

चल विफल हो रहा है लगता है।

लेकिन तुम ने कहा है कि यदि आप

apt-get update 

पहले चलाने के लिए, और उसके बाद फिर से प्रावधान है, यह ठीक काम करता है?

मेरा हंच यह है कि जब आप पहली बार शेफ चलाते हैं, तो पोस्टग्रेस्क्ल क्लाइंट का संस्करण आप अनुरोध कर रहे हैं, यह एपीटी पैकेज की आपकी डाउनलोड की गई सूची में नहीं है, लेकिन apt-get update को उस संस्करण को पाता है।

मैं देख रहा हूँ कि तुम एक base_server नुस्खा चल रहे पहले, उस सूची के लिए उपयुक्त खजाने को जोड़ने है?

भले ही, मैं पोस्टग्रेस रेसिपी चलाने से पहले apt-get update चलाने की अनुशंसा करता हूं, यह ऐसा कुछ है जो बेस_सर्वर रेसिपी में डालने के लिए उपयुक्त होगा।

+5

धन्यवाद, कि क्या उपयुक्त नुस्खा क्या करना चाहिए है। सवाल यह है कि "एपीटी रेसिपी ऐसा करने के बावजूद अद्यतन क्यों नहीं किया जा रहा है," – Andres

+0

क्या आप https://github.com/opscode/cookbooks/blob/master/apt/ के आधार पर नुस्खा का उपयोग कर रहे हैं व्यंजनों/default.rb? यदि ऐसा है, तो यह अन्य व्यंजनों से एपीटी-गेट-अपडेट को कॉल करने की क्षमता सेट करता है (लाइन 2 9 पर टिप्पणी को नोट करें), लेकिन जब यह नुस्खा लाइन 33 पर 'कार्रवाई: कुछ भी नहीं' पर चलता है तो कॉल नहीं चलाता है। –

+2

नुस्खा चलाने के बाद एपीटी-गेट अपडेट निष्पादन का उपयोग करने का एक उदाहरण https://github.com/opscode/cookbooks/blob/master/rsyslog/recipes/default.rb#L28 –

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