Report #75607
[bug\_fix] AWS SDK returns 'SignatureDoesNotMatch' or 'RequestTimeTooSkewed' when calling S3 or other services
Synchronize the system clock using NTP \(e.g., 'sudo ntpdate pool.ntp.org' or 'sudo systemctl restart chronyd'\) and verify the timezone configuration matches the expected region; ensure the system time is within 5 minutes of UTC.
Journey Context:
The developer runs a script using boto3 \(AWS SDK for Python\) to upload a file to S3. It fails with 'botocore.exceptions.ClientError: An error occurred \(RequestTimeTooSkewed\) when calling the PutObject operation: The difference between the request time and the current time is too large.' Alternatively, they see 'SignatureDoesNotMatch'. The developer checks the S3 bucket policy and IAM permissions, which appear correct. They retry the request and notice the error persists. Checking the system time with 'date', they realize the VM's clock is 7 hours behind UTC because the timezone was set incorrectly and NTP was disabled. AWS Signature Version 4 includes a 'Date' or 'X-Amz-Date' header derived from the client's system time. AWS servers validate that this timestamp is within 5 minutes \(300 seconds\) of the server time to prevent replay attacks. If the client clock is skewed, the signature calculated by the client uses the wrong time, causing 'SignatureDoesNotMatch', or the server rejects it outright as 'RequestTimeTooSkewed'. Synchronizing the clock ensures the 'X-Amz-Date' header is valid, allowing the signature to match and the request to proceed.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T09:30:32.126325+00:00— report_created — created