1

I have the following architecture:

S3 ---> S3 Notification ---> SQS ---> Lambda

Sometimes, I'm getting the following error message from the Lambda (of course the times are different):

"errorType": "Runtime.UnhandledPromiseRejection" 
"errorMessage": "InvalidSignatureException: Signature expired: 20221230T132433Z is now earlier than 20221230T132603Z (20221230T133103Z - 5 min.)"

I have a retry policy in the SQS, so when the error occurs, the message returns to the SQS, and the Lambda process it again. When it processes it again, the same message, it succeeds and is processed successfully.

Any idea why?

Maor agai
  • 221
  • 1
  • 3
  • 11
  • From the looks of it, you're taking too long to send a request to lambda after creating the request. How are you invoking Lambda? – Zack Newsham Dec 30 '22 at 13:56
  • @ZackNewsham I’m invoking the Lambda through SQS. – Maor agai Dec 30 '22 at 14:18
  • 1
    Do you have any timestamps for when these events occur, specifically when SQS ingests, when Lambda is triggered, when Lambda starts up, then the same for the retry? My suspicion here is it takes longer than 5 minutes for your lambda job to cold start (possible if you're downloading large binaries, or do a lot of init work) on retry, the lambda is already started so there is no init time and it succeeds – Zack Newsham Dec 30 '22 at 14:24
  • @ZackNewsham It does not happen during a cold start. For example one of the invocations: The file was uploaded to S3 in 21:19 and the Lambda was triggered with this file in 21:19, so it is not that. – Maor agai Dec 30 '22 at 19:34

0 Answers0