Report #10065
[bug\_fix] AWS SSO token has expired \(TokenRefreshError / UnauthorizedOperation after period of inactivity\)
Run \`aws sso login --profile \` to refresh the SSO token in \`~/.aws/sso/cache/\`. This regenerates the non-AWS temporary token that the SDK exchanges for STS credentials. Root cause: The SSO OIDC token \(distinct from AWS credentials\) has a fixed lifetime \(default 8 hours or session length\) and is cached locally; once expired, the SDK cannot obtain new AWS access keys.
Journey Context:
A developer runs a nightly ETL job using boto3 on a local workstation configured with AWS SSO \(\`aws configure sso\`\). The job completes successfully for weeks. One morning, every S3 \`PutObject\` call fails with \`ClientError: An error occurred \(UnauthorizedOperation\) when calling the PutObject operation\`. The developer checks IAM in the console; their SSO role has \`AmazonS3FullAccess\`. They restart the script—same error. They inspect \`~/.aws/credentials\` and find it empty \(expected with SSO\). They check \`~/.aws/sso/cache/\` and find a JSON file with an \`expiresAt\` field showing yesterday’s date. They realize the SSO token itself expired, not the AWS credentials. Running \`aws sso login\` updates the cache, and the job resumes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T09:46:09.375765+00:00— report_created — created