aws-sdk-net: Aws Lambda getting Signature expired when try to access SimpleSystemsManagement

Hello,

I have a Lambda that accesses an API Gateway, which triggers a second Lambda, and this second Lambda tries to retrieve some information from SSM.

Expected Behavior

I was expecting the second Lambda to get the information successfully.

Current Behavior

Eventually and intermittently it fails with a Signature expired exception. This is the second Lambda stack error:

[Error 4eadcd85-2a3c-ea11-8218-00155d930efa ] Signature expired: 20200121T084217Z is now earlier than 20200121T084217Z (20200121T084717Z - 5 min.) Amazon.SimpleSystemsManagement.AmazonSimpleSystemsManagementException: Signature expired: 20200121T084217Z is now earlier than 20200121T084217Z (20200121T084717Z - 5 min.) —> Amazon.Runtime.Internal.HttpErrorResponseException: Exception of type ‘Amazon.Runtime.Internal.HttpErrorResponseException’ was thrown. at Amazon.Runtime.HttpWebRequestMessage.GetResponseAsync(CancellationToken cancellationToken) at Amazon.Runtime.Internal.HttpHandler`1.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.Unmarshaller.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.ErrorHandler.InvokeAsync[T](IExecutionContext executionContext) — End of inner exception stack trace — at Amazon.Runtime.Internal.HttpErrorResponseExceptionHandler.HandleException(IExecutionContext executionContext, HttpErrorResponseException exception) at Amazon.Runtime.Internal.ErrorHandler.ProcessException(IExecutionContext executionContext, Exception exception) at Amazon.Runtime.Internal.ErrorHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.EndpointDiscoveryHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.EndpointDiscoveryHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.CredentialsRetriever.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.RetryHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.RetryHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.ErrorCallbackHandler.InvokeAsync[T](IExecutionContext executionContext) at Amazon.Runtime.Internal.MetricsHandler.InvokeAsync[T](IExecutionContext executionContext)

I have a retry implemented in the first Lambda so that it retries again and eventually (for this specific situation, after 4 times) it works.

Possible Solution

I guess this is something related to Clockscrew but I have no idea how to figure out that.

Steps to Reproduce (for bugs)

Unfortunately, basic of the intermittence I couldn’t reproduce it.

Context

I have some alerts for Lambdas. Whenever we get an issue reported in logs, we are alerted. As this is not something that we can fix, it is causing us to treat it as a false-positive alert but we still get time to investigate and find the issue reported.

Your Environment

  • AWSSDK.Core version used: The most up to date available
  • Service assembly and version used: Lambda and Amazon SimpleSystemsManagement
  • Operating System and version: The Lambda one
  • Visual Studio version: VS Professional 2019
  • Targeted .NET platform: 2.1

.NET Core Info

  • .NET Core version used for development: 2.1

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 21 (4 by maintainers)

Commits related to this issue

Most upvoted comments

We contacted AWS Premium support and we were advised to use ResignRetries parameter. Since then, we have no more issues. I’m not sure if that’s an acceptable solution for this issue. If so, I’m happy to close it.

Hi I wrote a lambda function which fetches csv as dataframe from s3 and return a concatenated dataframe which needs to be uploaded back to s3. But i got this error “Calling the invoke API action failed with this message: Signature expired: 20200417T062349Z is now earlier than 20200417T063349Z (20200417T063849Z - 5 min.)”

My basic setting : Timeout 15 min ,Memory 256 MB . I searched in google and found time sync can resolve this issue. It would be great if someone provides detailed steps or another solution to the problem.

Thanks, Abhishek

I am experiencing the same issue. Every 30 minutes to an hour it happens. My gut feeling is that it is related to garbage collection. I think that the GC thread uses the time in an older request, which has time expired.

I got .net core 2.1 package deployed in aws lambda.

Also, I read on other thread that “Signature expired: 20200417T062349Z is now earlier than 20200417T063349Z (20200417T063849Z - 5 min.)” is due to the server clock out of sync. However, first of all we can not the lambda container’s system time. And, based on my debugging, this may not be the case in the above situation.

Currently experiencing the same exact thing on transnational processing using SQS with lambdas. My current theory is that it has to do with latecy between talking to AWS services from the sdk. We are making calls to dynamo, sqs, and iot.

I spent several hours on a chat with AWS business support and they recommended me wrap all calls to external services with logs so you can find the high latency calls and adjust.

But this was just the theory we came up with.

Hi ,I tried with increasing time out to max 15 mins and ram allocation  to 512 mb. This worked for me as my code execution time was on higher side . Hope it helps .Thanks On Jun 6, 2020 1:45 AM, Damir Ainullin notifications@github.com wrote: I also have this issue in Lambda function on getting configuration parameters from SSM. We use .net core 3.1. Seems like it happens exaclty after 30 minutes of lambda-instance running. “exceptions”: [ { “Depth”: 0, “ClassName”: “Amazon.SimpleSystemsManagement.AmazonSimpleSystemsManagementException”, “Message”: “Signature expired: 20200605T190617Z is now earlier than 20200605T190617Z (20200605T191117Z - 5 min.)”, “Source”: “AWSSDK.Core”, “StackTrace”: [ " at Amazon.Runtime.Internal.HttpErrorResponseExceptionHandler.HandleException(IExecutionContext executionContext, HttpErrorResponseException exception)“, " at Amazon.Runtime.Internal.ExceptionHandler1.Handle(IExecutionContext executionContext, Exception exception)", " at Amazon.Runtime.Internal.ErrorHandler.ProcessException(IExecutionContext executionContext, Exception exception)", " at Amazon.Runtime.Internal.ErrorHandler.InvokeAsync[T](IExecutionContext executionContext)", " at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext)", " at Amazon.Runtime.Internal.EndpointDiscoveryHandler.InvokeAsync[T](IExecutionContext executionContext)", " at Amazon.Runtime.Internal.EndpointDiscoveryHandler.InvokeAsync[T](IExecutionContext executionContext)", " at Amazon.Runtime.Internal.CredentialsRetriever.InvokeAsync[T](IExecutionContext executionContext)", " at Amazon.Runtime.Internal.RetryHandler.InvokeAsync[T](IExecutionContext executionContext)", " at Amazon.Runtime.Internal.RetryHandler.InvokeAsync[T](IExecutionContext executionContext)", " at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext)", " at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext)", " at Amazon.Runtime.Internal.ErrorCallbackHandler.InvokeAsync[T](IExecutionContext executionContext)", " at Amazon.Runtime.Internal.MetricsHandler.InvokeAsync[T](IExecutionContext executionContext)", " at Amazon.Extensions.Configuration.SystemsManager.Internal.SystemsManagerProcessor.GetParametersByPathAsync()", " at Amazon.Extensions.Configuration.SystemsManager.Internal.SystemsManagerProcessor.GetDataAsync()", " at Amazon.Extensions.Configuration.SystemsManager.SystemsManagerConfigurationProvider.LoadAsync(Boolean reload)" ], "RemoteStackTrace": [ " at Amazon.Runtime.Internal.HttpErrorResponseExceptionHandler.HandleException(IExecutionContext executionContext, HttpErrorResponseException exception)", " at Amazon.Runtime.Internal.ExceptionHandler1.Handle(IExecutionContext executionContext, Exception exception)”, " at Amazon.Runtime.Internal.ErrorHandler.ProcessException(IExecutionContext executionContext, Exception exception)“, " at Amazon.Runtime.Internal.ErrorHandler.InvokeAsync[T](IExecutionContext executionContext)”, " at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext)“, " at Amazon.Runtime.Internal.EndpointDiscoveryHandler.InvokeAsync[T](IExecutionContext executionContext)”, " at Amazon.Runtime.Internal.EndpointDiscoveryHandler.InvokeAsync[T](IExecutionContext executionContext)“, " at Amazon.Runtime.Internal.CredentialsRetriever.InvokeAsync[T](IExecutionContext executionContext)”, " at Amazon.Runtime.Internal.RetryHandler.InvokeAsync[T](IExecutionContext executionContext)“, " at Amazon.Runtime.Internal.RetryHandler.InvokeAsync[T](IExecutionContext executionContext)”, " at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext)“, " at Amazon.Runtime.Internal.CallbackHandler.InvokeAsync[T](IExecutionContext executionContext)”, " at Amazon.Runtime.Internal.ErrorCallbackHandler.InvokeAsync[T](IExecutionContext executionContext)“, " at Amazon.Runtime.Internal.MetricsHandler.InvokeAsync[T](IExecutionContext executionContext)”, " at Amazon.Extensions.Configuration.SystemsManager.Internal.SystemsManagerProcessor.GetParametersByPathAsync()“, " at Amazon.Extensions.Configuration.SystemsManager.Internal.SystemsManagerProcessor.GetDataAsync()”, " at Amazon.Extensions.Configuration.SystemsManager.SystemsManagerConfigurationProvider.LoadAsync(Boolean reload)" ], “RemoteStackIndex”: 0, “HResult”: -2146233088, “HelpURL”: null }, { “Depth”: 1, “ClassName”: “Amazon.Runtime.Internal.HttpErrorResponseException”, “Message”: “Exception of type ‘Amazon.Runtime.Internal.HttpErrorResponseException’ was thrown.”, “Source”: “AWSSDK.Core”, “StackTrace”: [ " at Amazon.Runtime.HttpWebRequestMessage.GetResponseAsync(CancellationToken cancellationToken)“, " at Amazon.Runtime.Internal.HttpHandler1.InvokeAsync[T](IExecutionContext executionContext)", " at Amazon.Runtime.Internal.Unmarshaller.InvokeAsync[T](IExecutionContext executionContext)", " at Amazon.Runtime.Internal.ErrorHandler.InvokeAsync[T](IExecutionContext executionContext)" ], "RemoteStackTrace": [ " at Amazon.Runtime.HttpWebRequestMessage.GetResponseAsync(CancellationToken cancellationToken)", " at Amazon.Runtime.Internal.HttpHandler1.InvokeAsync[T](IExecutionContext executionContext)”, " at Amazon.Runtime.Internal.Unmarshaller.InvokeAsync[T](IExecutionContext executionContext)“, " at Amazon.Runtime.Internal.ErrorHandler.InvokeAsync[T](IExecutionContext executionContext)” ], “RemoteStackIndex”: 0, “HResult”: -2146233088, “HelpURL”: null } ]

Do you know the reason of this issue or at least any workarounds?

—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or unsubscribe.

I had the same “signature expired” using a .NET console calling an AWS service from my PC. What it worked to me was to change my local PC time using the Windows clock button “update now” from time.windows.com, setting an incorrect time -according to me- probably because of daylight saving. My clock is one hour ahead, but the application now works perfectly. Probably there are time-zone issues on your computer/server/VM.