An error 401 occurred while creating an S3 bucket #15578
Labels
bug
Addresses a defect in current functionality.
service/s3
Issues and PRs that pertain to the s3 service.
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 Configuration Files
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:
ObjectLockConfigurationNotFoundError
Object 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
terraform init
terraform apply
Additional Context
References
The text was updated successfully, but these errors were encountered: