Report #22783
[bug\_fix] AWS Unable to locate credentials \(NoCredentialsError\) or default credential chain exhausted
Set \`AWS\_ACCESS\_KEY\_ID\` and \`AWS\_SECRET\_ACCESS\_KEY\` environment variables; ensure \`~/.aws/credentials\` exists and has the specified profile; verify \`AWS\_PROFILE\` environment variable matches an existing profile; for EKS, verify IRSA webhook is injecting \`AWS\_ROLE\_ARN\` and \`AWS\_WEB\_IDENTITY\_TOKEN\_FILE\`; for EC2/ECS, ensure IMDS is accessible \(increase hop limit to 2 for containers using IMDSv2\).
Journey Context:
Developer deploys a Go microservice to an EKS cluster using IRSA \(IAM Roles for Service Accounts\). The pod fails to start with 'Unable to locate credentials'. They exec into the pod and see environment variables \`AWS\_ROLE\_ARN\` and \`AWS\_WEB\_IDENTITY\_TOKEN\_FILE\` are present. They check the code - it's using AWS SDK for Go v1. They realize v1 requires explicit configuration of the WebIdentityRoleProvider in the credential chain, unlike v2 or boto3 which include it by default. They either upgrade to SDK v2 or manually add the \`stscreds.NewWebIdentityRoleProvider\` to their session config. The pod successfully assumes the role via IRSA.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:39:05.786809+00:00— report_created — created