SDB Signature Error with Boto

72 views
Skip to first unread message

ken

unread,
Feb 25, 2008, 12:20:42 PM2/25/08
to boto-users
I've been using Boto for SDB access. Usually works great, but every so
often I get a mysterious error like this:

<?xml version="1.0"?>
<Response><Errors><Error><Code>SignatureDoesNotMatch</
Code><Message>The request signature we calculated does not match the
signature you provided. Check your AWS Secret Access Key and signing
method. Consult the service documentation for details.</Message></
Error></Errors><RequestID>6a8080e7-2a58-4c79-b309-1f3f752f67c5</
RequestID></Response>
SDBResponseError: 403 Forbidden
<?xml version="1.0"?>

Does anyone hknwo why?

I suspect it might have something to do with string encoding, since I
have also been having occasional issues feeding boto unicode or utf-8
encoding strings.

thanks!
ken

Mitchell Garnaat

unread,
Feb 25, 2008, 2:00:24 PM2/25/08
to boto-...@googlegroups.com
Hi Ken -

Are these intermittent errors that eventually succeed?  Or do certain requests fail consistently?  The SimpleDB Query interface currently has limitations wrt UTF-8 characters (see http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1105&ref=latest-rl for details) so that may explain it but I'd like to understand more about the problems you are experiencing.

Mitch

ken

unread,
Feb 25, 2008, 2:15:45 PM2/25/08
to boto-users
Hi Mitch,


I think you're right -- the intermittent errors are due to UTF-8
characters present in some of my inputs. The errors go away when I
convert from UTF-8 to ascii. Without converting to ascii, the errors
do not eventually succeed on their own.

Btw, thanks for creating such a wonderful package!

Ken


On Feb 25, 2:00 pm, "Mitchell Garnaat" <mitch.garn...@gmail.com>
wrote:
> Hi Ken -
>
> Are these intermittent errors that eventually succeed?  Or do certain
> requests fail consistently?  The SimpleDB Query interface currently has
> limitations wrt UTF-8 characters (seehttp://developer.amazonwebservices.com/connect/entry.jspa?externalID=...
> details) so that may explain it but I'd like to understand more about
> the problems you are experiencing.
>
> Mitch
>

Thai Duong

unread,
Feb 28, 2008, 4:31:36 AM2/28/08
to boto-users


On Feb 26, 2:15 am, ken <kreis...@gmail.com> wrote:

> I think you're right -- the intermittent errors are due to UTF-8
> characters present in some of my inputs. The errors go away when I
> convert from UTF-8 to ascii. Without converting to ascii, the errors
> do not eventually succeed on their own.
>
> Btw, thanks for creating such a wonderful package!
>
> Ken

Hi Ken,

I got exactly the same problem as you. Here is my case: I'm writing an
application that takes an user's input and query SimpleDB to find
matched items. Everything's ok if the input is ascii but as soon as
the user enters some unicode string, the latest svn version of boto
failed with UnicodeEncodeError as below:

File "/usr/lib/python2.5/site-packages/boto/connection.py" in
make_request
263. h.update(str(params[key]))

Exception Type: UnicodeEncodeError at /search/
Exception Value: 'ascii' codec can't encode character u'\u0169' in
position 32: ordinal not in range(128)

When I encoded the input to 'utf-8' (as suggested by
http://paltman.com/2008/02/09/another-unicode-patch-to-boto/), it
passed the UnicodeEncodeError but failed with 403 Signature Doesn't
Match like you.

It seems that we have to:

1. wait for Amazon SimpleDB to support utf-8

2. then patch boto to encode strings to utf-8 before sending them to
Amazon.

Regards,

-Thai

Mitchell Garnaat

unread,
Feb 28, 2008, 6:51:08 AM2/28/08
to boto-...@googlegroups.com
Hi -

Good catch.  I think that line should be changed to:

h.update(unicode(params[key]).encode('utf-8'))

Would mind creating an Issue for this (http://code.google.com/p/boto/issues/list).  Then I'll check in a fix after doing a bit of testing.  Thanks,

Mitch

Thai Duong

unread,
Feb 29, 2008, 2:31:06 AM2/29/08
to boto-users


On Feb 28, 6:51 pm, "Mitchell Garnaat" <mitch.garn...@gmail.com>
wrote:
> Hi -
>
> Good catch. I think that line should be changed to:
>
> h.update(unicode(params[key]).encode('utf-8'))
>
> Would mind creating an Issue for this (http://code.google.com/p/boto/issues/list). Then I'll check in a fix after
> doing a bit of testing. Thanks,

done. http://code.google.com/p/boto/issues/detail?id=98

-Thai

Reply all
Reply to author
Forward
0 new messages