How do I keep the time in sync in docker based lambda functions

0

I have a lambda using a container based off of the public.ecr.aws/lambda/python:3.9 image and the time is getting out of sync over time. What do I need to install and run so the time gets synced from amazon.pool.ntp.org?

  • Are you using x86 or arm64 for your Lambda function?

hb2638
질문됨 2년 전567회 조회
3개 답변
0
수락된 답변

It's not clear from the error message which is the timestamp for "now" and which is the timestamp in the signature. Is it possible that the request signature was generated when the function was created; and because the function has been warm for a while that signature has expired? If so, that's not time drift; it means that you'll need to regenerate the signature before calling the service.

profile pictureAWS
전문가
답변함 2년 전
0

As a Lambda function runs for 15 minutes maximum, this does not seem a real issue to me. Seems even difficult to notice this. How did you notice the drift?

rik2803
답변함 2년 전
  • I got an error making a boto3 call --> botocore.exceptions.ClientError: An error occurred (InvalidSignatureException) when calling the PutLogEvents operation: Signature expired: 20220211T120131Z is now earlier than 20220211T120138Z (20220211T120638Z - 5 min.)

    Also, the lambda doesn't get killed off immediately, it sticks around for an unspecified amount of time to service additional requests. This is to avoid/reduce the number of cold starts.

0

Didn't provide enough info of this but this error was occurring from a Lambda Extension we wrote and this error was a result of a race condition where the extension was "frozen" by AWS between lambda invocations.... and it got frozen after signing a AWS request but before actually sending it out.

hb2638
답변함 2년 전

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

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

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

관련 콘텐츠