I think the VM download is broken
I'm pretty sure this isn't just me: Chef doesn't complete properly when I run vagrant up. It worked fine when I first went through this lesson a couple of months ago, but now I'm unable to install the necessary resources. Here's the output: $ vagrant up Bringing machine 'default' up with 'virtualbox' provider... [default] Importing base box 'precise64'... [default] Matching MAC address for NAT networking... [default] Setting the name of the VM... [default] Clearing any previously set forwarded ports... [default] Creating shared folders metadata... [default] Clearing any previously set network interfaces... [default] Preparing network interfaces based on configuration... [default] Forwarding ports... [default] -- 22 => 2222 (adapter 1) [default] -- 8000 => 8888 (adapter 1) [default] Booting VM... [default] Waiting for VM to boot. This can take a few minutes. [default] VM booted and ready for use! [default] Configuring and enabling network interfaces... [default] Mounting shared folders... [default] -- /vagrant [default] -- /tmp/vagrant-chef-1/chef-solo-1/cookbooks [default] -- /tmp/vagrant-chef-1/chef-solo-2/cookbooks [default] Running provisioner: shell... [default] Running: inline script stdin: is not a tty Successfully installed mixlib-cli-1.3.0 Successfully installed net-ssh-2.6.7 Successfully installed chef-11.4.4 3 gems installed [default] Running provisioner: chef_solo... Generating chef JSON and uploading... Running chef-solo... stdin: is not a tty [2013-06-29T20:30:46+00:00] INFO: *** Chef 11.4.4 *** [2013-06-29T20:30:47+00:00] INFO: Setting the run_list to ["recipe[postgresql::server_debian]", "recipe[postgresql::ruby]", "recipe[redis::server]", "recipe[git]", "recipe[mercurial]", "recipe[emacs]", "recipe[vim]", "recipe[nano]", "recipe[gswd::database]"] from JSON [2013-06-29T20:30:47+00:00] INFO: Run List is [recipe[postgresql::server_debian], recipe[postgresql::ruby], recipe[redis::server], recipe[git], recipe[mercurial], recipe[emacs], recipe[vim], recipe[nano], recipe[gswd::database]] [2013-06-29T20:30:47+00:00] INFO: Run List expands to [postgresql::server_debian, postgresql::ruby, redis::server, git, mercurial, emacs, vim, nano, gswd::database] [2013-06-29T20:30:47+00:00] INFO: Starting Chef Run for precise64 [2013-06-29T20:30:47+00:00] INFO: Running start handlers [2013-06-29T20:30:47+00:00] INFO: Start handlers complete. [2013-06-29T20:30:47+00:00] WARN: Missing gem 'right_aws'
Recipe Compile Error in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/yum/resources/key.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:inbuild_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:inload_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:inload_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:ineach'
/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:incompile'
/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:insetup_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:inrun'
/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:inrun_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:inrun_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:inload'
/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-06-29T20:30:47+00:00] ERROR: Running exception handlers [2013-06-29T20:30:47+00:00] ERROR: Exception handlers complete [2013-06-29T20:30:47+00:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out [2013-06-29T20:30:47+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.
Answers
Yeah, it's because the Vagrantfile is trying to update Chef. Change line 41 (for me, at least. It's the first line that starts with config.vm.provision) to config.vm.provision :shell, :inline => "gem install --no-ri --no-rdoc chef --version '10.14.2'" which will force the VM to install Chef 10.14.2, a known good version for this version of Ruby, etc.
Oops, sorry something went wrong with the copy/paste. Looks better here: http://pastebin.com/BPYpRzp4