Report #51935
[bug\_fix] RequestTimeTooSkewed: The difference between the request time and the current time is too large
AWS SDKs sign requests with a timestamp using the local system clock. AWS servers reject requests if the timestamp is more than 5 minutes \(15 minutes for some services\) away from the server time, preventing replay attacks. This error indicates the local system clock is not synchronized with NTP. The fix is to synchronize the system clock immediately using NTP \(e.g., \`sudo chronyc makestep\` or \`sudo ntpdate pool.ntp.org\`\) and ensure NTP is enabled persistently \(e.g., \`timedatectl set-ntp true\`\).
Journey Context:
Developer deploys a new microservice to an EC2 instance built from a hardened custom AMI. Immediately, all AWS SDK calls \(e.g., to DynamoDB or S3\) fail with 'RequestTimeTooSkewed'. The error message includes the request time and the server time, showing a 7-minute discrepancy. They check the instance time with the \`date\` command and confirm it is 7 minutes behind UTC. They check \`timedatectl status\` and see 'NTP enabled: no'. They realize the AMI hardening process disabled NTP services for 'security'. They consider setting the clock manually with \`date --set\`, but this won't persist. They run \`sudo chronyc makestep\` \(since chronyd is installed but not enabled\) to force an immediate sync, and the API calls immediately succeed. To prevent recurrence, they update the AMI build script to ensure \`chronyd\` is enabled and running, and add a user-data script that verifies NTP sync on boot.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T17:40:04.734024+00:00— report_created — created