Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error executing action converge on resource 'machine_batch[default]' #51

Closed
jjamfd opened this issue May 1, 2014 · 9 comments
Closed

Comments

@jjamfd
Copy link

jjamfd commented May 1, 2014

While attempting to try out chef-metal using the given example found in the chef-metal readme on github, I run into the following error:

Error executing action converge on resource 'machine_batch[default]'

NoMethodError

undefined method `node' for #ChefMetal::AddPrefixActionHandler:0x0000000273cfd8

Resource Declaration:

In /home/justin/.chef/local-mode-cache/cache/cookbooks/myapp/recipes/small.rb

5: machine 'mario' do
6: #recipe 'mydb'
7: tag 'mydb_master'
8: action [:delete, :create]
9: end
10:

I didn't modify the cookbooks/recipes at all and others in our office are running into the same problem when testing chef-metal.

ruby version: 2.1.1 (also tried 1.9.3)
chef version: 11.12.4
operating system: ubuntu 14.04 (tested on OSX mavericks as well)

@jkeiser
Copy link
Contributor

jkeiser commented May 1, 2014

Eek! Thanks for the report. Looks like some of the parallelism code in master must be causing it.

I recommend doing a gem install chef-metal instead of using the gem in the chef-metal bundle, and I'll get this fixed in master today!

@jjamfd
Copy link
Author

jjamfd commented May 2, 2014

just got the latest gems and its working beautifully, thanks so much for the tip!

@jjamfd
Copy link
Author

jjamfd commented May 2, 2014

looks like I spoke too soon, after it spun up the first node it errored out with a similar message:

Error executing action converge on resource 'machine_batch[default]'

NoMethodError

undefined method `perform_action' for Chef::Provider::Machine:Class

Resource Declaration:

In /home/justin/.chef/local-mode-cache/cache/cookbooks/myapp/recipes/small.rb

5: machine 'mario' do
6: #recipe 'mydb'
7: tag 'mydb_master'
8: action [:delete, :create]
9: end
10:

@jkeiser
Copy link
Contributor

jkeiser commented May 2, 2014

That's odd ... can you try:

gem uninstall -a chef-metal cheffish chef-metal-fog chef-metal-vagrant
gem install chef-metal

At this point, "master" of chef-metal should be fine too, if you want to follow the original instructions.

@jkeiser
Copy link
Contributor

jkeiser commented May 2, 2014

Hmm. I am not reproing. I think I understand the issue a little better, but not better enough. There should be a line in your output saying "wrote stacktrace to such and such a place". Can you send the contents of that stack trace? Thanks!!!

@jjamfd
Copy link
Author

jjamfd commented May 2, 2014

Sure, here is the full error output, along with the stack trace at the end.

Error executing action converge on resource 'machine_batch[default]'

NoMethodError

undefined method `perform_action' for Chef::Provider::Machine:Class

Resource Declaration:

In /home/justin/.chef/local-mode-cache/cache/cookbooks/myapp/recipes/small.rb

5: machine 'mario' do
6: #recipe 'mydb'
7: tag 'mydb_master'
8: action [:delete, :create]
9: end
10:

Compiled Resource:

Declared in /home/justin/.chef/local-mode-cache/cache/cookbooks/myapp/recipes/small.rb:5:in `from_file'

machine_batch("default") do
action :converge
retries 0
retry_delay 2
guard_interpreter :default
machines [<machine[mario] @name: "mario" @noop: nil @before: nil @params: {} @Provider: nil @allowed_actions: [:nothing, :create, :delete, :stop, :converge, :nothing, :create] @action: [:delete, :create] @Updated: false @updated_by_last_action: false @supports: {} @ignore_failure: false @retries: 0 @retry_delay: 2 @source_line: "/home/justin/.chef/local-mode-cache/cache/cookbooks/myapp/recipes/small.rb:5:in from_file'" @guard_interpreter: :default @elapsed_time: 0 @resource_name: :machine @chef_environment: nil @chef_server: {:chef_server_url=>"http://127.0.0.1:8889", :options=>{:client_name=>"jujubook", :signing_key_filename=>nil}} @provisioner: #<ChefMetalVagrant::VagrantProvisioner:0x00000004370b78 @cluster_path="/home/justin/machinetest", @unix_convergence_strategy=#<ChefMetal::ConvergenceStrategy::InstallCached:0x00000004c7da90 @client_rb_path="/etc/chef/client.rb", @client_pem_path="/etc/chef/client.pem", @chef_version=nil, @prerelease=nil, @package_cache_path="/home/justin/.chef/package_cache", @package_cache={}, @tmp_dir="/tmp", @chef_client_timeout=7200, @package_cache_lock=#<Mutex:0x00000004c7d018>>> @provisioner_options: {"vagrant_options"=>{"vm.box"=>"precise64", "vm.box_url"=>"http://files.vagrantup.com/precise64.box"}} @cookbook_name: "myapp" @recipe_name: "small" @attribute_modifiers: [["tags", #Proc:0x000000042da088@/usr/local/rvm/gems/ruby-1.9.3-p545/gems/cheffish-0.4/lib/cheffish.rb:48]] @files: nil @complete: nil @raw_json: nil @run_list: nil @attributes: nil @source_key: nil @source_key_path: nil @public_key_path: nil @public_key_format: nil @admin: nil @validator: nil @ohai_hints: nil>, <machine[mario] @name: "mario" @noop: nil @before: nil @params: {} @provider: nil @allowed_actions: [:nothing, :create, :delete, :stop, :converge, :nothing, :create] @action: [:stop] @updated: false @updated_by_last_action: false @supports: {} @ignore_failure: false @retries: 0 @retry_delay: 2 @source_line: "/home/justin/.chef/local-mode-cache/cache/cookbooks/myapp/recipes/small.rb:16:in from_file'" @guard_interpreter: :default @elapsed_time: 0 @resource_name: :machine @chef_environment: nil @chef_server: {:chef_server_url=>"http://127.0.0.1:8889", :options=>{:client_name=>"jujubook", :signing_key_filename=>nil}} @provisioner: #<ChefMetalVagrant::VagrantProvisioner:0x00000004370b78 @cluster_path="/home/justin/machinetest", @unix_convergence_strategy=#<ChefMetal::ConvergenceStrategy::InstallCached:0x00000004c7da90 @client_rb_path="/etc/chef/client.rb", @client_pem_path="/etc/chef/client.pem", @chef_version=nil, @prerelease=nil, @package_cache_path="/home/justin/.chef/package_cache", @package_cache={}, @tmp_dir="/tmp", @chef_client_timeout=7200, @package_cache_lock=#Mutex:0x00000004c7d018>> @provisioner_options: {"vagrant_options"=>{"vm.box"=>"precise64", "vm.box_url"=>"http://files.vagrantup.com/precise64.box"}} @cookbook_name: "myapp" @recipe_name: "small" @attribute_modifiers: [["tags", #Proc:0x000000042da088@/usr/local/rvm/gems/ruby-1.9.3-p545/gems/cheffish-0.4/lib/cheffish.rb:48]]>, <machine[luigi1] @name: "luigi1" @noop: nil @before: nil @params: {} @Provider: nil @allowed_actions: [:nothing, :create, :delete, :stop, :converge, :nothing, :create] @action: [:create, :stop] @Updated: false @updated_by_last_action: false @supports: {} @ignore_failure: false @retries: 0 @retry_delay: 2 @source_line: "/home/justin/.chef/local-mode-cache/cache/cookbooks/myapp/recipes/small.rb:23:in `block in from_file'" @guard_interpreter: :default @elapsed_time: 0 @resource_name: :machine @chef_environment: nil @chef_server: {:chef_server_url=>"http://127.0.0.1:8889", :options=>{:client_name=>"jujubook", :signing_key_filename=>nil}} @provisioner: #<ChefMetalVagrant::VagrantProvisioner:0x00000004370b78 @cluster_path="/home/justin/machinetest", @unix_convergence_strategy=#<ChefMetal::ConvergenceStrategy::InstallCached:0x00000004c7da90 @client_rb_path="/etc/chef/client.rb", @client_pem_path="/etc/chef/client.pem", @chef_version=nil, @prerelease=nil, @package_cache_path="/home/justin/.chef/package_cache", @package_cache={}, @tmp_dir="/tmp", @chef_client_timeout=7200, @package_cache_lock=#Mutex:0x00000004c7d018>> @provisioner_options: {"vagrant_options"=>{"vm.box"=>"precise64", "vm.box_url"=>"http://files.vagrantup.com/precise64.box"}} @cookbook_name: "myapp" @recipe_name: "small" @files: {"/etc/woo.txt"=>"/tmp/blah.txt", "/etc/woo2.txt"=>"/tmp/blah.txt", "/etc/woo3.txt"=>{:local_path=>"/tmp/blah.txt"}, "/etc/woo4.txt"=>{:content=>"WOOOOOOO"}} @complete: nil @raw_json: nil @run_list: nil @attributes: nil @source_key: nil @source_key_path: nil @public_key_path: nil @public_key_format: nil @admin: nil @validator: nil @ohai_hints: nil>]
chef_server {:chef_server_url=>"http://127.0.0.1:8889", :options=>{:client_name=>"jujubook", :signing_key_filename=>nil}}
cookbook_name "myapp"
recipe_name "small"
end

Running handlers:
[2014-05-02T12:57:58-04:00] ERROR: Running exception handlers
Running handlers complete

[2014-05-02T12:57:58-04:00] ERROR: Exception handlers complete
[2014-05-02T12:57:58-04:00] FATAL: Stacktrace dumped to /home/justin/.chef/local-mode-cache/cache/chef-stacktrace.out
Chef Client failed. 0 resources updated in 11.941354917 seconds
[2014-05-02T12:57:58-04:00] ERROR: machine_batch[default](myapp::small line 5) had an error: NoMethodError: undefined method `perform_action' for Chef::Provider::Machine:Class
[2014-05-02T12:57:58-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

STACK TRACE

Generated at 2014-05-02 12:57:58 -0400
NoMethodError: machine_batch[default](myapp::small line 5) had an error: NoMethodError: undefined method perform_action' for Chef::Provider::Machine:Class /home/justin/Testing/chef-metal/lib/chef_metal/machine/basic_machine.rb:66:inupload_file'
/home/justin/Testing/chef-metal/lib/chef/provider/machine.rb:81:in block in upload_files' /home/justin/Testing/chef-metal/lib/chef/provider/machine.rb:73:ineach_pair'
/home/justin/Testing/chef-metal/lib/chef/provider/machine.rb:73:in upload_files' /home/justin/Testing/chef-metal/lib/chef/provider/machine_batch.rb:37:inblock (2 levels) in class:MachineBatch'
/home/justin/Testing/chef-metal/lib/chef/provider/machine_batch.rb:76:in block (2 levels) in with_booted_machines' /home/justin/Testing/chef-metal/lib/chef_metal/provisioner.rb:84:inblock in acquire_machines'
/usr/local/rvm/gems/ruby-1.9.3-p545/gems/chef-11.12.4/lib/chef/chef_fs/parallelizer.rb:95:in call' /usr/local/rvm/gems/ruby-1.9.3-p545/gems/chef-11.12.4/lib/chef/chef_fs/parallelizer.rb:95:inprocess_input'
/usr/local/rvm/gems/ruby-1.9.3-p545/gems/chef-11.12.4/lib/chef/chef_fs/parallelizer.rb:112:in worker_loop' /usr/local/rvm/gems/ruby-1.9.3-p545/gems/chef-11.12.4/lib/chef/chef_fs/parallelizer.rb:24:inblock (2 levels) in initialize'

@jkeiser
Copy link
Contributor

jkeiser commented May 2, 2014

Aha! I've just pushed a fix for that, can you git pull and try it?

@jjamfd
Copy link
Author

jjamfd commented May 2, 2014

And it works! You're a scholar and a gentlemen, thanks a ton!

@jjamfd jjamfd closed this as completed May 2, 2014
@jkeiser
Copy link
Contributor

jkeiser commented May 2, 2014

Hooray! Thanks for the report, 0.10.1 is released with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants