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

Unable to set convergence_options with AWS driver #78

Closed
Afterglow opened this issue Dec 9, 2014 · 2 comments
Closed

Unable to set convergence_options with AWS driver #78

Afterglow opened this issue Dec 9, 2014 · 2 comments
Assignees
Milestone

Comments

@Afterglow
Copy link
Contributor

I am attempting to set the chef_version in the convergence options and while it works with my vagrant driver it does not work with the AWS driver. I am unable initially to see what the problem is beyond that machine_options[:convergence_options] is a hash if I don't specify any options of my own and a MergedConfig if I do. This appears to cause a failure in the aws driver when it attempts to set the ohai_hints.

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

NoMethodError
-------------
Unexpected method []= for MergedConfig with arguments [:ohai_hints, {"ec2"=>""}]

Resource Declaration:
---------------------
# In /Users/paul/work/it/monitoring_single_node/recipes/monitoring_single_node.rb

  3: machine_batch do
  4:   machine 'monitoring-node' do
  5:     run_list [
  6:       'apt',
  7:       'dyn_monitoring::single_node',
  8:       'dyn_sensu::_graphite_handler'
  9:     ]
 10:     add_machine_options :vagrant_options => {
 11:       'vm.hostname' => 'monitoring-node'
 12:     }, :convergence_options => {
 13:       'chef_version' => '11.12.8'
 14:     }, :vagrant_config => <<-EOM
 15:     config.vm.network :private_network, type: 'dhcp'
 16:     EOM
 17:   end
 18: end

Compiled Resource:
------------------
# Declared in /Users/paul/work/it/monitoring_single_node/recipes/monitoring_single_node.rb:3:in `from_file'

machine_batch("default") do
  action :converge
  retries 0
  retry_delay 2
  guard_interpreter :default
  driver "fog:AWS"
  chef_server {:chef_server_url=>"http://localhost:8889", :options=>{:client_name=>"PaulsMBP-2.local", :signing_key_filename=>nil}}
  machine_options {:bootstrap_options=>{:image_id=>"ami-864d84ee", :flavor_id=>"m3.medium", :security_group_ids=>["sg-1615ff72"], :key_name=>"paul-monitoring_single_node", :subnet_id=>"subnet-599f4936"}}
  cookbook_name "@recipe_files"
  recipe_name "/Users/paul/work/it/monitoring_single_node/recipes/monitoring_single_node.rb"
  machines ["monitoring-node"]
end

[2014-12-09T00:38:28+00:00] INFO: Running queued delayed notifications before re-raising exception
[2014-12-09T00:38:28+00:00] DEBUG: Re-raising exception: NoMethodError - machine_batch[default (@recipe_files::/Users/paul/work/it/monitoring_single_node/recipes/monitoring_single_node.rb line 3) had an error: NoMethodError: Unexpected method []= for MergedConfig with arguments [:ohai_hints, {"ec2"=>""}]
  /Users/paul/.rvm/gems/ruby-2.1.1@msn/gems/cheffish-0.9/lib/cheffish/merged_config.rb:50:in `method_missing'
  /Users/paul/.rvm/gems/ruby-2.1.1@msn/gems/chef-provisioning-fog-0.11/lib/chef/provisioning/fog_driver/providers/aws.rb:173:in `convergence_strategy_for'
  /Users/paul/.rvm/gems/ruby-2.1.1@msn/gems/chef-provisioning-fog-0.11/lib/chef/provisioning/fog_driver/driver.rb:553:in `machine_for'
  /Users/paul/.rvm/gems/ruby-2.1.1@msn/gems/chef-provisioning-fog-0.11/lib/chef/provisioning/fog_driver/driver.rb:225:in `ready_machine'
  /Users/paul/.rvm/gems/ruby-2.1.1@msn/gems/chef-provisioning-0.16/lib/chef/provisioning/driver.rb:247:in `block in ready_machines'
  /Users/paul/.rvm/gems/ruby-2.1.1@msn/gems/chef-11.16.4/lib/chef/chef_fs/parallelizer/parallel_enumerable.rb:267:in `call'
  /Users/paul/.rvm/gems/ruby-2.1.1@msn/gems/chef-11.16.4/lib/chef/chef_fs/parallelizer/parallel_enumerable.rb:267:in `process_input'
  /Users/paul/.rvm/gems/ruby-2.1.1@msn/gems/chef-11.16.4/lib/chef/chef_fs/parallelizer/parallel_enumerable.rb:257:in `process_one'
  /Users/paul/.rvm/gems/ruby-2.1.1@msn/gems/chef-11.16.4/lib/chef/chef_fs/parallelizer.rb:93:in `call'
  /Users/paul/.rvm/gems/ruby-2.1.1@msn/gems/chef-11.16.4/lib/chef/chef_fs/parallelizer.rb:93:in `worker_loop'

Running handlers:
[2014-12-09T00:38:28+00:00] ERROR: Running exception handlers
Running handlers complete
[2014-12-09T00:38:28+00:00] ERROR: Exception handlers complete
[2014-12-09T00:38:28+00:00] FATAL: Stacktrace dumped to /Users/paul/.chef/local-mode-cache/cache/chef-stacktrace.out
[2014-12-09T00:38:28+00:00] DEBUG: NoMethodError: machine_batch[default] (@recipe_files::/Users/paul/work/it/monitoring_single_node/recipes/monitoring_single_node.rb line 3) had an error: NoMethodError: Unexpected method []= for MergedConfig with arguments [:ohai_hints, {"ec2"=>""}]
/Users/paul/.rvm/gems/ruby-2.1.1@msn/gems/cheffish-0.9/lib/cheffish/merged_config.rb:50:in `method_missing'
/Users/paul/.rvm/gems/ruby-2.1.1@msn/gems/chef-provisioning-fog-0.11/lib/chef/provisioning/fog_driver/providers/aws.rb:173:in `convergence_strategy_for'
/Users/paul/.rvm/gems/ruby-2.1.1@msn/gems/chef-provisioning-fog-0.11/lib/chef/provisioning/fog_driver/driver.rb:553:in `machine_for'
/Users/paul/.rvm/gems/ruby-2.1.1@msn/gems/chef-provisioning-fog-0.11/lib/chef/provisioning/fog_driver/driver.rb:225:in `ready_machine'
/Users/paul/.rvm/gems/ruby-2.1.1@msn/gems/chef-provisioning-0.16/lib/chef/provisioning/driver.rb:247:in `block in ready_machines'
/Users/paul/.rvm/gems/ruby-2.1.1@msn/gems/chef-11.16.4/lib/chef/chef_fs/parallelizer/parallel_enumerable.rb:267:in `call'
/Users/paul/.rvm/gems/ruby-2.1.1@msn/gems/chef-11.16.4/lib/chef/chef_fs/parallelizer/parallel_enumerable.rb:267:in `process_input'
/Users/paul/.rvm/gems/ruby-2.1.1@msn/gems/chef-11.16.4/lib/chef/chef_fs/parallelizer/parallel_enumerable.rb:257:in `process_one'
/Users/paul/.rvm/gems/ruby-2.1.1@msn/gems/chef-11.16.4/lib/chef/chef_fs/parallelizer.rb:93:in `call'
/Users/paul/.rvm/gems/ruby-2.1.1@msn/gems/chef-11.16.4/lib/chef/chef_fs/parallelizer.rb:93:in `worker_loop'
Chef Client failed. 0 resources updated in 10.389258 seconds
[2014-12-09T00:38:28+00:00] DEBUG: Server doesn't support resource history, skipping resource report.
[2014-12-09T00:38:28+00:00] ERROR: machine_batch[default] (@recipe_files::/Users/paul/work/it/monitoring_single_node/recipes/monitoring_single_node.rb line 3) had an error: NoMethodError: Unexpected method []= for MergedConfig with arguments [:ohai_hints, {"ec2"=>""}]
[2014-12-09T00:38:29+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
rake aborted!
Command failed with status (1): [chef-client -z recipes/ec2_images.rb recip...]
/Users/paul/work/it/monitoring_single_node/Rakefile:68:in `block in <top (required)>'
/Users/paul/.rvm/gems/ruby-2.1.1@msn/bin/ruby_executable_hooks:15:in `eval'
/Users/paul/.rvm/gems/ruby-2.1.1@msn/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => deploy:aws
(See full trace by running task with --trace)
@notnmeyer
Copy link

Not sure if it's related, but the OpenStack driver ignores convergence_options as well

@jkeiser
Copy link
Contributor

jkeiser commented Feb 24, 2015

@Afterglow it looks like the fix for this was merged ... I am going to close, but if it's not fixing it for you, feel free to reopen!

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

Successfully merging a pull request may close this issue.

4 participants