flexera-public / right_aws

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

AcwInterface returns malformed token error #55

Closed markbate closed 13 years ago

markbate commented 13 years ago

If I call: acw = RightAws::AcwInterface.new(key_goes_here, secret_goes_here) stats = acw.list_metrics

I get:

400 Bad Request

http://monitoring.amazonaws.com/doc/2009-05-15/"> Sender DelegationFailure Malformed token 002b8b87-48bc-11e0-bc36-0542cab5ae1c

This is also the case for AWS' javascript scratchpad (their demo doesn't work). However, if you use the command line tool "mon-list-metrics", it gives you a token, which you can then use to get access to the metrics via right_aws & the javascript scratchpad.

According to https://forums.aws.amazon.com/thread.jspa?threadID=42887&tstart=0#167316, users of the Java API were noticing the issue too. This is clearly an AWS bug, which they still haven't fixed, but a work around seems to be setting the user-agent string.

Unfortunately, this doesn't seem to be able to be set in AcwInterface? Any chance we can get this exposed, as the interface is currently unusable.

konstantin-dzreev commented 13 years ago

Hello Mark

There is a way to pass a user-agent:

acw = RightAws::AcwInterface.new(ID, KEY, :connection_options => { :user_agent => 'mozilla'} )

markbate commented 13 years ago

Hi Konstantin,

Sorry, I forgot to reply - it's been a crazy couple of weeks! The :connection_options[:user_agent] seems to do the job perfectly ;p

Thanks, Mark

konstantin-dzreev commented 13 years ago

cool