Skip Menu |

This queue is for tickets about the Amazon-SQS-Simple CPAN distribution.

Report information
The Basics
Id: 95807
Status: resolved
Priority: 0/
Queue: Amazon-SQS-Simple

People
Owner: PENFOLD [...] cpan.org
Requestors: erik [...] zasran.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.03
Fixed in: (no value)



Subject: Intermittent failure where 'AWSAccessKeyId' => 'AWSAccessKeyId'
Date: Tue, 20 May 2014 14:06:21 -0700
To: bug-Amazon-SQS-Simple [...] rt.cpan.org
From: Erik Steffl <erik [...] zasran.com>
System: Ubuntu 14.04 trusty Amazon::SQS::Simple from ubuntu package libamazon-sqs-simple-perl 2.03-1 (our $VERSION = '2.03';) Using it to send messages only, it works fine most of the time but sometime I get the error: ERROR [try ]: On calling SendMessage: 403 Forbidden (The AWS Access Key Id you provided does not exist in our records.) If that's the case I notice that Amazon::SQS::Simple::Queue has wrong AWSAccessKeyId, here's dump of the object: $VAR1 = bless({ 'SignatureVersion' => 2, 'SecretKey' => 'correct secret key is here', 'Version' => '2012-11-05', 'Endpoint' => 'http://queue.amazonaws.com/089741050239 ...', 'AWSAccessKeyId' => 'AWSAccessKeyId' }, 'Amazon::SQS::Simple::Queue' ); AWSAccessKeyId is set to 'AWSAccessKeyId'. At first I thought I am doing something wrong but it's a pretty simple script that gets both aws access key and aws secret key from command line. I run it number of times and most of the time it does work but sometime it doesn't (in approximately 10% to 20% it does not work). erik
RT-Send-CC: glenn.fowler [...] gmail.com
Known issue - reported via email about two days before you did :D Under investigation.
From: chadd [...] fidelissys.com
On Thu May 29 05:46:16 2014, PENFOLD wrote: Show quoted text
> Known issue - reported via email about two days before you did :D > > Under investigation.
I think I'm seeing this bug. It's dependent on the hash order (now randomized in 5.18+, I'm using ubuntu 14.04/trusty's 5.18.2 build) and after a couple of hours, I think I found the issue. My code calls $sqs->ListQueues($q_name) to get the Amazon::SQS::Simple::Queue object, then calls SendMessage (though any method triggers the bug) using that object. But *sometimes* that queue is broken. When ListQueues builds the queue objects it will return, it says: `new Amazon::SQS::Simple::Queue(%$self, Endpoint => $_)` -- but whose new method? It's inherited from Amazon::SQS::Simple::Base which parses its arguments as ($class, $key, $secret, %opts)! Whatever hash key/value arrive first get set as the key/secret. When that's a non-credential-related key, then both the key/secret are still in @_ and overwrite the damage with the correct values. The hash key that was erroneously used as key ID doesn't get visibly corrupted because it has a *default* that's applied. When that's the SecretKey, then the $secret_key is correct, and AWSAccessKeyId is still in @_ to overwrite the AWSAccessKeyId=>'SecretKey' that happened. When that's AWSAccessKeyId, then the key gets set to 'AWSAccessKeyId', the SecretKey becomes the actual key ID (AKIAsomething)... but the SecretKey is still in @_ and overwrites the damage to SecretKey with the correct value. Unfortunately in this case, AWSAccessKeyId is *not* in @_ and the key ID stays broken.
Want to add that I'm seeing the same issue. On Tue May 20 17:06:46 2014, erik@zasran.com wrote: Show quoted text
> System: Ubuntu 14.04 trusty > Amazon::SQS::Simple from ubuntu package libamazon-sqs-simple-perl 2.03-1 > (our $VERSION = '2.03';) > > Using it to send messages only, it works fine most of the time but > sometime I get the error: > > ERROR [try ]: On calling SendMessage: 403 Forbidden (The AWS Access Key > Id you provided does not exist in our records.) > > If that's the case I notice that Amazon::SQS::Simple::Queue has wrong > AWSAccessKeyId, here's dump of the object: > > $VAR1 = bless({ > 'SignatureVersion' => 2, > 'SecretKey' => 'correct secret key is here', > 'Version' => '2012-11-05', > 'Endpoint' => 'http://queue.amazonaws.com/089741050239 ...', > 'AWSAccessKeyId' => 'AWSAccessKeyId' > }, 'Amazon::SQS::Simple::Queue' ); > > AWSAccessKeyId is set to 'AWSAccessKeyId'. At first I thought I am doing > something wrong but it's a pretty simple script that gets both aws > access key and aws secret key from command line. I run it number of > times and most of the time it does work but sometime it doesn't (in > approximately 10% to 20% it does not work). > > erik
From: simon.proctor [...] gmail.com
We're currently using this patch to fix the constructor calls in Amazon::SQS::Simple to Amazon::SQS::Simple::Queue. Simon
Subject: fix-constructors.patch
--- a/lib/Amazon/SQS/Simple.pm +++ b/lib/Amazon/SQS/Simple.pm @@ -21,6 +21,7 @@ sub GetQueue { } return new Amazon::SQS::Simple::Queue( + $self->{AWSAccessKeyId}, $self->{SecretKey}, %$self, Endpoint => $queue_endpoint, ); @@ -36,6 +37,7 @@ sub CreateQueue { if ($href->{CreateQueueResult}{QueueUrl}) { return Amazon::SQS::Simple::Queue->new( + $self->{AWSAccessKeyId}, $self->{SecretKey}, %$self, Endpoint => $href->{CreateQueueResult}{QueueUrl}, ); @@ -53,6 +55,7 @@ sub ListQueues { if ($href->{ListQueuesResult}{QueueUrl}) { my @result = map { new Amazon::SQS::Simple::Queue( + $self->{AWSAccessKeyId}, $self->{SecretKey}, %$self, Endpoint => $_, )
Dne 2014-11-07 12:45:55, JSLAGEL napsal(a):
Show quoted text
> Want to add that I'm seeing the same issue.
Mee too.
Could this be fixed?

On Tue Mar 10 05:48:31 2015, JIRA wrote: Show quoted text
> Dne 2014-11-07 12:45:55, JSLAGEL napsal(a):
> > Want to add that I'm seeing the same issue.
> Mee too. > Could this be fixed?
Fixed in 2.04