Amplify Init - InvalidSignatureException: Signature not yet current

1k Views Asked by At

Encountered and solved this problem. Posting for posterity since my situation differed from the usual.

Important: I am running a derivative of Ubuntu in a VirtualBox VM on a freshly installed Windows host.

The Problem

When creating a new react amplify project using create-react-app, amplify init fails with an InvalidSignatureException after selecting a profile:

$ amplify init
...
For more information on AWS Profiles, see:
https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html

? Please choose the profile you want to use default

InvalidSignatureException: Signature not yet current: 20220528T081112Z is still later than 20220528T051608Z (20220528T051108Z + 5 min.)
    at Object.extractError (/snapshot/node_modules/aws-sdk/lib/protocol/json.js:52:27)
    at Request.extractError (/snapshot/node_modules/aws-sdk/lib/protocol/rest_json.js:49:8)
    at Request.callListeners (/snapshot/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/snapshot/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
...
    at IncomingMessage.EventEmitter.emit (domain.js:483:12)
    at endReadableNT (_stream_readable.js:1241:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  code: 'InvalidSignatureException',
  time: 2022-05-28T08:11:12.872Z,
  requestId: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
  statusCode: 403,
  retryable: false,
  retryDelay: 35.74742577991159
}

I also experienced errors with amplify push and amplify pull complaining about things such as "Time skew" and "Timeouts", and AWS Console threw "List apps call failed: Network Error".

Similar Posts

Here are a sample of posts discussing similar problems.

'amplify init' keeps failing

https://github.com/aws-amplify/amplify-js/issues/2014

https://github.com/concourse/s3-resource/issues/34

https://github.com/aws-amplify/amplify-hosting/issues/2417

Failed ideas

Sample of failed ideas:
  • I tried creating a second project to see if problem persisted. It did.
  • I tried syncing my time via ntp, ntpdate, ntpd. Same error.
  • I tried setting time via GUI. Failed to set. Same error.

Story leading to solution

At this point, I noticed my time occasionally jumps on sync with ntpd. Actual time was 01:40; on sync, it jump to 04:40, then back to 01:40. This would occur intermittently on sync. Timezones were set correctly. Trial and error exhausts my ideas, so I return to my host. Host time is 01:40, but discord messages are timestamping at 10:40. Wait.

1

There are 1 best solutions below

0
On

Windows host timezone was set to UTC-8:00 Pacific Time. VirtualBox Linux guest was set to UTC-5:00 Eastern Time. Oddly, both were displaying 01:40.

Steps to resolve

  1. Set host timezone to UTC-5:00 Eastern Time
  2. Sync Clock in "Time and Date" settings in Windows
  3. Disable/uninstall ntp from Linux guest

Issue was resolved. amplify init succeeded.