Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error 401 occurred while creating an S3 bucket #15579

Closed
ghost opened this issue Oct 9, 2020 · 2 comments
Closed

An error 401 occurred while creating an S3 bucket #15579

ghost opened this issue Oct 9, 2020 · 2 comments
Labels
service/s3 Issues and PRs that pertain to the s3 service.

Comments

@ghost
Copy link

ghost commented Oct 9, 2020

This issue was originally opened by @Jacky-YC as hashicorp/terraform#26527. It was migrated here as a result of the provider split. The original body of the issue is below.


When I was creating the S3 bucket, an unexpected error occurred in 401, my AK/SK was the administrator!

Terraform Version

Terraform v0.13.4
+ provider registry.terraform.io/hashicorp/aws v3.8.0

Terraform Configuration Files

provider "aws" {
  region     = "cn-northwest-1"
  access_key = "xxx"
  secret_key = "xxx"
}

resource "aws_s3_bucket" "test" {
  bucket = "tf-my-test-yc"
  acl    = "private"

  versioning {
    enabled = true
  }

  tags = {
    Name        = "My bucket"
    Environment = "Dev"
  }
}

output "bucket" {
  value = aws_s3_bucket.test
}

Debug Output

2020-10-09T15:50:35.800+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe: -----------------------------------------------------
2020-10-09T15:50:35.800+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe: 2020/10/09 15:50:35 [DEBUG] [aws-sdk-go]
2020-10-09T15:50:35.800+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe: ObjectLockConfigurationNotFoundErrorObject Lock configuration does not exist for this bucketfastone-test-yc0TCXAZ6K3SDW8TFPthGIjPE9gf1zmvTIkTCAQeR3HIJLBznVi7tRFYpgi7MKMXE/LAlUphGMuxfHCyrUzWu6ojex9eY=
2020-10-09T15:50:35.800+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe: 2020/10/09 15:50:35 [DEBUG] [aws-sdk-go] DEBUG: Validate Response s3/GetObjectLockConfiguration failed, attempt 0/25, error ObjectLockConfigurationNotFoundError: Object Lock configuration does not exist for this bucket
2020-10-09T15:50:35.800+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe: status code: 404, request id: 0TCXAZ6K3SDW8TFP, host id: thGIjPE9gf1zmvTIkTCAQeR3HIJLBznVi7tRFYpgi7MKMXE/LAlUphGMuxfHCyrUzWu6ojex9eY=
2020-10-09T15:50:35.800+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe: 2020/10/09 15:50:35 [DEBUG] Waiting for state to become: [success]
2020-10-09T15:50:35.800+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe: 2020/10/09 15:50:35 [DEBUG] [aws-sdk-go] DEBUG: Request s3/HeadBucket Details:
2020-10-09T15:50:35.800+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe: ---[ REQUEST POST-SIGN ]-----------------------------
2020-10-09T15:50:35.800+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe: HEAD / HTTP/1.1
2020-10-09T15:50:35.800+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe: Host: fastone-test-yc.s3.cn-northwest-1.amazonaws.com.cn
2020-10-09T15:50:35.800+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe: User-Agent: aws-sdk-go/1.34.26 (go1.14.5; windows; amd64) APN/1.0 HashiCorp/1.0 Terraform/0.13.4 (+https://www.terraform.io)
2020-10-09T15:50:35.800+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe:
2020-10-09T15:50:35.800+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe:
2020-10-09T15:50:35.800+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe: -----------------------------------------------------
2020-10-09T15:50:36.068+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe: 2020/10/09 15:50:36 [DEBUG] [aws-sdk-go] DEBUG: Response s3/HeadBucket Details:
2020-10-09T15:50:36.069+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe: ---[ RESPONSE ]--------------------------------------
2020-10-09T15:50:36.069+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe: HTTP/1.1 401 Unauthorized
2020-10-09T15:50:36.069+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe: Connection: close
2020-10-09T15:50:36.069+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe: Transfer-Encoding: chunked
2020-10-09T15:50:36.069+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe: Content-Type: application/xml
2020-10-09T15:50:36.069+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe: Date: Fri, 09 Oct 2020 07:50:35 GMT
2020-10-09T15:50:36.069+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe: Server: AmazonS3
2020-10-09T15:50:36.069+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe: X-Amz-Id-2: nwQNmRMsx+YccazGcstBKp3DuZMBkuP7taYc23jugsdQKEjNw9x5d6Hsl+x9Wzz+XFqn2zqPtKI=
2020-10-09T15:50:36.069+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe: X-Amz-Request-Id: 2B4619AA7944B507
2020-10-09T15:50:36.069+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe:
2020-10-09T15:50:36.069+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe:
2020-10-09T15:50:36.069+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe:
2020-10-09T15:50:36.069+0800 [DEBUG] plugin.terraform-provider-aws_v3.8.0_x5.exe: -----------------------------------------------------

Crash Output

Expected Behavior

bucket = {
name="xxx"
...
}

Actual Behavior

Error: error getting S3 Bucket location: Unauthorized: Unauthorized
status code: 401, request id: 2B4619AA7944B507, host id: nwQNmRMsx+YccazGcstBKp3DuZMBkuP7taYc23jugsdQKEjNw9x5d6Hsl+x9Wzz+XFqn2zqPtKI=

Steps to Reproduce

  1. terraform init
  2. terraform apply

Additional Context

References

@ghost ghost added the service/s3 Issues and PRs that pertain to the s3 service. label Oct 9, 2020
@appilon
Copy link
Contributor

appilon commented Oct 9, 2020

Duplicate of #15578

@appilon appilon marked this as a duplicate of #15578 Oct 9, 2020
@appilon appilon closed this as completed Oct 9, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Oct 9, 2020
@ghost
Copy link
Author

ghost commented Nov 9, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Nov 9, 2020
@breathingdust breathingdust removed the needs-triage Waiting for first response or review from a maintainer. label Sep 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/s3 Issues and PRs that pertain to the s3 service.
Projects
None yet
Development

No branches or pull requests

2 participants