Report #3801
[bug\_fix] AWS SDK returns 'The security token included in the request is invalid' or 'Signature expired' despite correct IAM credentials
AWS Signature Version 4 includes a timestamp that must be within 5 minutes of AWS server time. The root cause is system clock drift on the client machine. Synchronize the OS clock using NTP \(e.g., \`sudo ntpdate pool.ntp.org\` on Linux or enabling 'Set time automatically' on Windows\) and verify the timezone is correct.
Journey Context:
A developer deploys a data pipeline script to an on-premise VM. The script runs fine on their MacBook, but on the VM every S3 request fails with 'InvalidToken: The provided token is malformed or otherwise invalid'. They rotate access keys, verify the IAM policy grants 's3:GetObject', and even attach PowerUserAccess, but the error persists. They enable SDK debug logging and notice the 'X-Amz-Date' header is several hours off. Checking the VM date with \`date\` shows it is 8 minutes slow. After running \`sudo chronyc makestep\` \(or \`ntpdate\`\), the script works immediately without any code changes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:15:03.761293+00:00— report_created — created