aws auth_error ai_generated true

An error occurred (InvalidClientTokenId): The security token is invalid

ID: aws/invalid-security-token

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

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
2 active

Root Cause

AWS credentials are wrong or expired. Common with temporary session tokens.

generic

Workarounds

  1. 90% success Check if using temporary credentials that expired; refresh with aws sts get-session-token
    Check if using temporary credentials that expired; refresh with aws sts get-session-token

    Sources: https://docs.aws.amazon.com/cli/latest/reference/sts/get-session-token.html

  2. 88% success Verify correct AWS_PROFILE is set, check ~/.aws/credentials
    aws sts get-caller-identity  # shows which identity is being used

    Sources: https://docs.aws.amazon.com/cli/latest/reference/sts/get-caller-identity.html

Dead Ends

Common approaches that don't work:

  1. Regenerate all access keys 50% fail

    May be unnecessary if it's just an expired session token

  2. Disable MFA requirement 85% fail

    Severe security downgrade, doesn't fix the token

Error Chain

Leads to:
Preceded by: