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

S3 bucket creations fails in eu-north-1 (due to GET /?accelerate= HTTP/1.1 failure) #6853

Closed
jylitalo opened this issue Dec 14, 2018 · 7 comments · Fixed by #6873
Closed
Labels
service/s3 Issues and PRs that pertain to the s3 service.
Milestone

Comments

@jylitalo
Copy link
Contributor

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.11.10
plugin.terraform-provider-aws_v1.52.0_x4

Affected Resource(s)

  • aws_s3_bucket

Terraform Configuration Files

provider "aws" {
  region = "eu-north-1"
}

resource "aws_s3_bucket" "s3_bucket" {
  bucket = "github-bug-report-13413"
  acl    = "private"

  tags {
    "cost_center" = "infra"
    "environment" = "tmp"
  }
}

Debug Output

2018-12-14T09:31:18.796+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: ---[ REQUEST POST-SIGN ]-----------------------------
2018-12-14T09:31:18.796+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: GET /?accelerate= HTTP/1.1
2018-12-14T09:31:18.796+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: Host: github-bug-report-13413.s3.eu-north-1.amazonaws.com
2018-12-14T09:31:18.796+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: User-Agent: aws-sdk-go/1.16.4 (go1.11.1; darwin; amd64) APN/1.0 HashiCorp/1.0 Terraform/0.11.9-beta1
2018-12-14T09:31:18.796+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: Authorization: AWS4-HMAC-SHA256 Credential=.../20181214/eu-north-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date;x-amz-security-token, Signature=...
2018-12-14T09:31:18.796+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: X-Amz-Content-Sha256: ...
2018-12-14T09:31:18.796+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: X-Amz-Date: 20181214T073118Z
2018-12-14T09:31:18.796+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: X-Amz-Security-Token: ...
2018-12-14T09:31:18.796+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: Accept-Encoding: gzip
2018-12-14T09:31:18.796+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4:
2018-12-14T09:31:18.796+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4:
2018-12-14T09:31:18.796+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: -----------------------------------------------------
2018-12-14T09:31:18.899+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: 2018/12/14 09:31:18 [DEBUG] [aws-sdk-go] DEBUG: Response s3/GetBucketAccelerateConfiguration Details:
2018-12-14T09:31:18.899+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: ---[ RESPONSE ]--------------------------------------
2018-12-14T09:31:18.899+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: HTTP/1.1 405 Method Not Allowed
2018-12-14T09:31:18.899+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: Connection: close
2018-12-14T09:31:18.899+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: Transfer-Encoding: chunked
2018-12-14T09:31:18.899+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: Content-Type: application/xml
2018-12-14T09:31:18.899+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: Date: Fri, 14 Dec 2018 07:31:18 GMT
2018-12-14T09:31:18.899+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: Server: AmazonS3
2018-12-14T09:31:18.899+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: X-Amz-Id-2: ...
2018-12-14T09:31:18.899+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: X-Amz-Request-Id: A9B0901E3BD97EC9
2018-12-14T09:31:18.899+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4:
2018-12-14T09:31:18.899+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4:
2018-12-14T09:31:18.899+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: -----------------------------------------------------
2018-12-14T09:31:18.899+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: 2018/12/14 09:31:18 [DEBUG] [aws-sdk-go] <?xml version="1.0" encoding="UTF-8"?>
2018-12-14T09:31:18.899+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: <Error><Code>MethodNotAllowed</Code><Message>The specified method is not allowed against this resource.</Message><Method>GET</Method><ResourceType>accelerate</ResourceType><RequestId>A9B0901E3BD97EC9</RequestId><HostId>...</HostId></Error>
2018-12-14T09:31:18.899+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: 2018/12/14 09:31:18 [DEBUG] [aws-sdk-go] DEBUG: Validate Response s3/GetBucketAccelerateConfiguration failed, not retrying, error MethodNotAllowed: The specified method is not allowed against this resource.
2018-12-14T09:31:18.899+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: 	status code: 405, request id: A9B0901E3BD97EC9, host id: ...
2018/12/14 09:31:18 [ERROR] root: eval: *terraform.EvalRefresh, err: aws_s3_bucket.s3_bucket: error getting S3 Bucket acceleration configuration: MethodNotAllowed: The specified method is not allowed against this resource.
	status code: 405, request id: A9B0901E3BD97EC9, host id: ...
2018/12/14 09:31:18 [ERROR] root: eval: *terraform.EvalSequence, err: aws_s3_bucket.s3_bucket: error getting S3 Bucket acceleration configuration: MethodNotAllowed: The specified method is not allowed against this resource.
	status code: 405, request id: A9B0901E3BD97EC9, host id: ...
2018/12/14 09:31:18 [TRACE] [walkRefresh] Exiting eval tree: aws_s3_bucket.s3_bucket

2018/12/14 09:31:18 [DEBUG] plugin: waiting for all plugin processes to complete...
Error: Error refreshing state: 1 error(s) occurred:

* aws_s3_bucket.s3_bucket: 1 error(s) occurred:

2018-12-14T09:31:18.900+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: 2018/12/14 09:31:18 [ERR] plugin: plugin server: accept unix /var/folders/4s/nnq6mn7s25l3p3j3z806hnqc0000gn/T/plugin161200758: use of closed network connection
2018-12-14T09:31:18.900+0200 [DEBUG] plugin.terraform-provider-aws_v1.52.0_x4: 2018/12/14 09:31:18 [ERR] plugin: stream copy 'stderr' error: stream closed
* aws_s3_bucket.s3_bucket: aws_s3_bucket.s3_bucket: error getting S3 Bucket acceleration configuration: MethodNotAllowed: The specified method is not allowed against this resource.
	status code: 405, request id: A9B0901E3BD97EC9, host id: ...


2018-12-14T09:31:18.903+0200 [DEBUG] plugin: plugin process exited: path=/private/var/folders/4s/nnq6mn7s25l3p3j3z806hnqc0000gn/T/tf_tmp_test_20181214-86451-9csxdz/.terraform/plugins/darwin_amd64/terraform-provider-aws_v1.52.0_x4
DEBUG: Failed to execute `terraform apply` (1)
FATAL: Failed to execute `terraform apply` (1)

Expected Behavior

Create S3 bucket without errors.

Actual Behavior

S3 bucket is successfully created, but apparently something that happens immediately afterwards fails.

Steps to Reproduce

  1. terraform apply

Important Factoids

At least some other things like Lambda creation seems to work without any issues on Stockholm region.

@sbrustad
Copy link

Could this be a bug not related to terraform's aws provider?

image

The error message shows up in the console if you try to open the transfer acceleration menu, regardless of whether you select enabled or suspended.

@jylitalo
Copy link
Contributor Author

Quite possible, since I don't get same problem with eu-west-1 for example.
Unfortunately, BucketAccelerateConfiguration is something that you can't skip, when you create S3 bucket with Terraform.

@bflad
Copy link
Contributor

bflad commented Dec 17, 2018

In general, we permit the Terraform AWS provider resources to skip certain "allowed" errors of missing functionality of other AWS regions/development environments (e.g. LocalStack) during reading. MethodNotAllowed is an example of one of those errors we can skip. This is pretty common when working with AWS GovCloud/China, but surprising to see within AWS Commercial itself. We should continue to passthrough errors if you try to enable bucket acceleration during creation/update and the region does not support it.

I have submitted #6873 to update the resource to skip that error on read, which enables eu-north-1 S3 bucket functionality.

@bflad bflad added this to the v1.53.0 milestone Dec 19, 2018
@bflad
Copy link
Contributor

bflad commented Dec 19, 2018

The update for the aws_s3_bucket resource to bypass the MethodNotAllowed error during read for missing S3 Bucket Acceleration functionality has been merged and will release with version 1.53.0 of the AWS provider, likely tomorrow. 👍

@bflad
Copy link
Contributor

bflad commented Dec 20, 2018

This has been released in version 1.53.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@jylitalo
Copy link
Contributor Author

Now it works. Big thanks to @bflad ! 👍

@ghost
Copy link

ghost commented Apr 1, 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 and limited conversation to collaborators Apr 1, 2020
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
3 participants