copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

copilot init application name results in invalid signature exception

Open jrothman opened this issue 6 years ago • 4 comments

image

Application name: newapp ✘ get application newapp: get application newapp: InvalidSignatureException: Signature expired: 20200709T065347Z is now earlier than 20200710T074923Z (20200710T075423Z - 5 min.) status code: 400, request id: 440a54c2-6e08-4a7b-b50a-0d8d698b6679

I received the above error directly after submitting the application name during copilot init. Note that I am running this on the Linux subsystem on Win10 (WSL2). I do notice the date-time check check is checking against a signature that is a day older then the current day (July 10 vs July 9). Is there a way to update the signature date-time?

jrothman avatar Jul 10 '20 08:07 jrothman

Hi @jrothman !

This is very interesting, I found this thread on the AWS SDK: https://github.com/aws/aws-sdk-js/issues/527 where people recommend:

Running a sync between the VM and the host cleared it up.

(https://github.com/aws/aws-sdk-js/issues/527#issuecomment-111512719) or

I encountered this issue locally, and restarting my docker daemon fixed it.

https://github.com/aws/aws-sdk-js/issues/527#issuecomment-238637510

Would you mind giving those a shot to see if it fixes your issue?

efekarakus avatar Jul 10 '20 17:07 efekarakus

Brilliant - exactly the issue: docker containers were out of sync with the host. I ran this and it fixed the issue: docker run --rm --privileged alpine hwclock -s copilot looks great!

jrothman avatar Jul 10 '20 20:07 jrothman

I'm not on a VM and have restarted the local DockerDesktop.app (restarted laptop too) Still no luck... 🤯

docker.app had an update, that didn't fix it:

> $ copilot init \                                                                           ⬡ 18.12.1 
-a portaldashboard \
-t "Load Balanced Web Service" -n django-dashboard-web \
-d ./compose/production/django/Dockerfile
Note: It's best to run this command in the root of your Git repository.
Welcome to the Copilot CLI! We're going to walk you through some questions
to help you get set up with a containerized application on AWS. An application is a collection of
containerized services that operate together.

✘ get application portaldashboard: get application portaldashboard: InvalidSignatureException: Credential should be scoped to a valid region. 
	status code: 400, request id: 48169f83-6e33-4423-9891-5eba30f45499

I was so happy when I found copilot. 😄😕

mikeumus avatar Dec 11 '22 00:12 mikeumus

What did solve the error for me (or maybe it's just a workaround), I did debug code and jumped into a method /.../botocore/client.py:_create_api_method(...) and I noticed what there're 2 parameters passed to it, one of which is 'us-west-2' and I just changed the region to that value (with os.environ['AWS_DEFAULT_REGION'] = 'us-west-2')

image

frankiedrake avatar Aug 10 '23 12:08 frankiedrake