Reputation: 21
I am actually tring to set up a Cloudfoundry V2 instance by using the Altoros cf-vagrant-installer process:
https://github.com/Altoros/cf-vagrant-installer
All was working fine, I have got a vagrant 1.2.2 with berkshelf plugin installed, virtualbox 4.1.18 installed on a ubuntu 12.10 server.
I have been trough the first steps, which are cloning the git repo, installing the box via vagrant up, ssh it, launch the postinstall script that ends the ssh session.
So I vagrant up again and get this :
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..
And end up like that :
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.
Any help/idea would be appreciate
Upvotes: 0
Views: 1139
Reputation: 26
I'd like to add something in tmatilai's answer. I tackled the same issue once. Only option seemed to be upgrading ruby to 1.9.3 and upgrading chef to 11.4.4 after upgrading ruby.
So I added following line before provisioning chef-solo.
config.vm.provision :shell, :path => "somescript.sh"
then I added a somescript.sh file parallel to cookbooks directory in the chef kitchen, which contained
apt-get update
apt-get -y install ruby1.9.3 build-essential
gem install chef --version 11.4.4 --no-rdoc --no-ri --conservative
everything ran fine after that.
Upvotes: 0
Reputation: 21
All good now (well on this problem ..) with the latest code of cf-vagrant-installer.
thanks to all of you !!
Upvotes: 0
Reputation:
Did you update your copy of the cf-vagrant-installer? I'm fairly sure this Chef bug was worked around there a couple of weeks ago.
Upvotes: 0
Reputation: 4176
That is a bug in Chef 10.24.4 and 11.4.4 with Ruby 1.8: CHEF-4123. Fix is committed but not released yet.
You need to downgrade the Chef version, wait for the new releases or upgrade Ruby. The recommended way to install Chef is using the "omnibus installer" that has an embedded Ruby. For Vagrant there is an excellent vagrant-omnibus plugin.
Upvotes: 2