PermanentRedirect ☁️ AWS

S3 PermanentRedirect: The bucket you are attempting to access must be addressed using the specified endpoint

The request went to the wrong S3 region/endpoint for that bucket.

Seen on: AWS

Meaning

Buckets live in one region. SDKs configured for us-east-1 talking to a bucket in eu-west-1 get PermanentRedirect (301), AuthorizationHeaderMalformed (“the region 'us-east-1' is wrong; expecting 'eu-west-1'”) or IllegalLocationConstraintException.

Common causes

  • SDK/CLI region differs from the bucket’s region
  • Hard-coded s3.amazonaws.com endpoint
  • Path-style URLs to a non-us-east-1 bucket

⚡ Quick fix

  1. Find the bucket region: aws s3api get-bucket-location
  2. Configure the client with that region
  3. Use virtual-hosted URLs with the regional endpoint

Detailed fix by platform

AWS CLI

  1. bash
    aws s3api get-bucket-location --bucket my-bucket
    aws s3 ls s3://my-bucket --region eu-west-1

Python

  1. s3 = boto3.client("s3", region_name="eu-west-1")

How to diagnose

  1. Bucket region — get-bucket-location
  2. Client region — AWS_REGION / config
  3. Endpoint — Custom endpoint URL?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.