Search code examples
dockercontainersaws-sdkaws-sam-cliaws-serverless

Docker/SAM local aws sdk's requests failing with (InvalidSignatureException)


Hi when trying to use aws SDK's inside of a docker container I am getting the following error

> (InvalidSignatureException) when calling the PutItem operation:
> Signature expired: 20180613T153236Z is now earlier than
> 20180614T223818Z (20180614T225318Z - 15 min.)

When I use aws cli though and default credential providers in SDK's on my local machine aws api calls are working fine though. What is going wrong inside my container?


Solution

  • This might be due to the following issue with running docker on Mac https://github.com/docker/for-mac/issues/17 where your overall docker machine agents time gets out of sync when your system goes to sleep.

    Try restarting the docker daemon on your system for quick fix. In issue post above they have some more long term fixes/suggestions