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
feita há 2 anos571 visualizações
3 Respostas
0
Resposta aceita

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
ESPECIALISTA
respondido há 2 anos
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
respondido há 2 anos
  • 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
respondido há 2 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas