2012-01-20 9 views
5

'u döndürür Ubuntu 11.04'ü çalışıyor vagrant, mac os x 10.7.2. Çalışan sunucu şefi.Şef apt (getiri güncelleştirmesi) reçetesini çalıştırmıyor. Apt, 100

postgresql topluluğu şef tarifi yüklemeye çalışıyorum, benim taban rolü böyle bir şey (Ben apt-get güncellemeyi deneyin apt tarifi eklendi) bakar halde, aşağıdaki hatayı alıyorum:

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

bir şef run yapmaya çalışıyor: Ben elle $ sudo yaparsanız sorunsuz postgres yüklemek şef-istemci başka koşmak yapıyor, sunucudan içinden apt-get update

$ 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] 

. Apt tarifinin neden çalışmadığına dair herhangi bir fikir var mı? (Ayrıca, apt-get için zaman damgası dosyasının ubuntu'da oluşturulmadığından çalıştırılmıyor olduğunu biliyorum). Herhangi bir yardım çok takdir edilecektir.

cevap

6

Yani, baskılı hatadan, komutu

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

çalıştıran başarısız gibi görünüyor.

Ama

apt-get update 

İlk çalıştırın ve sonra yeniden hüküm varsa, iyi çalışıyor söyledi?

Benim aşçım, ilk aşçıyı çalıştırdığınızda, istemiş olduğunuz postgresql istemcisinin sürümü, indirilen paketler listesinde değil, ancak bu sürümü apt-get update çalıştırıyor.

Görüyorsunuz, ilk olarak bir base_server tarifi çalıştırıyorsunuz, bu listeye uygun depolar ekliyor mu?

Ne olursa olsun, postgres tarifini çalıştırmadan önce bir apt-get update çalıştırılmasını öneririm, bu düşünmek istiyorum base_server tarifi koymak için muhtemelen uygun bir şey.

+5

Teşekkürler, apt tarifi yapması gereken budur. Sorular, "apt tarifinin bunu yapması gerektiği halde apt olmanın neden güncellenmediği" dir. – Andres

+0

https://github.com/opscode/cookbooks/blob/master/apt/ tarifler/default.rb? Öyleyse, bu sadece OTHER tariflerinden apt-get-update çağırma yeteneğini ayarlar (hat 29'daki yorumu not edin), ancak bu tarifin 33. satırda 'action: nothing' işlevine geçtiğinde çağrıyı çalıştırmaz. –

+2

Bir reçete çalıştırmasından sonra apt-get güncelleme çalıştırmasının kullanılmasının bir örneği, https://github.com/opscode/cookbooks/blob/master/rsyslog/recipes/default.rb#L28 –