使用Chef-solo失败的exact64流浪盒配置

时间:2014-05-07 13:07:10

标签: vagrant chef-solo berkshelf

安装在Mac OS X 1.9.2 Maverick

初始化的流浪盒

vagrant init .

Berksfile

source "https://api.berkshelf.com"

cookbook "vim"
cookbook "git"
cookbook "npm"
cookbook "nvm"
cookbook "nodejs"

获取食谱

$ berks vendor

Vagrantfile

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "hashicorp/precise64"

  config.vm.network :forwarded_port, guest: 8080, host: 8081

  config.omnibus.chef_version = :latest

  config.vm.provision :chef_solo do |chef|
    chef.cookbooks_path = "berks-cookbooks"
    chef.add_recipe "vim"
    chef.add_recipe "git"
    chef.add_recipe "npm"
    chef.add_recipe "nvm"
    chef.add_recipe "nodejs"

  end

end

启动框

$ vagrant up

当我从chef / ubuntu-13.04更改为hashicorp / precise64

时出现这些错误

错误

[2014-05-07T13:03:23+00:00] INFO: *** Chef 11.12.4 ***
[2014-05-07T13:03:23+00:00] INFO: Chef-client pid: 1704
[2014-05-07T13:03:30+00:00] INFO: Setting the run_list to ["recipe[vim]", "recipe[git]", "recipe[npm]", "recipe[nvm]", "recipe[nodejs]"] from CLI options
[2014-05-07T13:03:30+00:00] INFO: Run List is [recipe[vim], recipe[git], recipe[npm], recipe[nvm], recipe[nodejs]]
[2014-05-07T13:03:30+00:00] INFO: Run List expands to [vim, git, npm, nvm, nodejs]
[2014-05-07T13:03:30+00:00] INFO: Starting Chef Run for precise64
[2014-05-07T13:03:30+00:00] INFO: Running start handlers
[2014-05-07T13:03:30+00:00] INFO: Start handlers complete.
[2014-05-07T13:03:31+00:00] INFO: WindowsPackage light-weight resource already initialized -- overriding!
[2014-05-07T13:03:31+00:00] WARN: Cloning resource attributes for package[curl] from prior resource (CHEF-3694)
[2014-05-07T13:03:31+00:00] WARN: Previous package[curl]: /tmp/vagrant-chef-1/chef-solo-1/cookbooks/npm/recipes/default.rb:26:in `from_file'
[2014-05-07T13:03:31+00:00] WARN: Current  package[curl]: /tmp/vagrant-chef-1/chef-solo-1/cookbooks/nvm/recipes/default.rb:29:in `from_file'
[2014-05-07T13:03:31+00:00] WARN: Cloning resource attributes for package[build-essential] from prior resource (CHEF-3694)
[2014-05-07T13:03:31+00:00] WARN: Previous package[build-essential]: /tmp/vagrant-chef-1/chef-solo-1/cookbooks/build-essential/recipes/_debian.rb:24:in `block in from_file'
[2014-05-07T13:03:31+00:00] WARN: Current  package[build-essential]: /tmp/vagrant-chef-1/chef-solo-1/cookbooks/nvm/recipes/default.rb:34:in `from_file'
[2014-05-07T13:03:31+00:00] WARN: Cloning resource attributes for package[libssl-dev] from prior resource (CHEF-3694)
[2014-05-07T13:03:31+00:00] WARN: Previous package[libssl-dev]: /tmp/vagrant-chef-1/chef-solo-1/cookbooks/nodejs/recipes/install_from_source.rb:27:in `from_file'
[2014-05-07T13:03:31+00:00] WARN: Current  package[libssl-dev]: /tmp/vagrant-chef-1/chef-solo-1/cookbooks/nvm/recipes/default.rb:37:in `from_file'

================================================================================
Error executing action `install` on resource 'package[vim]'
================================================================================


Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '100'
---- Begin output of apt-get -q -y install vim=2:7.3.429-2ubuntu2.1 ----
STDOUT: Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  libgpm2 libpython2.7 python2.7 python2.7-minimal vim-common vim-runtime
  vim-tiny
Suggested packages:
  gpm python2.7-doc binfmt-support ctags vim-doc vim-scripts indent
The following NEW packages will be installed:
  libgpm2 libpython2.7 vim vim-runtime
The following packages will be upgraded:
  python2.7 python2.7-minimal vim-common vim-tiny
4 upgraded, 4 newly installed, 0 to remove and 62 not upgraded.
Need to get 5,603 kB/13.4 MB of archives.
After this operation, 28.1 MB of additional disk space will be used.
Err http://us.archive.ubuntu.com/ubuntu/ precise-updates/main python2.7 amd64 2.7.3-0ubuntu3.1
  404  Not Found
Err http://us.archive.ubuntu.com/ubuntu/ precise-updates/main python2.7-minimal amd64 2.7.3-0ubuntu3.1
  404  Not Found
Err http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libpython2.7 amd64 2.7.3-0ubuntu3.1
  404  Not Found
STDERR: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/python2.7/python2.7_2.7.3-0ubuntu3.1_amd64.deb  404  Not Found
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/python2.7/python2.7-minimal_2.7.3-0ubuntu3.1_amd64.deb  404  Not Found
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/python2.7/libpython2.7_2.7.3-0ubuntu3.1_amd64.deb  404  Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
---- End output of apt-get -q -y install vim=2:7.3.429-2ubuntu2.1 ----
Ran apt-get -q -y install vim=2:7.3.429-2ubuntu2.1 returned 100


Resource Declaration:
---------------------
# In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/vim/recipes/package.rb

 30:   package vim_base_pkg
 31: end



Compiled Resource:
------------------
# Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/vim/recipes/package.rb:30:in `block in from_file'

package("vim") do
  action :install
  retries 0
  retry_delay 2
  guard_interpreter :default
  package_name "vim"
  version "2:7.3.429-2ubuntu2.1"
  cookbook_name :vim
  recipe_name "package"
end



[2014-05-07T13:03:32+00:00] INFO: Running queued delayed notifications before re-raising exception
[2014-05-07T13:03:32+00:00] ERROR: Running exception handlers
[2014-05-07T13:03:32+00:00] ERROR: Exception handlers complete
[2014-05-07T13:03:32+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2014-05-07T13:03:32+00:00] ERROR: package[vim] (vim::package line 30) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '100'
---- Begin output of apt-get -q -y install vim=2:7.3.429-2ubuntu2.1 ----
STDOUT: Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  libgpm2 libpython2.7 python2.7 python2.7-minimal vim-common vim-runtime
  vim-tiny
Suggested packages:
  gpm python2.7-doc binfmt-support ctags vim-doc vim-scripts indent
The following NEW packages will be installed:
  libgpm2 libpython2.7 vim vim-runtime
The following packages will be upgraded:
  python2.7 python2.7-minimal vim-common vim-tiny
4 upgraded, 4 newly installed, 0 to remove and 62 not upgraded.
Need to get 5,603 kB/13.4 MB of archives.
After this operation, 28.1 MB of additional disk space will be used.
Err http://us.archive.ubuntu.com/ubuntu/ precise-updates/main python2.7 amd64 2.7.3-0ubuntu3.1
  404  Not Found
Err http://us.archive.ubuntu.com/ubuntu/ precise-updates/main python2.7-minimal amd64 2.7.3-0ubuntu3.1
  404  Not Found
Err http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libpython2.7 amd64 2.7.3-0ubuntu3.1
  404  Not Found
STDERR: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/python2.7/python2.7_2.7.3-0ubuntu3.1_amd64.deb  404  Not Found
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/python2.7/python2.7-minimal_2.7.3-0ubuntu3.1_amd64.deb  404  Not Found
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/p/python2.7/libpython2.7_2.7.3-0ubuntu3.1_amd64.deb  404  Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
---- End output of apt-get -q -y install vim=2:7.3.429-2ubuntu2.1 ----
Ran apt-get -q -y install vim=2:7.3.429-2ubuntu2.1 returned 100
[2014-05-07T13:03:32+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.

欢迎任何提示

1 个答案:

答案 0 :(得分:4)

根据输出,错误很明显。 APT无法从美国镜子中获得Vim包装。

要解决此问题,请在VM中运行apt-get update并重试,如果问题仍然存在,请尝试通过编辑/etc/apt/sources.list将其切换到其他Ubuntu更新镜像。例如切换到主(没有us.前缀)

尽量不要在vim cookbook中指定vim版本,至少对于Debian / Ubuntu来说通常不是一个好主意。

package("vim") do
  action :install
  retries 0
  retry_delay 2
  guard_interpreter :default
  package_name "vim"
  cookbook_name :vim
  recipe_name "package"
end