Report #46721
[bug\_fix] botocore.exceptions.NoCredentialsError: Unable to locate credentials
Export the AWS\_PROFILE environment variable matching a profile defined in ~/.aws/credentials \(e.g., \`export AWS\_PROFILE=dev\`\), or run \`aws configure\` to populate the default profile. Root cause: The SDK credential provider chain exhausted all sources—environment variables, shared credential file, and EC2 instance metadata—without finding valid credentials.
Journey Context:
Developer clones a production service repo onto a fresh macOS laptop, installs AWS CLI v2 and Python dependencies, and runs the Flask server locally. It immediately crashes on the first S3 client initialization with NoCredentialsError. They check \`aws configure list\` and see '' for shared credentials. They mistakenly believe that because the app runs in ECS in production with a task role, it should work locally. They check \`~/.aws/credentials\` and find it empty, realizing they never copied their dev profile from their old machine. After running \`aws configure --profile dev\` and exporting AWS\_PROFILE=dev, the application starts because the SharedCredentialProvider now locates the \[dev\] section with valid access keys.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:53:49.125469+00:00— report_created — created