2017-05-17 3 views
0

パッケージファイルをX-REFことはできませんキャッシュが同期している、Amazon EC2インスタンス上CHEF経由でパッケージをインストールするとき、私は、次のエラーを得た

私はグーグルの多くのビットが、無応答を行なったし、私は今、これはそれを防ぐ方法を意味し、より重要なものを手掛かり:(

================================================================================ 
Error executing action `install` on resource 'apt_package[htop]' 
================================================================================ 

Mixlib::ShellOut::ShellCommandFailed 
------------------------------------ 
Expected process to exit with [0], but received '100' 
---- Begin output of apt-cache policy htop ---- 
STDOUT: htop: 
Installed: 2.0.1-1ubuntu1 
Candidate: 2.0.1-1ubuntu1 
Version table: 
*** 2.0.1-1ubuntu1 500 
500 http://eu-central-1.ec2.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages 
STDERR: E: Cache is out of sync, can't x-ref a package file 
---- End output of apt-cache policy htop ---- 
Ran apt-cache policy htop returned 100 

Resource Declaration: 
--------------------- 
# In /var/chef/runs/0c236d60-212c-4e9a-a6c1-fb8af8960425/local-mode-cache/cache/cookbooks/k2go-common/recipes/setup.rb 

20: package pkg 
21: end 

Compiled Resource: 
------------------ 
# Declared in /var/chef/runs/0c236d60-212c-4e9a-a6c1-fb8af8960425/local-mode-cache/cache/cookbooks/k2go-common/recipes/setup.rb:20:in `block in from_file' 

apt_package("htop") do 
package_name "htop" 
action [:install] 
retries 0 
retry_delay 2 
default_guard_interpreter :default 
declared_type :package 
cookbook_name "k2go-common" 
recipe_name "setup" 
end 

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

[2017-05-17T19:01:36+02:00] INFO: Running queued delayed notifications before re-raising exception 
[2017-05-17T19:01:36+02:00] ERROR: Running exception handlers 
[2017-05-17T19:01:36+02:00] ERROR: Exception handlers complete 
[2017-05-17T19:01:36+02:00] FATAL: Stacktrace dumped to /var/chef/runs/0c236d60-212c-4e9a-a6c1-fb8af8960425/local-mode-cache/cache/chef-stacktrace.out 
[2017-05-17T19:01:36+02:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report 
[2017-05-17T19:01:36+02:00] ERROR: apt_package[htop] (k2go-common::setup line 20) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '100' 
---- Begin output of apt-cache policy htop ---- 
STDOUT: htop: 
Installed: 2.0.1-1ubuntu1 
Candidate: 2.0.1-1ubuntu1 
Version table: 
*** 2.0.1-1ubuntu1 500 
500 http://eu-central-1.ec2.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages 
STDERR: E: Cache is out of sync, can't x-ref a package file 
---- End output of apt-cache policy htop ---- 
Ran apt-cache policy htop returned 100 
[2017-05-17T19:01:36+02:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1) 
を持っていますログに表示されるのは、 http://eu-central-1.ec2.archive.ubuntu.com/ubuntuが500のステータスコードを返すため、Ubuntuに何らかの(短い)停止が発生する可能性があるということですか?私はデフォルトで0である再試行を追加/増やすことができると信じていますか?

+0

を、あなたはもう少しログのトレースを更新してくださいすることができますか? –

+0

ログを更新しました – Alfred

答えて

2

はい、それは、Ubuntuの源で一時的に停止になりますので、再試行オプションを増やすこと

%w{htop sysstat bwm-ng needrestart debian-goodies}.each do |pkg| 
    package pkg do 
    retries 5 
    end 
end 

、すなわち、例外をキャッチして、もう一度再試行するために、リソースを有効にします。しかし、インストールする前に、Ubuntuの上でapt-get updateを実行することは常に良いですインターネットソースから現在インストールされているパッケージパッケージへの更新を含む、インストール可能なパッケージに関する情報を実際に取得するためです。そのために

あなたが使用して見ることができます:

https://docs.chef.io/resource_apt_update.html

https://supermarket.chef.io/cookbooks/apt

1

リソースapt_updateを使用すると、おそらくapt-get updateが必要になります。

関連する問題