Created
April 5, 2012 01:38
-
-
Save jordandm/2307245 to your computer and use it in GitHub Desktop.
Tagging Error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ********** Stack trace: | |
| [Thu, 05 Apr 2012 01:32:51 +0000] INFO: Processing log[instance_tag - i-019b6c66 has ec2 attribute] action write (worker::instance_tag line 36) | |
| [Thu, 05 Apr 2012 01:32:51 +0000] INFO: instance_tag - i-019b6c66 has ec2 attribute | |
| [Thu, 05 Apr 2012 01:32:51 +0000] INFO: Processing log[instance_tag - i-019b6c66 has ec2 instance_id i-019b6c66] action write (worker::instance_tag line 42) | |
| [Thu, 05 Apr 2012 01:32:51 +0000] INFO: instance_tag - i-019b6c66 has ec2 instance_id i-019b6c66 | |
| [Thu, 05 Apr 2012 01:32:51 +0000] INFO: Processing AmazonEC2Tag_ec2tag[index] action create (worker::instance_tag line 47) | |
| [Thu, 05 Apr 2012 01:32:51 +0000] ERROR: Running exception handlers | |
| [Thu, 05 Apr 2012 01:32:52 +0000] FATAL: Saving node information to /var/chef/cache/failed-run-data.json | |
| [Thu, 05 Apr 2012 01:32:52 +0000] ERROR: Exception handlers complete | |
| [Thu, 05 Apr 2012 01:32:52 +0000] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out | |
| [Thu, 05 Apr 2012 01:32:52 +0000] FATAL: LoadError: cannot load such file -- bigdecimal | |
| Generated at 2012-04-05 01:32:52 +0000 | |
| LoadError: cannot load such file -- bigdecimal | |
| /usr/local/share/gems/gems/aws-sdk-1.3.9/lib/aws/core/service_interface.rb:24:in `module_eval' | |
| /usr/local/share/ruby19/site_ruby/rubygems/custom_require.rb:36:in `require' | |
| /usr/local/share/gems/gems/aws-sdk-1.3.9/lib/aws/core/option_grammar.rb:15:in `<top (required)>' | |
| /usr/local/share/gems/gems/aws-sdk-1.3.9/lib/aws/core/configured_option_grammars.rb:28:in `base_grammar' | |
| /usr/local/share/gems/gems/aws-sdk-1.3.9/lib/aws/core/configured_grammars.rb:51:in `block in define_configured_grammars' | |
| /usr/local/share/gems/gems/aws-sdk-1.3.9/lib/aws/core/configured_grammars.rb:47:in `each' | |
| /usr/local/share/gems/gems/aws-sdk-1.3.9/lib/aws/core/configured_grammars.rb:47:in `define_configured_grammars' | |
| /usr/local/share/gems/gems/aws-sdk-1.3.9/lib/aws/core/configured_client_methods.rb:39:in `block in configure_client' | |
| /usr/local/share/gems/gems/aws-sdk-1.3.9/lib/aws/core/configured_client_methods.rb:37:in `module_eval' | |
| /usr/local/share/gems/gems/aws-sdk-1.3.9/lib/aws/core/configured_client_methods.rb:37:in `configure_client' | |
| /usr/local/share/gems/gems/aws-sdk-1.3.9/lib/aws/ec2/client.rb:68:in `<class:Client>' | |
| /usr/local/share/gems/gems/aws-sdk-1.3.9/lib/aws/ec2/client.rb:18:in `<class:EC2>' | |
| /usr/local/share/gems/gems/aws-sdk-1.3.9/lib/aws/ec2/client.rb:15:in `<module:AWS>' | |
| /usr/local/share/gems/gems/aws-sdk-1.3.9/lib/aws/ec2/client.rb:14:in `<top (required)>' | |
| /usr/local/share/gems/gems/aws-sdk-1.3.9/lib/aws/ec2/errors.rb:20:in `<module:Errors>' | |
| /usr/local/share/gems/gems/aws-sdk-1.3.9/lib/aws/ec2/errors.rb:18:in `<class:EC2>' | |
| /usr/local/share/gems/gems/aws-sdk-1.3.9/lib/aws/ec2/errors.rb:15:in `<module:AWS>' | |
| /usr/local/share/gems/gems/aws-sdk-1.3.9/lib/aws/ec2/errors.rb:14:in `<top (required)>' | |
| (eval):1:in `included' | |
| /usr/local/share/gems/gems/aws-sdk-1.3.9/lib/aws/core/service_interface.rb:24:in `module_eval' | |
| /usr/local/share/gems/gems/aws-sdk-1.3.9/lib/aws/core/service_interface.rb:24:in `included' | |
| /usr/local/share/gems/gems/aws-sdk-1.3.9/lib/aws/ec2.rb:298:in `include' | |
| /usr/local/share/gems/gems/aws-sdk-1.3.9/lib/aws/ec2.rb:298:in `<class:EC2>' | |
| /usr/local/share/gems/gems/aws-sdk-1.3.9/lib/aws/ec2.rb:232:in `<module:AWS>' | |
| /usr/local/share/gems/gems/aws-sdk-1.3.9/lib/aws/ec2.rb:17:in `<top (required)>' | |
| /var/chef/cache/cookbooks/AmazonEC2Tag/libraries/Tags.rb:9:in `putTag' | |
| /var/chef/cache/cookbooks/AmazonEC2Tag/providers/ec2tag.rb:4:in `block in class_from_file' | |
| /usr/local/share/gems/gems/chef-0.10.8/lib/chef/provider.rb:104:in `instance_eval' | |
| /usr/local/share/gems/gems/chef-0.10.8/lib/chef/provider.rb:104:in `block in action' | |
| /usr/local/share/gems/gems/chef-0.10.8/lib/chef/resource.rb:440:in `run_action' | |
| /usr/local/share/gems/gems/chef-0.10.8/lib/chef/runner.rb:45:in `run_action' | |
| /usr/local/share/gems/gems/chef-0.10.8/lib/chef/runner.rb:81:in `block (2 levels) in converge' | |
| /usr/local/share/gems/gems/chef-0.10.8/lib/chef/runner.rb:81:in `each' | |
| /usr/local/share/gems/gems/chef-0.10.8/lib/chef/runner.rb:81:in `block in converge' | |
| /usr/local/share/gems/gems/chef-0.10.8/lib/chef/resource_collection.rb:94:in `block in execute_each_resource' | |
| /usr/local/share/gems/gems/chef-0.10.8/lib/chef/resource_collection/stepable_iterator.rb:116:in `call' | |
| /usr/local/share/gems/gems/chef-0.10.8/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block' | |
| /usr/local/share/gems/gems/chef-0.10.8/lib/chef/resource_collection/stepable_iterator.rb:85:in `step' | |
| /usr/local/share/gems/gems/chef-0.10.8/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate' | |
| /usr/local/share/gems/gems/chef-0.10.8/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index' | |
| /usr/local/share/gems/gems/chef-0.10.8/lib/chef/resource_collection.rb:92:in `execute_each_resource' | |
| /usr/local/share/gems/gems/chef-0.10.8/lib/chef/runner.rb:76:in `converge' | |
| /usr/local/share/gems/gems/chef-0.10.8/lib/chef/client.rb:312:in `converge' | |
| /usr/local/share/gems/gems/chef-0.10.8/lib/chef/client.rb:160:in `run' | |
| /usr/local/share/gems/gems/chef-0.10.8/lib/chef/application/client.rb:239:in `block in run_application' | |
| /usr/local/share/gems/gems/chef-0.10.8/lib/chef/application/client.rb:229:in `loop' | |
| /usr/local/share/gems/gems/chef-0.10.8/lib/chef/application/client.rb:229:in `run_application' | |
| ********** The instance_tag.rb code: | |
| # Cookbook Name:: worker | |
| # Recipe:: instance-tag | |
| # | |
| # Copyright 2012, Numenta, Inc. | |
| # | |
| # All rights reserved - Do Not Redistribute | |
| # Numenta Tags and examples | |
| # Name => grok-0 | |
| # index => index (order of startup) in the cluster; cluster_master is 0, hbase_master is 1 | |
| # instanceType => ondemand, reserved, spot | |
| # mode => production, auto | |
| # user => user who started the instance | |
| # In addition to the above "classic tags", we have added: | |
| # environment => node.chef_environment | |
| # => production, staging, dailystaging, test, development-remote, development-local, chef | |
| # role => cluster_master, hbase_master, work, web-service, stream-service, monitor | |
| # TODO Implement Chef tags to mirror our EC2 tags. | |
| # TODO Refactor much of this functionality into a generalized tagging cookbook that will handle both | |
| # EC2 and Chef tags and work across our cookbooks and roles. | |
| include_recipe "AmazonEC2Tag" | |
| aws = data_bag_item("aws", "main") | |
| cluster_config = data_bag_item('cluster_config', node.chef_environment) | |
| case node['worker']['cluster_role'] | |
| when 'cluster_master' | |
| instance_index = 0 | |
| when 'hbase_master' | |
| instance_index = 1 | |
| when 'worker', 'webservice', 'streamservice' | |
| instance_index = cluster_config['worker_instances'].index(node['fqdn']) + 2 | |
| else | |
| log("Node #{node[fqdn]} does not have a known cluster role (#{node['worker']['cluster_role']})") | |
| end | |
| if node['ec2'] | |
| log("instance_tag - #{node.name} has ec2 attribute") | |
| else | |
| log("instance_tag - #{node.name} does not have ec2 attribute") | |
| end | |
| if node['ec2']['instance_id'] | |
| log("instance_tag - #{node.name} has ec2 instance_id #{node['ec2']['instance_id']}") | |
| else | |
| log("instance_tag - #{node.name} does not have an ec2 instance_id") | |
| end | |
| AmazonEC2Tag_ec2tag 'index' do | |
| aws_access_key aws['aws_access_key_id'] | |
| aws_secret_access_key aws['aws_secret_access_key'] | |
| value "#{instance_index}" | |
| instance_id node['ec2']['instance_id'] | |
| action :create | |
| end | |
| # TODO Must have logic for breaking up environments into descrete clusters. For now we assume they are | |
| # in the same cluster. | |
| case node.chef_environment | |
| when 'production' | |
| name_prefix = 'grok' | |
| when 'staging' | |
| name_prefix = 'staging' | |
| when 'dailystaging' | |
| name_prefix = 'dailystaging' | |
| when 'development' | |
| # TODO Implement user naming for development-remote clusters. | |
| name_prefix = 'development' | |
| when 'local' | |
| # TODO Implement user naming for development-local clusters. | |
| name_prefix = 'local' | |
| when 'test' | |
| name_prefix = 'testcluster' | |
| when 'chef' | |
| name_prefix = "chef" | |
| else | |
| log("Node #{node[fqdn]} does not have a known environment role (#{node.chef_environment})") | |
| name_prefix = "unknown" | |
| end | |
| # Roll back cluster-role based naming. | |
| # case node['worker']['cluster_role'] | |
| # when 'cluster_master', 'hbase_master' | |
| # instance_name = "#{name_prefix}-#{node['worker']['cluster_role']}" | |
| # else | |
| # instance_name = "#{name_prefix}-#{node['worker']['cluster_role']}-#{instance_index}" | |
| # end | |
| instance_name = "#{name_prefix}-#{instance_index}" | |
| AmazonEC2Tag_ec2tag 'Name' do | |
| aws_access_key aws['aws_access_key_id'] | |
| aws_secret_access_key aws['aws_secret_access_key'] | |
| value "#{instance_name}" | |
| instance_id node['ec2']['instance_id'] | |
| action :create | |
| end | |
| # TODO Determine how to find the instance type at runtime and set it. For now use "ondemand" | |
| AmazonEC2Tag_ec2tag 'instanceType' do | |
| aws_access_key aws['aws_access_key_id'] | |
| aws_secret_access_key aws['aws_secret_access_key'] | |
| value 'ondemand' | |
| instance_id node['ec2']['instance_id'] | |
| action :create | |
| end | |
| # TODO Clarify the mode for production staging vs. daily staging. Believe it should mirror production | |
| case node.chef_environment | |
| when 'production' | |
| mode = 'production' | |
| when 'development', 'local' | |
| mode = 'testing' | |
| when 'chef', 'dailystaging', 'staging', 'test' | |
| mode = 'auto' | |
| else | |
| log("Node #{node[fqdn]} does not have a known environment role (#{node.chef_environment})") | |
| mode = 'unknown' | |
| end | |
| AmazonEC2Tag_ec2tag 'mode' do | |
| aws_access_key aws['aws_access_key_id'] | |
| aws_secret_access_key aws['aws_secret_access_key'] | |
| value "#{mode}" | |
| instance_id node['ec2']['instance_id'] | |
| action :create | |
| end | |
| # TODO Determine how to find the user at runtime and set it. For now use "the_chef" | |
| # This will be needed for naming of developer instances. | |
| AmazonEC2Tag_ec2tag 'user' do | |
| aws_access_key aws['aws_access_key_id'] | |
| aws_secret_access_key aws['aws_secret_access_key'] | |
| value 'the_chef' | |
| instance_id node['ec2']['instance_id'] | |
| action :create | |
| end | |
| AmazonEC2Tag_ec2tag 'role' do | |
| aws_access_key aws['aws_access_key_id'] | |
| aws_secret_access_key aws['aws_secret_access_key'] | |
| value node['worker']['cluster_role'] | |
| instance_id node['ec2']['instance_id'] | |
| action :create | |
| end | |
| AmazonEC2Tag_ec2tag 'environment' do | |
| aws_access_key aws['aws_access_key_id'] | |
| aws_secret_access_key aws['aws_secret_access_key'] | |
| value node.chef_environment | |
| instance_id node['ec2']['instance_id'] | |
| action :create | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment