2017-09-14 65 views
-2
Compiled Resource: 
------------------ 
Declared in /etc/chef/src/cookbooks/apache/recipes/default.rb:2:in `from_file` 

    package("apache2-mpm-prefork") do 
     action :install 
     retries 0 
     retry_delay 2 
     package_name "apache2-mpm-prefork" 
     cookbook_name :apache 
     recipe_name "default" 
    end 

错误:运行chef命令安装'package [apache2-mpm-prefork]'。我提示以下错误:

[2017-09-14T04:11:09-07:00] INFO: Running queued delayed notifications before re-raising exception 
Running handlers: 
[2017-09-14T04:11:09-07:00] ERROR: Running exception handlers Running handlers complete 
[2017-09-14T04:11:09-07:00] ERROR: Exception handlers complete 
[2017-09-14T04:11:09-07:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out Chef Client failed. 0 resources updated in 17.146327157 seconds 
[2017-09-14T04:11:09-07:00] ERROR: package[apache2-mpm-prefork] (apache::default line 2) had an error: 
    Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '200' 
---- Begin output of /usr/bin/python /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.10.4/lib/chef/provider/package/yum-dump.py --options --installed-provides 
---- STDOUT: [option installonlypkgs] kernel kernel-bigmem installonlypkg(kernel-module) installonlypkg(vm) 
kernel-enterprise kernel-smp kernel-debug kernel-unsupported 
kernel-source kernel-devel kernel-PAE kernel-PAE-debug kernel-uek 
kernel-uek-bigmem kernel-uek-firmware kernel-uek-enterprise 
kernel-uek-smp kernel-uek-debug kernel-uek-unsupported 
kernel-uek-source kernel-uek-devel kernel-uek-PAE kernel-uek-PAE-debug 
STDERR: yum-dump Locking Error! Couldn't obtain an exclusive yum lock in 10 seconds. Giving up. 
---- End output of /usr/bin/python /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.10.4/lib/chef/provider/package/yum-dump.py --options --installed-provides 
---- 
Ran /usr/bin/python /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.10.4/lib/chef/provider/package/yum-dump.py --options --installed-provides returned 200 
[2017-09-14T04:11:09-07:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1) 

回答

0

错误信息的最重要的部分是:

yum-dump Locking Error! Couldn't obtain an exclusive yum lock in 10 seconds. Giving up.

因此,yum无法得到的包数据库锁这是安装包所需的时间。通常的原因是你计算机上已经获得锁的另一个进程yum,例如,在不同的SSH会话中。

相关问题