简体   繁体   English

调用 Lambda 时出现“InvalidSignatureException: Signature expired”

[英]I get "InvalidSignatureException: Signature expired" when Lambda is invoked

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):有时,我从 Lambda 收到以下错误消息(当然时间不同):

"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.我在SQS中有重试策略,所以当错误发生时,消息返回到SQS,Lambda再次处理。 When it processes it again, the same message, it succeeds and is processed successfully.当它再次处理它时,同样的消息,它成功并处理成功。

Any idea why?知道为什么吗?

It's normal for the message to be processed successfully on the second attempt if the root cause of the "InvalidSignatureException: Signature expired" error was resolved in the meantime.如果同时解决了“InvalidSignatureException:Signature expired”错误的根本原因,第二次尝试成功处理消息是正常的。

Here are some possible reasons why the error occurred on the first attempt but not on the second:以下是错误在第一次尝试时发生但在第二次尝试时不发生的一些可能原因:

  • The system clock on the device making the request was out of sync with the current time, and this issue was resolved in the meantime.发出请求的设备上的系统时钟与当前时间不同步,同时解决了此问题。 I can also see some of the GitHub links where the issue has occurred, and it got resolved by making changes to the correctClockSkew option when constructing a service client.我还可以看到发生问题的一些 GitHub 链接,并且在构建服务客户端时通过更改correctClockSkew选项解决了这个问题。

Reference Links:参考链接:

  1. https://github.com/aws/aws-sdk-js/issues/2598 https://github.com/aws/aws-sdk-js/issues/2598
  2. https://github.com/aws/aws-sdk-js/issues/527 https://github.com/aws/aws-sdk-js/issues/527
  3. https://github.com/aws/aws-sdk-java/blob/1.11.412/aws-java-sdk-core/src/main/java/com/amazonaws/http/AmazonHttpClient.java#L1333-L1337 https://github.com/aws/aws-sdk-java/blob/1.11.412/aws-java-sdk-core/src/main/java/com/amazonaws/http/AmazonHttpClient.java#L1333-L1337
  • The request was made using a temporary security token that had expired, and this issue was resolved in the meantime.该请求是使用已过期的临时安全令牌发出的,同时此问题已得到解决。

  • There was a transient issue with the AWS infrastructure that caused the error on the first attempt, but the issue was resolved on the second attempt. AWS 基础设施存在暂时性问题,导致第一次尝试出现错误,但第二次尝试时问题得到解决。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 同步调用lambda时,如何向DLQ添加失败信息? - How to add failure messages to DLQ when lambda is invoked synchronously? 当前访问令牌已过期时,我如何获取新的访问令牌,谷歌 firebase 身份验证? - How i get new access token when current access token has expired, google firebase auth? 为什么在通过 API 网关调用时,Java 中的 AWS Lambda 代码返回“内部服务器错误”? - why does this AWS Lambda code in Java return "internal server error" when invoked via an API gateway? S3:HeadObject 从 Go lambda 调用时返回 403 响应 - S3:HeadObject returns 403 response when invoked from Go lambda 为什么在使用 quarkus-amazon-lambda 和 quarkus-smallrye-openapi 包时会出现错误? - Why do I get an error when using quarkus-amazon-lambda and quarkus-smallrye-openapi packages? botocore.exceptions.ClientError:调用GetItem操作时发生错误(InvalidSignatureException) - botocore.exceptions.ClientError: An error occurred (InvalidSignatureException) when calling the GetItem operation 为什么在尝试部署到 Lambda@Edge 时出现“执行角色必须是可承担的”错误? - Why do I get 'execution role must be assumable' error when trying to deploy to Lambda@Edge? AWS Lambda 使用调用的凭证为 S3 创建预签名的 URL - AWS Lambda create presigned URL for S3 using invoked credentials 创建lambda时如何获取cloudformation创建的角色 - How to get at the role created by cloudformation when creating a lambda 在 cloudwatch 中创建日志组时,如何触发 lambda? - How can I trigger a lambda when a log group is created in cloudwatch?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM