Report #5397
[bug\_fix] AWS RequestExpired: Request has expired. Timestamp date is different than the server date.
Synchronize the system clock to within 5 minutes of AWS server time using NTP \(e.g., \`chronyc\` or \`ntpdate\`\). Root cause: AWS Signature Version 4 embeds the request timestamp in the credential scope; if local system time diverges >5 minutes from AWS time, the signature is rejected as expired to prevent replay attacks.
Journey Context:
Developer deploys a Python Lambda function locally using SAM CLI with \`sam local invoke\`. The function uses boto3 to call S3. Suddenly, every request fails with 'Request has expired' even though credentials are correct. Developer checks IAM policies, rotates keys, and verifies internet connectivity. After 30 minutes of confusion, they notice the Docker container's system date is set to 2022 \(host hibernation issue\). Once they sync the host clock and restart Docker, the error vanishes. The fix works because AWS SigV4 calculates signature expiry based on the 'X-Amz-Date' header; if the client clock is skewed, the calculated signature appears expired to AWS servers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T21:12:57.139406+00:00— report_created — created