2013-07-04 75 views
0

其實我特林使用Altoros CF-無業遊民,安裝過程中設置一個Cloudfoundry V2實例:Cloudfoundry安裝與流浪者:廚師獨奏ERROR

https://github.com/Altoros/cf-vagrant-installer

所有工作正常,我有安裝了berkshelf插件的vagrant 1.2.2,安裝在Ubuntu 12.10服務器上的virtualbox 4.1.18。

我一直在通過第一步,克隆git repo,通過vagrant up安裝盒子,ssh它,啓動結束ssh會話的postinstall腳本。

於是我再次流浪者,並得到這樣的:

ringing machine 'cf-install' up with 'virtualbox' provider... 
[cf-install] Setting the name of the VM... 
[cf-install] Clearing any previously set forwarded ports... 
[Berkshelf] This version of the Berkshelf plugin has not been fully tested on this  
version of Vagrant. 
[Berkshelf] You should check for a newer version of vagrant-berkshelf. 
[Berkshelf] If you encounter any errors with this version, please report them at  
https://github.com/RiotGames/vagrant-berkshelf/issues 
[Berkshelf] You can also join the discussion in #berkshelf on Freenode. 
[Berkshelf] Updating Vagrant's berkshelf: '/home/oadmin/.berkshelf/cf- 
install/vagrant/berkshelf-20130703-21144-1ni4f5h-cf-install' 
[Berkshelf] Using apt (1.10.0) 
[Berkshelf] Using git (2.5.2) 
[Berkshelf] Using sqlite (1.0.0) 
[Berkshelf] Using mysql (3.0.2) 
[Berkshelf] Using postgresql (3.0.2) 
[Berkshelf] Using chef-golang (1.0.1) 
[Berkshelf] Using java (1.11.6) 
[Berkshelf] Using ruby_build (0.8.0) 
[Berkshelf] Installing rbenv (0.7.3) from git: 'git://github.com/fnichol/chef-rbenv.git' 
with branch: 'master' at ref: 'e10f98d5fd07bdb8d212ebf42160b65c39036b90' 
[Berkshelf] Using rbenv-alias (0.0.0) at './chef/rbenv-alias' 
[Berkshelf] Using rbenv-sudo (0.0.1) at './chef/rbenv-sudo' 
[Berkshelf] Using cloudfoundry (0.0.0) at './chef/cloudfoundry' 
[Berkshelf] Using dmg (1.1.0) 
[Berkshelf] Using build-essential (1.4.0) 
[Berkshelf] Using yum (2.3.0) 
[Berkshelf] Using windows (1.10.0) 
[Berkshelf] Using chef_handler (1.1.4) 
[Berkshelf] Using runit (1.1.6) 
[Berkshelf] Using openssl (1.0.2) 
[cf-install] Creating shared folders metadata... 
[cf-install] Clearing any previously set network interfaces... 
[cf-install] Preparing network interfaces based on configuration... 
[cf-install] Forwarding ports... 
[cf-install] -- 22 => 2222 (adapter 1) 
[cf-install] -- 80 => 8080 (adapter 1) 
[cf-install] Running any VM customizations... 
[cf-install] Booting VM... 
[cf-install] Waiting for VM to boot. This can take a few minutes. 
[cf-install] VM booted and ready for use! 
[cf-install] The guest additions on this VM do not match the installed version of 
VirtualBox! In most cases this is fine, but in rare cases it can 
cause things such as shared folders to not work properly. If you see 
shared folder errors, please update the guest additions within the 
virtual machine and reload your VM. 

Guest Additions Version: 4.2.0 
VirtualBox Version: 4.1 
[cf-install] Configuring and enabling network interfaces... 
[cf-install] Mounting shared folders... 
[cf-install] -- /vagrant 
[cf-install] -- /tmp/vagrant-chef-1/chef-solo-1/cookbooks 
[cf-install] Running provisioner: chef_solo... 
Generating chef JSON and uploading.. 

,最終這樣的:

Running chef-solo... 
stdin: is not a tty 
[2013-07-03T15:10:41+00:00] INFO: *** Chef 11.4.4 *** 
[2013-07-03T15:10:43+00:00] INFO: Setting the run_list to ["recipe[apt::default]",  
"recipe[git]", "recipe[chef-golang]", "recipe[ruby_build]", "recipe[rbenv::user]", 
"recipe[java::openjdk]", "recipe[sqlite]",  
"recipe[mysql::server]","recipe[postgresql::server]", "recipe[rbenv-alias]", 
"recipe[rbenv-sudo]", "recipe[cloudfoundry::warden]", "recipe[cloudfoundry::dea]", 
"recipe[cloudfoundry::uaa]", "recipe[cloudfoundry::cf_bootstrap]"] from JSON 
[2013-07-03T15:10:43+00:00] INFO: Run List is [recipe[apt::default], recipe[git], 
recipe[chef-golang], recipe[ruby_build], recipe[rbenv::user], recipe[java::openjdk], 
recipe[sqlite], recipe[mysql::server], recipe[postgresql::server], recipe[rbenv-alias], 
recipe[rbenv-sudo], recipe[cloudfoundry::warden], recipe[cloudfoundry::dea],  
recipe[cloudfoundry::uaa], recipe[cloudfoundry::cf_bootstrap]] 
[2013-07-03T15:10:43+00:00] INFO: Run List expands to [apt::default, git, chef-golang,  
ruby_build, rbenv::user, java::openjdk, sqlite, mysql::server, postgresql::server, 
rbenv-alias, rbenv-sudo, cloudfoundry::warden, cloudfoundry::dea, cloudfoundry::uaa, 
cloudfoundry::cf_bootstrap] 
[2013-07-03T15:10:43+00:00] INFO: Starting Chef Run for precise64 
[2013-07-03T15:10:43+00:00] INFO: Running start handlers 
[2013-07-03T15:10:43+00:00] INFO: Start handlers complete. 

================================================================================ 
Recipe Compile Error in /tmp/vagrant-chef-1/chef-solo- 
1/cookbooks/apt/resources/preference.rb 

================================================================================ 

ArgumentError 
------------- 
wrong number of arguments (2 for 1) 

Cookbook Trace: 
--------------- 
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef- 
11.4.4/bin/../lib/chef/resource/lwrp_base.rb:42:in `const_defined?' 
    /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef- 
11.4.4/bin/../lib/chef/resource/lwrp_base.rb:42:in `build_from_file' 
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef- 
11.4.4/bin/../lib/chef/run_context/cookbook_compiler.rb:208:in `load_lwrp_resource' 
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef- 
11.4.4/bin/../lib/chef/run_context/cookbook_compiler.rb:193:in 
`load_lwrps_from_cookbook' 
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef- 
11.4.4/bin/../lib/chef/run_context/cookbook_compiler.rb:192:in `each' 
    /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef- 
11.4.4/bin/../lib/chef/run_context/cookbook_compiler.rb:192:in 
`load_lwrps_from_cookbook' 
    /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef- 
11.4.4/bin/../lib/chef/run_context/cookbook_compiler.rb:120:in `compile_lwrps' 
    /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef- 
11.4.4/bin/../lib/chef/run_context/cookbook_compiler.rb:119:in `each' 
    /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef- 
11.4.4/bin/../lib/chef/run_context/cookbook_compiler.rb:119:in `compile_lwrps' 
    /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef- 
11.4.4/bin/../lib/chef/run_context/cookbook_compiler.rb:72:in `compile' 
    /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef- 
11.4.4/bin/../lib/chef/run_context.rb:86:in `load' 
    /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-11.4.4/bin/../lib/chef/client.rb:224:in 
`setup_run_context' 
    /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-11.4.4/bin/../lib/chef/client.rb:467:in 
`do_run' 
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-11.4.4/bin/../lib/chef/client.rb:200:in 
`run' 
    /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef- 
11.4.4/bin/../lib/chef/application.rb:190:in `run_chef_client' 

/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef- 
11.4.4/bin/../lib/chef/application/solo.rb:239:in `run_application' 
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef- 
11.4.4/bin/../lib/chef/application/solo.rb:231:in `loop' 
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef- 
11.4.4/bin/../lib/chef/application/solo.rb:231:in `run_application' 

/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef- 
11.4.4/bin/../lib/chef/application.rb:73:in `run' 
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-11.4.4/bin/chef-solo:25 
/opt/vagrant_ruby/bin/chef-solo:19:in `load' 
/opt/vagrant_ruby/bin/chef-solo:19 


Relevant File Content: 
---------------------- 
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef- 
11.4.4/bin/../lib/chef/resource/lwrp_base.rb: 

35: 
36:  # Evaluates the LWRP resource file and instantiates a new Resource class. 
37:  def self.build_from_file(cookbook_name, filename, run_context) 
38:   rname = filename_to_qualified_string(cookbook_name, filename) 
39: 
40:   # Add log entry if we override an existing light-weight resource. 
41:   class_name = convert_to_class_name(rname) 
42>>   if Resource.const_defined?(class_name, false) 
43:   old_class = Resource.send(:remove_const, class_name) 
44:   # CHEF-3432 -- Chef::Resource keeps a list of subclasses; need to 
45:   # remove old ones from the list when replacing. 
46:   resource_classes.delete(old_class) 
47:   Chef::Log.info("#{class_name} light-weight resource already initialized  
-- overriding!") 
48:   end 
49: 
50:   resource_class = Class.new(self) 
51: 

[2013-07-03T15:10:44+00:00] ERROR: Running exception handlers 
[2013-07-03T15:10:44+00:00] ERROR: Exception handlers complete 
[2013-07-03T15:10:44+00:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef - 
stacktrace.out 
[2013-07-03T15:10:44+00:00] FATAL: ArgumentError: wrong number of arguments (2 for 1) 
Chef never successfully completed! Any errors should be visible in the 
output above. Please fix your recipes so that they properly complete. 

任何幫助/想法會感激

回答

2

這是廚師的錯誤使用Ruby 1.8的10.24.4和11.4.4:CHEF-4123。修復承諾但尚未發佈。

您需要降級Chef版本,等待新版本或升級Ruby。推薦安裝Chef的方法是使用嵌入了Ruby的「omnibus installer」。對於流浪有一個很好的vagrant-omnibus插件。

0

你是否更新了cf-vagrant-installer的副本?我相當肯定這個廚師的bug在幾個星期前在那裏工作。

0

所有現在好(在這個問題上..)與cf-vagrant-installer的最新代碼。

感謝大家!

0

我想補充一些tmatilai的答案。 我解決了同一個問題一次。升級紅寶石後,似乎只有升級紅寶石1.9.3和升級廚師到11.4.4。

因此,在配置廚師獨奏之前,我添加了以下行。

config.vm.provision :shell, :path => "somescript.sh" 

然後我在廚師的廚房,其中載

apt-get update 
apt-get -y install ruby1.9.3 build-essential 
gem install chef --version 11.4.4 --no-rdoc --no-ri --conservative 

一切追着細加平行於菜譜目錄somescript.sh文件。