-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQS ReceiptHandles are not properly encoded when calling DeleteMessage #22
Comments
I'm not sure what's going on here, but I think that's a red herring and might actually be coming from AWS:
You can see here that the request body has "a+b" in it, but the response body as "a b" in it. Will keep digging. |
Oh I see. It looks like the request body is using the content-type With some poor-man's url-encoding (only replacing the user=> (def receipt (-> *1 :Messages first :ReceiptHandle))
"AQEBJFdXbiQ7LSt01y4R0Hat0gl6uHhniLzVXIXRoqmF+8pzCibXz356dVRBzfggzpsCF4kNNPcyOt4P8T7fy3vF+UQXlQeOABNGv3+CxGfIqaalEZK6c5OinDn8BHNKOcltDiY9gES7Tl52uDpxFGs+Bc8zle3lN+5i+otRImVHlFgss3fZC9a1tGuhGvx7/GFZFiwdsF4esGdiOKopxHPGj8gHb3eojmJPI53fFOq//E9VsUxd+LsBQ4Z/GdvwfLsYDmg+4exS2ti59V6OSpe529xE1An04WAbJNzF19p+PsU8uxxwPV/Qcpt3gFAtF8/JmkcN9IjPd1yjySSLjnSUALCJR33QQ/ZEHXZ5zeGwL6VS/w2bB2wMT+3n+nKU+yzXtSU9GlyLfzZ3yAD/wJLdd6hu4GhZdLu0v/OVXFwDygg="
user=> (aws/invoke sqs {:op :DeleteMessage :request {:QueueUrl url :ReceiptHandle receipt}})
{:ErrorResponse
{:Error
{:Type "Sender",
:Code "ReceiptHandleIsInvalid",
:Message
"The input receipt handle \"AQEBJFdXbiQ7LSt01y4R0Hat0gl6uHhniLzVXIXRoqmF 8pzCibXz356dVRBzfggzpsCF4kNNPcyOt4P8T7fy3vF UQXlQeOABNGv3 CxGfIqaalEZK6c5OinDn8BHNKOcltDiY9gES7Tl52uDpxFGs Bc8zle3lN 5i otRImVHlFgss3fZC9a1tGuhGvx7/GFZFiwdsF4esGdiOKopxHPGj8gHb3eojmJPI53fFOq//E9VsUxd LsBQ4Z/GdvwfLsYDmg 4exS2ti59V6OSpe529xE1An04WAbJNzF19p PsU8uxxwPV/Qcpt3gFAtF8/JmkcN9IjPd1yjySSLjnSUALCJR33QQ/ZEHXZ5zeGwL6VS/w2bB2wMT 3n nKU yzXtSU9GlyLfzZ3yAD/wJLdd6hu4GhZdLu0v/OVXFwDygg=\" is not a valid receipt handle.",
:Detail nil},
:RequestId "5e9185bd-b92c-5248-8ede-d137cb76a3b5"},
:ErrorResponseAttrs
{:xmlns "http://queue.amazonaws.com/doc/2012-11-05/"},
:cognitect.anomalies/category :cognitect.anomalies/not-found}
user=> (def escaped-receipt (clojure.string/replace receipt "+" "%2B"))
#'user/escaped-receipt
user=> (aws/invoke sqs {:op :DeleteMessage :request {:QueueUrl url :ReceiptHandle escaped-receipt}})
{:DeleteMessageResponse {:ResponseMetadata {:RequestId "2d277894-c347-56fc-b2da-2c1eb05c935f"}}, :DeleteMessageResponseAttrs {:xmlns "http://queue.amazonaws.com/doc/2012-11-05/"}} |
Good sleuthing @tommy. The fix is in, release coming shortly. |
Released in 0.8.149. |
Verified working in 0.8.149, thanks for the quick turnaround! |
Calling the SQS DeleteMessage operation with the receipt handle string given in a ReceiveMessage response fails with a ReceiptHandleIsInvalid error from AWS. Looking at the error message, it appears that the library is replacing the
+
signs in the handle with spaces.(By the way, thanks for this library! I have high hopes for it!)
The text was updated successfully, but these errors were encountered: