При установке пакетов через CHEF на экземпляр Amazon EC2 я получил следующую ошибку:
Cache is out of sync, can't x-ref a package file
на следующих строках:
%w{htop sysstat bwm-ng needrestart debian-goodies}.each do |pkg|
package pkg
end
Я много гуглил, но не нашел ответа, и теперь я знаю, что это значит, и, что более важно, как это предотвратить :(
================================================================================
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?