1

我正在尝试在 amzaon Virtual Private Cloud 的 ubuntu 10.04 上使用 opscode chef 安装 mongodb 食谱。我的错误堆栈是:

[Sat, 14 Apr 2012 04:26:00 +0000] INFO: Processing ruby_block[set-env-java-home] action create (java::openjdk line 36)
[Sat, 14 Apr 2012 04:26:00 +0000] INFO: ruby_block[set-env-java-home] called
[Sat, 14 Apr 2012 04:26:00 +0000] INFO: Processing ruby_block[update-java-alternatives] action nothing (java::openjdk line 43)
[Sat, 14 Apr 2012 04:26:00 +0000] INFO: Processing package[openjdk-6-jdk] action install (java::openjdk line 79)
[Sat, 14 Apr 2012 04:28:03 +0000] INFO: package[openjdk-6-jdk] installed version 6b20-1.9.13-0ubuntu1~10.04.1
[Sat, 14 Apr 2012 04:28:03 +0000] INFO: Processing execute[apt-get update] action nothing (mongodb::10gen_repo line 28)
[Sat, 14 Apr 2012 04:28:03 +0000] INFO: Processing apt_repository[10gen] action add (mongodb::10gen_repo line 32)
[Sat, 14 Apr 2012 04:28:03 +0000] INFO: Processing execute[install-key 7F0CEB10] action run (/var/chef/cache/cookbooks/apt/providers/repository.rb line 23)
[Sat, 14 Apr 2012 04:28:03 +0000] INFO: execute[install-key 7F0CEB10] sh(apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10)
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv 7F0CEB10
gpgkeys: HTTP fetch error 7: couldn't connect to host
[Sat, 14 Apr 2012 04:28:24 +0000] ERROR: execute[install-key 7F0CEB10] (/var/chef/cache/cookbooks/apt/providers/repository.rb line 23) has had an error
[Sat, 14 Apr 2012 04:28:24 +0000] ERROR: apt_repository[10gen] (mongodb::10gen_repo line 32) has had an error
[Sat, 14 Apr 2012 04:28:24 +0000] ERROR: apt_repository[10gen] (/var/chef/cache/cookbooks/mongodb/recipes/10gen_repo.rb:32:in `from_file') had an error:
apt_repository[10gen] (mongodb::10gen_repo line 32) had an error: Chef::Exceptions::ShellCommandFailed: execute[install-key 7F0CEB10] (/var/chef/cache/cookbooks/apt/providers/repository.rb line 23) had an error: Chef::Exceptions::ShellCommandFailed: Expected process to exit with [0], but received '2'
---- Begin output of apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 ----
STDOUT: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv 7F0CEB10
gpgkeys: HTTP fetch error 7: couldn't connect to host
STDERR: gpg: requesting key 7F0CEB10 from hkp server keyserver.ubuntu.com
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
---- End output of apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 ----
Ran apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 returned 2
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/shell_out.rb:206:in `invalid!'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/shell_out.rb:192:in `error!'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/mixin/shell_out.rb:36:in `shell_out!'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/provider/execute.rb:58:in `action_run'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/resource.rb:440:in `send'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/resource.rb:440:in `run_action'
/var/chef/cache/cookbooks/apt/providers/repository.rb:26:in `install_key_from_keyserver'
/var/chef/cache/cookbooks/apt/providers/repository.rb:73:in `class_from_file'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/provider.rb:104:in `instance_eval'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/provider.rb:104:in `action_add'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/resource.rb:440:in `send'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/resource.rb:440:in `run_action'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/runner.rb:45:in `run_action'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/runner.rb:81:in `converge'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/runner.rb:81:in `each'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/runner.rb:81:in `converge'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/resource_collection.rb:94
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/resource_collection.rb:92:in `execute_each_resource'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/runner.rb:76:in `converge'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/client.rb:312:in `converge'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/client.rb:160:in `run'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/application/client.rb:239:in `run_application'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/application/client.rb:229:in `loop'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/application/client.rb:229:in `run_application'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/../lib/chef/application.rb:67:in `run'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.8/bin/chef-client:26
/usr/bin/chef-client:19:in `load'
/usr/bin/chef-client:19
[Sat, 14 Apr 2012 04:28:24 +0000] ERROR: Running exception handlers
[Sat, 14 Apr 2012 04:28:24 +0000] FATAL: Saving node information to /var/chef/cache/failed-run-data.json
[Sat, 14 Apr 2012 04:28:24 +0000] ERROR: Exception handlers complete
[Sat, 14 Apr 2012 04:28:24 +0000] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[Sat, 14 Apr 2012 04:28:24 +0000] FATAL: Chef::Exceptions::ShellCommandFailed: apt_repository[10gen] (mongodb::10gen_repo line 32) had an error: Chef::Exceptions::ShellCommandFailed: execute[install-key 7F0CEB10] (/var/chef/cache/cookbooks/apt/providers/repository.rb line 23) had an error: Chef::Exceptions::ShellCommandFailed: Expected process to exit with [
0], but received '2'
---- Begin output of apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 ----
STDOUT: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv 7F0CEB10
gpgkeys: HTTP fetch error 7: couldn't connect to host
STDERR: gpg: requesting key 7F0CEB10 from hkp server keyserver.ubuntu.com
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
---- End output of apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 ----
Ran apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 returned 2

我的源列表文件的内容:

deb http://eu.archive.ubuntu.com/ubuntu/ lucid main universe
deb-src http://eu.archive.ubuntu.com/ubuntu/ lucid main universe
deb http://eu.archive.ubuntu.com/ubuntu/ lucid-updates main universe
deb-src http://eu.archive.ubuntu.com/ubuntu/ lucid-updates main universe
deb http://security.ubuntu.com/ubuntu lucid-security main universe
deb-src http://security.ubuntu.com/ubuntu lucid-security main universe

可能是什么问题呢?我用谷歌搜索了它,但没有找到合适的解决方案。

4

1 回答 1

4

好的,我和我的朋友在进行了一些研发之后已经做到了。解决方案是改变食谱收据。我已将密钥服务器“keyserver.ubuntu.com”更改为“hkp://keyserver.ubuntu.com:80”。

干杯!!

于 2012-04-14T06:15:16.783 回答