Report #8561
[bug\_fix] PermanentRedirect: The bucket you are attempting to access must be addressed using the specified endpoint
Configure the SDK client with the correct region \(e.g., \`region\_name='us-west-2'\`\) corresponding to the bucket's actual location, or use the region-agnostic \`us-east-1\` endpoint for global bucket operations. Root cause: S3 bucket names are globally unique but buckets live in a specific region. When you send a request to the wrong regional endpoint \(e.g., \`s3.us-east-1.amazonaws.com\` for a bucket in \`eu-west-1\`\), S3 returns a 301 redirect with the correct endpoint, but many SDKs treat this as an error rather than following it for auth/signature reasons.
Journey Context:
A developer writes a Python script using \`boto3\` to list objects in a legacy S3 bucket named \`company-backups-2015\`. They initialize the client with \`boto3.client\('s3', region\_name='us-east-1'\)\` because that's the default in their company's standard config. When they run \`list\_objects\_v2\(Bucket='company-backups-2015'\)\`, they get a \`PermanentRedirect\` exception with a message to use \`s3.eu-west-1.amazonaws.com\`. The developer initially thinks it's a permission issue and checks the IAM policy, which allows \`s3:\*\` on the bucket. They enable debug logging and see the HTTP 301 redirect response in the logs. They realize the SDK is not following the redirect because the signature is calculated for the original region; following a redirect to a different region would invalidate the signature. The developer SSHs into the EC2 instance and runs \`aws s3api get-bucket-location --bucket company-backups-2015\`, which returns \`eu-west-1\`. They realize the bucket was created by a European team years ago. They update the script to use \`region\_name='eu-west-1'\` and the call succeeds. The fix works because S3 enforces that API requests for a bucket must go to the regional endpoint where the bucket resides; the 301 redirect is an auth/geo-location check that SDKs surface as an error rather than automatically following due to signature validation requirements.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T05:47:52.854678+00:00— report_created — created