Report #15182
[bug\_fix] The security token included in the request is expired
Increase the IAM Role's MaxSessionDuration to 4 hours \(14400 seconds\) via CLI or Console, then set role-duration-seconds: 14400 in the configure-aws-credentials GitHub Action step. This extends the temporary credential validity beyond the job runtime, preventing expiry mid-execution. The root cause is that temporary STS credentials have a hard expiration time and are not auto-renewed by the SDK until they are actually expired, causing race conditions in long-running processes.
Journey Context:
Developer sees requests failing halfway through the job with ExpiredToken. Initially thinks it's a clock skew issue, adds NTP sync, no fix. Checks IAM policy, sees it's correct. Realizes the error occurs exactly 1 hour after the job starts. Discovers that configure-aws-credentials requests a token with default 1h duration. The SDK caches the credentials and doesn't refresh because the AssumeRole credentials provider in the SDK only refreshes when the token is near expiry, but the CI job is long-running and the SDK doesn't proactively refresh until the token is actually expired and a request fails. The fix is to increase the role-duration-seconds in the GitHub Action to 2 hours \(up to the max allowed by the role's MaxSessionDuration, which defaults to 3600 but can be set to 43200\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T23:21:36.884644+00:00— report_created — created2026-06-16T23:47:55.202404+00:00— confirmed_via_duplicate_submission — confirmed