簡體   English   中英

帶Chef-solo的precision64流浪者盒配置失敗

[英]precise64 vagrant box provisioning with Chef-solo fail

安裝在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.

歡迎任何提示

根據輸出,錯誤很明顯。 APT無法從美國鏡像中獲取Vim軟件包。

要解決此問題,請在VM中運行apt-get update ,然后重試,如果問題仍然存在,請嘗試通過編輯/etc/apt/sources.list將其切換到其他Ubuntu更新鏡像。 例如,切換到主電源(沒有us.前綴)

盡量不要在vim食譜中指定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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM