SignatureDoesNotMatch

6 views
Skip to first unread message

alorenzo

unread,
Dec 7, 2010, 11:30:21 AM12/7/10
to M/DB Community Forum
When I create a domain it works OK but when I am trying to put some
data on the domain I get this error:
===============================================================================
WARNING: You are using the built-in XPath processor. Performance will
be degraded significantly. Please ensure the Saxon library distributed
with the AWS SDK for Java (or another high performance XPath
processor) is available on your classpath. For more help, visit the
AWS Java developer forum: http://developer.amazonwebservices.com/connect/forum.jspa?forumID=70&start=0
Dec 7, 2010 10:48:06 AM com.amazonaws.http.HttpClient
handleErrorResponse
INFO: Received error response: Status Code: 403, AWS Request ID:
4e39d556-6fb4-ee4d-304d-2efd8bd3c184, AWS Error Code:
SignatureDoesNotMatch, AWS Error Message: The request signature we
calculated does not match the signature you provided. Check your
Secret Access Key and signing method. Consult the service
documentation for details
Caught an AmazonServiceException, which means your request made it to
Amazon SimpleDB, but was rejected with an error response for some
reason.
Error Message: The request signature we calculated does not match
the signature you provided. Check your Secret Access Key and signing
method. Consult the service documentation for details
HTTP Status Code: 403
AWS Error Code: SignatureDoesNotMatch
Error Type: Unknown
Request ID: 4e39d556-6fb4-ee4d-304d-2efd8bd3c184
===============================================================================
same request works OK in amazon AWS.

Thanks!

rtweed

unread,
Dec 7, 2010, 12:05:03 PM12/7/10
to M/DB Community Forum
What's happening is that the signature that M/DB is creating from your
request is differing from the one you're providing in your request.
I've no idea why this should be happening but let's try to see what M/
DB thinks is going on:

The best way to confirm what's happening is to put M/DB into "trace
mode". You'll need to do this from the GT.M shell which you start by
the following:

cd /usr/local/gtm/ewd
$gtm

Now you should see the GT.M shell prompt:

GTM>

now type:

set ^zewd("trace")=1

and hit Enter.

also type:

kill ^%zewdTrace

and hit Enter


Now run that M/DB request again from your client. When you get the
error back, type the following into the GT.M shell:

zwr ^%zewdTrace


and cut and paste what it shows and post it here so we can take a
look.

To reset trace mode:

set ^zewd("trace")=0

and to get out of the GT.M shell:

h
then Enter

Rob






On Dec 7, 4:30 pm, alorenzo <xeroxi...@gmail.com> wrote:
> When I create a domain it works OK but when I am trying to put some
> data on the domain I get this error:
> =========================================================================== ====
> WARNING: You are using the built-in XPath processor. Performance will
> be degraded significantly. Please ensure the Saxon library distributed
> with the AWS SDK for Java (or another high performance XPath
> processor) is available on your classpath. For more help, visit the
> AWS Java developer forum:http://developer.amazonwebservices.com/connect/forum.jspa?forumID=70&...

alorenzo

unread,
Dec 7, 2010, 5:37:26 PM12/7/10
to M/DB Community Forum
Hi,
I have done it and here is the trace:
=======================================================================================
^%zewdTrace=4
^%zewdTrace(1)="MDB request processing for BatchPutAttributes: started
at 62067,62733; process: 2013"
^%zewdTrace(2)="62067,62733: string to sign:POST"_
$C(10)_"13.141.221.56"_$C(10)_"/mdb/request.mgwsi"_$C(10)_"AWSAcces

sKeyId=alorenzo&Action=BatchPutAttributes&DomainName=myStore&Item.
1.Attribute.1.Name=Category&Item.1.Attrib
ute.1.Value=Clothes&Item.1.Attribute.2.Name=Subcategory&Item.
1.Attribute.2.Value=Sweater&Item.1.Attribute.3
.Name=Name&Item.1.Attribute.3.Value=Cathair%2BSweater&Item.
1.Attribute.4.Name=Color&Item.1.Attribute.4.Valu
e=Siamese&Item.1.Attribute.5.Name=Size&Item.1.Attribute.
5.Value=Small&Item.1.Attribute.6.Name=Size&Item.1.A
ttribute.6.Value=Medium&Item.1.Attribute.7.Name=Size&Item.
1.Attribute.7.Value=Large&Item.1.ItemName=Item_01
&Item.2.Attribute.1.Name=Category&Item.2.Attribute.
1.Value=Clothes&Item.2.Attribute.2.Name=Subcategory&Item
.2.Attribute.2.Value=Pants&Item.2.Attribute.3.Name=Name&Item.
2.Attribute.3.Value=Designer%2BJeans&Item.2.At
tribute.4.Name=Color&Item.2.Attribute.4.Value=Paisley%2BAcid
%2BWash&Item.2.Attribute.5.Name=Size&Item.2.Att
ribute.5.Value=30x32&Item.2.Attribute.6.Name=Size&Item.
2.Attribute.6.Value=32x32&Item.2.Attribute.7.Name=Si
ze&Item.2.Attribute.7.Value=32x34&Item.
2.ItemName=Item_02&Item.3.Attribute.1.Name=Category&Item.3.Attribute
.1.Value=Clothes&Item.3.Attribute.2.Name=Subcategory&Item.
3.Attribute.2.Value=Pants&Item.3.Attribute.3.Name
=Name&Item.3.Attribute.3.Value=Sweatpants&Item.3.Attribute.
4.Name=Color&Item.3.Attribute.4.Value=Blue&Item.
3.Attribute.5.Name=Color&Item.3.Attribute.
5.Value=Yellow&Item.3.Attribute.6.Name=Color&Item.3.Attribute.6.V
alue=Pink&Item.3.Attribute.7.Name=Size&Item.3.Attribute.
7.Value=Large&Item.3.Attribute.8.Name=Year&Item.3.A
ttribute.8.Value=2006&Item.3.Attribute.9.Name=Year&Item.
3.Attribute.9.Value=2007&Item.3.ItemName=Item_03&It
em.4.Attribute.1.Name=Category&Item.4.Attribute.1.Value=Car
%2BParts&Item.4.Attribute.2.Name=Subcategory&Ite
m.4.Attribute.2.Value=Engine&Item.4.Attribute.
3.Name=Name&Item.4.Attribute.3.Value=Turbos&Item.4.Attribute.
4.Name=Make&Item.4.Attribute.4.Value=Audi&Item.4.Attribute.
5.Name=Model&Item.4.Attribute.5.Value=S4&Item.4.
Attribute.6.Name=Year&Item.4.Attribute.6.Value=2000&Item.
4.Attribute.7.Name=Year&Item.4.Attribute.7.Value=2
001&Item.4.Attribute.8.Name=Year&Item.4.Attribute.
8.Value=2002&Item.4.ItemName=Item_04&Item.5.Attribute.1.N
ame=Category&Item.5.Attribute.1.Value=Car%2BParts&Item.
5.Attribute.2.Name=Subcategory&Item.5.Attribute.2.Va
lue=Emissions&Item.5.Attribute.3.Name=Name&Item.5.Attribute.
3.Value=O2%2BSensor&Item.5.Attribute.4.Name=Mak
e&Item.5.Attribute.4.Value=Audi&Item.5.Attribute.
5.Name=Model&Item.5.Attribute.5.Value=S4&Item.5.Attribute.
6.Name=Year&Item.5.Attribute.6.Value=2000&Item.5.Attribute.
7.Name=Year&Item.5.Attribute.7.Value=2001&Item.5
.Attribute.8.Name=Year&Item.5.Attribute.8.Value=2002&Item.
5.ItemName=Item_05&SignatureMethod=HmacSHA256&Sig

natureVersion=2&Timestamp=2010-12-07T22%3A31%3A00.687Z&Version=2009-04-15"
^%zewdTrace(3)="62067,62733: hash=K2kIOl/5NEAPDZQnaa5cDXTsndGUD+YxJe+
+bcL8Rqo=; signature rcvd=fLeTZ4KlRcvm5UwzxkpFCS
jhIhB1LUteN2m4/secHvM="
^%zewdTrace(4)="MDB request processing ended at 62067,62733"
=======================================================================================

rtweed

unread,
Dec 7, 2010, 7:29:32 PM12/7/10
to M/DB Community Forum
OK you can see the raw string to sign that M/DB determined from your
request in the trace above. M/DB determined that the hash for this
was K2kIOl/5NEAPDZQnaa5cDXTsndGUD+YxJe++bcL8Rqo=

However, your client sent a hash of
fLeTZ4KlRcvm5UwzxkpFCSjhIhB1LUteN2m4/secHvM="

I suspect the problem is the order of the attributes that M/DB is
using in its string to sign, though on the face of it I don't see any
glaring problem. If possible could you use one of the Amazon SimpleDB
workbench tools to see what the expected string to sign ought to be
(since you say that SimpleDB accepts such an Action)

Rob

rtweed

unread,
Dec 9, 2010, 3:54:25 AM12/9/10
to M/DB Community Forum
Did you manage to find out the correct string to sign for your
particular request? If you can send me a copy of the original HTTP
request you sent I may be able to help - if fact if you can check the
trace you sent me (above) and confirm that all the required name/value
pairs have been included correctly (if not necessarily in the correct
order) I can possibly run some tests myself to see where the
difference(s) lie between proper SimpleDB and M/DB

Regards

Rob

alorenzo

unread,
Dec 9, 2010, 9:46:49 AM12/9/10
to M/DB Community Forum
Rob,
I've tried with cfsign.pl and I could not get the signature. Here is
the post which works on AWS:
POST http://13.141.221.56/mdb/request.mgwsi / Parameters: (Item.
3.Attribute.8.Value: 2006, Item.4.Attribute.4.Value: Audi, Item.
4.Attribute.1.Name: Category, Item.2.Attribute.1.Name: Category, Item.
3.Attribute.2.Name: Subcategory, Item.4.Attribute.3.Name: Name, Item.
4.Attribute.2.Value: Engine, Item.5.Attribute.2.Name: Subcategory,
Item.5.Attribute.1.Value: Car Parts, Item.4.Attribute.8.Name: Year,
Item.2.Attribute.2.Name: Subcategory, Item.5.Attribute.1.Name:
Category, Item.3.Attribute.1.Value: Clothes, Item.2.Attribute.2.Value:
Pants, Item.4.Attribute.5.Value: S4, Item.3.Attribute.3.Value:
Sweatpants, Item.3.Attribute.5.Value: Yellow, Item.1.Attribute.
3.Value: Cathair Sweater, Item.3.Attribute.4.Name: Color, Item.
4.Attribute.7.Name: Year, Item.5.Attribute.8.Value: 2002, DomainName:
myStore, Version: 2009-04-15, Item.1.Attribute.3.Name: Name, Item.
5.Attribute.7.Name: Year, Item.4.Attribute.6.Name: Year, Item.
4.Attribute.3.Value: Turbos, Item.3.Attribute.6.Value: Pink,
SignatureMethod: HmacSHA256, Item.1.Attribute.5.Name: Size, Item.
3.Attribute.1.Name: Category, Item.3.Attribute.9.Value: 2007, Item.
5.Attribute.2.Value: Emissions, Item.2.ItemName: Item_02, Item.
1.Attribute.2.Name: Subcategory, Item.2.Attribute.5.Name: Size, Item.
4.ItemName: Item_04, Item.1.Attribute.1.Value: Clothes, Item.
1.Attribute.1.Name: Category, Item.4.Attribute.2.Name: Subcategory,
Item.1.Attribute.5.Value: Small, Item.3.Attribute.6.Name: Color, Item.
4.Attribute.7.Value: 2001, Item.3.Attribute.5.Name: Color, Item.
4.Attribute.6.Value: 2000, Item.2.Attribute.7.Name: Size,
SignatureVersion: 2, Item.2.Attribute.1.Value: Clothes, Item.
1.Attribute.7.Name: Size, Item.5.Attribute.5.Name: Model, Item.
3.Attribute.3.Name: Name, Item.3.Attribute.8.Name: Year, Item.
1.Attribute.4.Name: Color, Item.3.Attribute.7.Name: Size, Item.
5.Attribute.7.Value: 2001, Item.3.ItemName: Item_03, Item.4.Attribute.
8.Value: 2002, Item.2.Attribute.6.Value: 32x32, Item.1.Attribute.
4.Value: Siamese, Item.3.Attribute.7.Value: Large, Signature:
fj9PA8SAqlOsv5BBDanJHe4oC7JnGEcBLO7cVPdBbDc=, Item.2.Attribute.3.Name:
Name, Item.1.Attribute.6.Name: Size, Item.2.Attribute.7.Value: 32x34,
Item.2.Attribute.5.Value: 30x32, Action: BatchPutAttributes, Item.
5.Attribute.4.Name: Make, Item.1.Attribute.7.Value: Large, Item.
4.Attribute.4.Name: Make, Item.4.Attribute.5.Name: Model, Item.
5.Attribute.5.Value: S4, Item.3.Attribute.4.Value: Blue, Item.
1.Attribute.2.Value: Sweater, Item.5.Attribute.8.Name: Year, Item.
5.Attribute.3.Name: Name, Item.5.Attribute.6.Name: Year,
AWSAccessKeyId: alorenzo, Item.2.Attribute.4.Value: Paisley Acid Wash,
Item.3.Attribute.9.Name: Year, Item.5.Attribute.3.Value: O2 Sensor,
Timestamp: 2010-12-07T22:49:20.484Z, Item.5.Attribute.4.Value: Audi,
Item.1.Attribute.6.Value: Medium, Item.5.ItemName: Item_05, Item.
2.Attribute.4.Name: Color, Item.4.Attribute.1.Value: Car Parts, Item.
1.ItemName: Item_01, Item.3.Attribute.2.Value: Pants, Item.2.Attribute.
6.Name: Size, Item.5.Attribute.6.Value: 2000, Item.2.Attribute.
3.Value: Designer Jeans, )

is this good enough?
Thanks for the time and help
Arturo

alorenzo

unread,
Dec 13, 2010, 2:51:54 PM12/13/10
to M/DB Community Forum
Rob,
Were you able to test the Post?
thanks!

On Dec 9, 9:46 am, alorenzo <xeroxi...@gmail.com> wrote:
> Rob,
> I've tried with cfsign.pl and I could not get the signature.  Here is
> the post which works on AWS:
> POSThttp://13.141.221.56/mdb/request.mgwsi/ Parameters: (Item.
> ...
>
> read more »
Message has been deleted

Dennis

unread,
Jan 4, 2011, 2:54:41 AM1/4/11
to M/DB Community Forum
I met the same problem as you did. If possible, just avoid '%' and ' '
in your values, which works for me.
I guess there may be something wrong when M/DB calculating the
signature, especially in the case that '%' or ' ' is involved in the
values.

--
Dennis

On Dec 8 2010, 12:30 am, alorenzo <xeroxi...@gmail.com> wrote:
> When I create a domain it works OK but when I am trying to put some
> data on the domain I get this error:
> =========================================================================== ====
> WARNING: You are using the built-in XPath processor. Performance will
> be degraded significantly. Please ensure the Saxon library distributed
> with the AWS SDK for Java (or another high performance XPath
> processor) is available on your classpath. For more help, visit the
> AWS Java developer forum:http://developer.amazonwebservices.com/connect/forum.jspa?forumID=70&...

rtweed

unread,
Jan 4, 2011, 5:39:00 AM1/4/11
to M/DB Community Forum
I believe the % problem is now fixed. I've put the new build of MDB.m
into Github at https://github.com/robtweed/mdb

Simply copy the file MDB.m from the Github repo and overwrite the
version that you'll find in /usr/local/gtm/ewd in your M/DB
Appliance. Then relink the M/DB routine:

cd /usr/local/gtm/ewd
mumps MDB.m

and then restart Apache:

sudo /etc/init.d/apache2 restart

Let me know if you still have problems

Rob
Reply all
Reply to author
Forward
0 new messages