flexera-public / right_aws

RightScale Amazon Web Services Ruby Gems
MIT License
451 stars 175 forks source link

rds describe_db_parameters("mysql51") returns error ParameterGroupFamily ["mysql5.1"] is not a valid parameter group family #118

Open neillturner opened 12 years ago

neillturner commented 12 years ago

rds describe_db_parameters(mysql51) returns error ParameterGroupFamily ["mysql5.1"] is not a valid parameter group family

it appears that the rds interface for describe_db_parameters is turning the parameter in an array. ie mysql5.1 becomes ["mysql5.1"] before being passed as a parameter to the amazon rds calls. it looks like amazon is not expecting an array hence this problem

the problem is in this bit of code

def describe_db_parameters(*db_parameter_group_name, &block) item, params = AwsUtils::split_items_and_params(db_parameter_group_name) params['DBParameterGroupName'] = item

if you change to the following it works.

def describe_db_parameters(*db_parameter_group_name, &block) item, params = AwsUtils::split_items_and_params(db_parameter_group_name) puts "item has become an array #{item}"

put it back to string and it will work

  item = "default.mysql5.1
  params['DBParameterGroupName'] = item  

I don't really understand why this is happening. the rds_interface code has not changed from version 2.0.0 to version 3.0.0 in this area so i don't understand how this error got introduced. it worked ok in rds_inteface 2.0.0 I can workaround by modifying the rds_intrerface

I suspect the same problem maybe on other rds calls as well. Have not tested them all yet.

neillturner commented 12 years ago

workaround is def describe_db_parameters(*db_parameter_group_name, &block) item, params = AwsUtils::split_items_and_params(db_parameter_group_name) gn = item[0] params['DBParameterGroupName'] = gn

konstantin-dzreev commented 12 years ago

Not sure I can reproduce the issue:

rds.describe_db_parameters('default.mysql5.1') #=> works rds.describe_db_parameters(['default.mysql5.1']) #=> works

could you post your code that fails + its callstack plz?

And any way the call above should not complain on invalid "DBParameterGroupFamily" because it accepts "DBParameterGroupName" parameter. The only call (as I remember) that takes "DBParameterGroupFamily" is "describe_engine_default_parameters" but it also works fine:

rds.describe_engine_default_parameters #=> works rds.describe_engine_default_parameters('mysql5.1') #=> works rds.describe_engine_default_parameters(['mysql5.1']) #=> works

konstantin-dzreev commented 12 years ago

oh... it might me a ruby 1.9.x issue.. lemme see

konstantin-dzreev commented 12 years ago

should be fixed: plz try out "development" branch

neillturner commented 12 years ago

yes it happens with windows ruby 1.9.2

On 21 February 2012 20:41, Konstantin Dzreyev reply@reply.github.com wrote:

should be fixed: plz try out "development" branch


Reply to this email directly or view it on GitHub: https://github.com/rightscale/right_aws/issues/118#issuecomment-4087702

konstantin-dzreev commented 12 years ago

Could you try the "development" branch not "master"? The issue should be fixed there.

Thanks

neillturner commented 12 years ago

will try tomorrow

On 21 February 2012 21:45, Konstantin Dzreyev reply@reply.github.com wrote:

Could you try the "development" branch not "master"? The issue should be fixed there.

Thanks


Reply to this email directly or view it on GitHub: https://github.com/rightscale/right_aws/issues/118#issuecomment-4089662

neillturner commented 12 years ago

on a totally unrelated matter any chance of a cloud formation implementation. Fog have implemented cloud formation it is pretty easy although i am struggling to get it to work. Cloud formation is very powerful as you can just pass through JSON format script to do lots of different config.

On 21 February 2012 21:45, Konstantin Dzreyev reply@reply.github.com wrote:

Could you try the "development" branch not "master"? The issue should be fixed there.

Thanks


Reply to this email directly or view it on GitHub: https://github.com/rightscale/right_aws/issues/118#issuecomment-4089662

neillturner commented 12 years ago

Hi, I looked at the code in the dev branch: def describe_db_snapshots(params={}, &block) item, params = AwsUtils::split_items_and_params(params) params['DBSnapshotIdentifier'] = item if item params['DBInstanceIdentifier'] = params.delete(:instance_aws_id) unless params[:instance_aws_id].right_blank? but i will test anyway maybe the split_items has been fixed.

Neill

On 21 February 2012 18:09, Konstantin Dzreyev reply@reply.github.com wrote:

Not sure I can reproduce the issue:

rds.describe_db_parameters('default.mysql5.1') #=> works rds.describe_db_parameters(['default.mysql5.1']) #=> works

could you post your code that fails + its callstack plz?

And any way the call above should not complain on invalid "DBParameterGroupFamily" because it accepts "DBParameterGroupName" parameter. The only call (as I remember) that takes "DBParameterGroupFamily" is "describe_engine_default_parameters" but it also works fine:

rds.describe_engine_default_parameters #=> works rds.describe_engine_default_parameters('mysql5.1') #=> works rds.describe_engine_default_parameters(['mysql5.1']) #=> works


Reply to this email directly or view it on GitHub: https://github.com/rightscale/right_aws/issues/118#issuecomment-4080431

konstantin-dzreev commented 12 years ago

yes, the issue was in another place

neillturner commented 12 years ago

Hi, tried dev branch, some problem: coding: rds.describe_db_snapshots.each do |r| @data[i] = r i = i+1 end

fails :

environment.rds_connection W, [2012-02-22T16:42:55.488389 #7408] WARN -- : ##### RightAws::RdsInterface re turned an error: 404 Not Found

Sender DBSnapshotNotFound DBSnapshot [] not found. 449e73ab-5d74-11e1-83f6-e39fdad562e0

W, [2012-02-22T16:42:55.490389 #7408] WARN -- : ##### RightAws::RdsInterface re quest: https://rds.us-east-1.amazonaws.com:443/?AWSAccessKeyId=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&Action=DescribeDBSnapshots&DBSnapshotIdentifier=%5B%5D&SignatureMethod=HmacS HA256&SignatureVersion=2&Timestamp=2012-02-22T16%3A42%3A55.000Z&Version=2011-04- 01&Signature=zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz #### C:/Ruby192/lib/ruby/gems/1.9.1/gems/right_aws-3.0.0/lib/awsbase/right_awsbase.rb :551:in request_info_impl': DBSnapshotNotFound: DBSnapshot [] not found. (Right Aws::AwsError) from C:/Ruby192/lib/ruby/gems/1.9.1/gems/right_aws-3.0.0/lib/rds/right_r ds_interface.rb:84:inrequest_info' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/right_aws-3.0.0/lib/rds/right_r ds_interface.rb:95:in block in incrementally_list_items' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/right_aws-3.0.0/lib/rds/right_r ds_interface.rb:93:inloop' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/right_aws-3.0.0/lib/rds/right_r ds_interface.rb:93:in incrementally_list_items' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/right_aws-3.0.0/lib/rds/right_r ds_interface.rb:718:indescribe_db_snapshots' from C:/EC2Dream_FR/system/EC2_List_rds.rb:106:in load_db_snapshots' from C:/EC2Dream_FR/system/EC2_List_main.rb:1102:inload_sort_reload' from C:/EC2Dream_FR/system/EC2_List_main.rb:1061:in load_sort' from C:/EC2Dream_FR/system/EC2_List_main.rb:1054:inload' from C:/EC2Dream_FR/system/EC2_Main.rb:135:in tree_process' from C:/EC2Dream_FR/system/EC2_Main.rb:104:inblock in initialize' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/fxruby-1.6.20-x86-mingw32/lib/f ox16/responder2.rb:55:in call' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/fxruby-1.6.20-x86-mingw32/lib/f ox16/responder2.rb:55:inonHandleMsg' from C:/EC2Dream_FR/system/EC2_Main.rb:308:in selectItem' from C:/EC2Dream_FR/system/EC2_Main.rb:308:inrun' from C:/EC2Dream_FR/system/EC2_Main.rb:308:in `

' C:/EC2Dream_FR/system/EC2_Main.rb: [BUG] Segmentation fault ruby 1.9.2p290 (2011-07-09) [i386-mingw32]

On 21 February 2012 22:35, Konstantin Dzreyev reply@reply.github.com wrote:

yes, the issue was in another place


Reply to this email directly or view it on GitHub: https://github.com/rightscale/right_aws/issues/118#issuecomment-4090796

konstantin-dzreev commented 12 years ago

mhh... sorry... did you do "git pull"? I put the fix yesterday.

It works fine on my ruby 1.9.2:

pp rds.describe_db_snapshots #=>

Running tool: Ruby 1.9.2

I, [2012-02-22T09:42:16.816563 #3896] INFO -- : New RightAws::RdsInterface using shared connections mode I, [2012-02-22T09:42:16.817321 #3896] INFO -- : Opening new HTTPS connection to rds.amazonaws.com:443 [{:endpoint_port=>3306, :create_time=>"2010-12-07T00:27:55.985Z", :engine=>"mysql", :status=>"available", :availability_zone=>"us-east-1a", :license_model=>"general-public-license", :instance_create_time=>"2010-11-23T09:42:51.772Z", :allocated_storage=>25, ..... ]

neillturner commented 12 years ago

No just downloaded the development version ------Original Message------ From: Konstantin Dzreyev To: neillwturner@gmail.com Subject: Re: [right_aws] rds describe_db_parameters("mysql51") returns error ParameterGroupFamily ["mysql5.1"] is not a valid parameter group family (#118) Sent: 22 Feb 2012 5:46 PM

mhh... sorry... did you do "git pull"? I put the fix yesterday.

It works fine on my ruby 1.9.2:

pp rds.describe_db_snapshots #=>

Running tool: Ruby 1.9.2

I, [2012-02-22T09:42:16.816563 #3896] INFO -- : New RightAws::RdsInterface using shared connections mode I, [2012-02-22T09:42:16.817321 #3896] INFO -- : Opening new HTTPS connection to rds.amazonaws.com:443 [{:endpoint_port=>3306, :create_time=>"2010-12-07T00:27:55.985Z", :engine=>"mysql", :status=>"available", :availability_zone=>"us-east-1a", :license_model=>"general-public-license", :instance_create_time=>"2010-11-23T09:42:51.772Z", :allocated_storage=>25, ..... ]


Reply to this email directly or view it on GitHub: https://github.com/rightscale/right_aws/issues/118#issuecomment-4110947

Sent from my BlackBerry® wireless device

konstantin-dzreev commented 12 years ago

plz go into your right_aws folder and do there:

git pull origin git checkout development

and then run your code