Python Lambda AWS Parameters and Secrets Lambda Extension timeout randomly

0

Hi, I have set up a Python 3.10 Lambda that has attached Secret Layer and NO VPC attached.

  • The timeout time is 20 seconds
  • The execution normally takes 1-3seconds
  • All Secret Layer variables aren't set, so the default

I have noticed that randomly (1 in ~10) the execution timeout. I have enabled the PARAMETERS_SECRETS_EXTENSION_LOG_LEVEL to DEBUG and checked in CloudWatch logs:

[AWS Parameters and Secrets Lambda Extension] 2023/05/24 14:35:16 INFO ready to serve traffic
[AWS Parameters and Secrets Lambda Extension] 2023/05/24 14:35:16 DEBUG Caching secret with key /secretsmanager
2023-05-24T14:35:36.156Z b6b0... Task timed out after 20.05 seconds

Normally after the DEBUG Caching secret with key /secretsmanager... line, the source code is executed and the function succeds. But in some cases the source code doesn't even start , so I can't write any logs inside because it doesn't get there

Any help is appreacited,

2개 답변
0

Assuming that you are using the AWS SDK, there are three reasons why retry and timeout issues occur when invoking a Lambda function with an AWS SDK:

A remote API is unreachable or takes too long to respond to an API call. The API call doesn't get a response within the socket timeout. The API call doesn't get a response within the Lambda function's timeout period.

For more information, please look at the following URL:

https://repost.aws/knowledge-center/lambda-function-retry-timeout-sdk

Please inform me if my answer was satisfactory by accepting my response with an up-vote.

AWS
ART
답변함 일 년 전
  • I'm not using the AWS SDK

    I'm abstracting the call using the Lambda Layer

0

Please take a look at the following resolution:

https://repost.aws/knowledge-center/lambda-troubleshoot-invocation-timeouts

Please inform me if my answer was satisfactory by accepting my response with an up-vote.

AWS
ART
답변함 일 년 전
  • I haven't been able to debug the error with any of the options there. Thanks anyways for the idea

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠