com.amazonaws.services.s3.model.AmazonS3Exception

The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'us-west-2' (Service: Amazon S3; Status Code: 400; Error Code: AuthorizationHeaderMalformed; Request ID: 261B779D23D15F6F)

Samebug tips1

Set the S3 bucket to the same region as AmazonS3Client, otherwise it just throws this exception. Check if your bucket name is correct as well.

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web216

  • The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'us-west-2' (Service: Amazon S3; Status Code: 400; Error Code: AuthorizationHeaderMalformed; Request ID: 261B779D23D15F6F)
  • via GitHub by Nazariy995
    , 4 months ago
    The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'us-east-2' (Service: Amazon S3; Status Code: 400; Error Code: AuthorizationHeaderMalformed; Request ID: 8E337C89F26EED0A)
  • via GitHub by amedeiros
    , 1 year ago
    The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'eu-central-1' (Service: Amazon S3; Status Code: 400; Error Code: AuthorizationHeaderMalformed; Request ID: REDACTED)
  • Stack trace

    • com.amazonaws.services.s3.model.AmazonS3Exception: The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'us-west-2' (Service: Amazon S3; Status Code: 400; Error Code: AuthorizationHeaderMalformed; Request ID: 261B779D23D15F6F) at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1372) at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:919) at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:697) at com.amazonaws.http.AmazonHttpClient.doExecute(AmazonHttpClient.java:449) at com.amazonaws.http.AmazonHttpClient.executeWithTimer(AmazonHttpClient.java:411) at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:360) at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:3962) at com.amazonaws.services.s3.AmazonS3Client.createBucket(AmazonS3Client.java:908) at com.amazonaws.services.s3.AmazonS3Client.createBucket(AmazonS3Client.java:855) at com.zently.modules.AmazonS3ComponentImpl.<init>(AmazonS3Component.java:42)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown user
    Once, 1 year ago
    2 times, 6 days ago
    3 times, 1 month ago
    48 times, 1 month ago
    Once, 4 months ago
    50 more bugmates