Report #5806
[bug\_fix] Signature expired: 20230101T000000Z is now earlier than 20230101T000030Z \(20230101T000530Z - 5 min.\)
AWS Signature Version 4 includes a timestamp \(X-Amz-Date\). AWS servers reject requests if the signature timestamp is more than 5 minutes \(±5 min\) different from the server clock, preventing replay attacks. The root cause is the client's system clock being out of sync with NTP. The fix is to synchronize the system clock. On Linux: \`sudo systemctl restart systemd-timesyncd\` or \`sudo ntpdate -s time.google.com\`. On Windows: \`w32tm /resync\`. For containerized environments, ensure the host VM clock is synced and the container inherits it; if not, run an NTP client in the container or mount the host's \`/etc/localtime\` and ensure chronyd runs on the host.
Journey Context:
You provisioned a new EC2 instance from a custom AMI built from a legacy on-prem VM. You install the AWS CLI and run \`aws s3 ls\`, but it fails immediately with 'Signature expired' and shows the client timestamp is 7 minutes behind the server time. You check \`date\` on the instance and confirm it is indeed 7 minutes slow. You try setting the time manually with \`sudo date -s\` but it reverts on reboot. You realize the AMI lacks NTP configuration. You install \`chrony\` \(\`sudo yum install chrony -y\`\), start the service, and force a sync \(\`chronyc makestep\`\). The clock corrects. You retry the \`aws s3 ls\` command and it succeeds because the \`X-Amz-Date\` header in the AWS Signature Version 4 request now falls within the 5-minute acceptance window on the server side.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T22:13:56.482609+00:00— report_created — created