Login

    Register

Managed Hosting

PROJECT CATEGORIES

 

Amazon EC2/S3/SQS/SimpleDB Console
Project Home Blog Forums Known Issues Screenshots Contact Project

Amazon EC2/S3/SQS/SimpleDB Console Issue: putAttributes only allows a max 9 attribute pairs

Name: putAttributes only allows a max 9 attribute pairs
ID: 3
Project: Amazon EC2/S3/SQS/SimpleDB Console
Type: Bug
Area: Code
Severity: High
Status: Closed
Related URL:
Creator: Dave Hoff
Created: 01/12/09 9:38 PM
Updated: 07/12/11 7:46 PM
Description: putAttributes returns a SignatureDoesNotMatch error when passing in more than 9 attribute/value pairs. Any ideas?
History: Created by harborhoffer (Dave Hoff) : 01/12/09 9:38 PM

Comment by flguy (David Smith) : 01/13/09 10:24 AM
Not sure without knowing what you are trying to pass. It could be some random character in one of your nine pairs. The signatures are very very sensitive. I have some debug code that is commented out in the CFC. You may want to un-comment the debug code and see what kind of signature output CF is generating.

Comment by harborhoffer (Dave Hoff) : 01/13/09 7:34 PM
Thanks Dave. The problem is it doesn't matter what data you pass, it just won't take more than 9 attribute pairs. I even added a new field to your interface under the memo field and sure enough, got the same error.

Comment by tadams67 (Tom) : 02/28/09 8:42 PM
Hi I had this same problem and I believe the Attribute.X.Name must appear in lexicographic order of "X", meaning that when you have 10 attributes they must appear in the order 0, 1, 10, 2, 3...9 This worked for me, I am going to verify by trying 11-20, then up to 100 as the documentation appears to say that you can set up to 100 attributes per call.

Comment by tadams67 (Tom) : 02/28/09 9:00 PM
At least for Sig Version 1, I was able to specify X with literal values 00, 01, 02, 03, ... 09, 10, 11... without problems, in order to avoid having to map ints to their lexicographic position.

Updated by flguy (David Smith) : 03/01/09 5:37 PM

Comment by pud (Philip Kaplan) : 07/12/11 7:46 PM
Here's how I solved this problem.

First, I put this function in db.cfc, somewhere toward the top of the script:


<cffunction name="padWithZeros" output="false">
      <cfargument name="num" type="numeric" required="true"/>

      <cfif num lt 10>
         <cfreturn "0#arguments.num#">
      <cfelse>
         <cfreturn "#arguments.num#">
      </cfif>
   </cffunction>

Next, everywhere you see something in db.cfc like "Attribute.#index-1#" or "Attribute.#index#, replace it with:

"Attribute.#padWithZeros(index-1)#" or "Attribute.#padWithZeros(index-1)#" and so on.

To add a comment to this bug, please login using the link above.