Report #8138
[bug\_fix] The security token included in the request is expired
Refresh the temporary credentials by re-running the SSO login flow \(aws sso login\) or re-assuming the IAM Role \(aws sts assume-role\). Root cause: STS temporary credentials \(session tokens\) have a fixed lifetime \(default 1-12 hours depending on issuance method\) and the SDK does not auto-refresh them without a credential process configured.
Journey Context:
You deployed a long-running data pipeline on an EC2 instance that assumes an IAM Role via instance profile. At hour 6, all S3 writes start failing with 'ExpiredToken'. You check ~/.aws/credentials but it's empty \(as expected for instance metadata\). You check the IAM Role's MaxSessionDuration and it's set to 12 hours, but the error persists. You realize the SDK is caching the initial credentials from the EC2 metadata service \(IMDS\) and not refreshing because no credential provider chain was configured to re-fetch from IMDS. The fix is to either restart the process \(short term\) or implement a credential refresh callback that calls the EC2 metadata service before expiration.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T04:43:22.672040+00:00— report_created — created