aws auth_error ai_generated true

An error occurred (ExpiredTokenException): The security token included in the request is expired

ID: aws/expired-token-exception

Also available as: JSON · Markdown
90%Fix Rate
90%Confidence
240Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
2 active

Root Cause

AWS session token has expired. Common with STS temporary credentials and SSO sessions.

generic

Workarounds

  1. 92% success Refresh credentials with aws sso login or aws sts assume-role
    aws sso login --profile my-profile

    Sources: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html

  2. 85% success Use credential_process or credential helpers for automatic refresh
    Use credential_process or credential helpers for automatic refresh

    Sources: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sourcing-external.html

Dead Ends

Common approaches that don't work:

  1. Hardcode long-lived access keys 88% fail

    Security anti-pattern, keys can leak and don't rotate

  2. Extend token lifetime to maximum 55% fail

    Only delays the problem, tokens still expire

Error Chain

Leads to:
Preceded by:
Frequently confused with: