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-replication configuration rules: Error: rpc error: code = Unavailable desc = transport is closing #12480

Closed
jlsan92 opened this issue Mar 19, 2020 · 5 comments · Fixed by #12614
Assignees
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/s3 Issues and PRs that pertain to the s3 service.
Milestone

Comments

@jlsan92
Copy link

jlsan92 commented Mar 19, 2020

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 other comments that do not add relevant new information or questions, 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

v0.12.21

Affected Resource(s)

  • aws_s3_bucket

Terraform Configuration Files

module "my-bucket" {
  source  = "terraform-aws-modules/s3-bucket/aws"
  version = "1.5.0"

  bucket = var.my-bucket-name

  replication_configuration = {
    role = "arn:aws:iam::123456789:role/replication-role"

    rules = [{
      id       = "replication"
      status   = "Enabled"
      priority = 1

      destination = {
        bucket        = var.destination-bucket-arn
        storage_class = "GLACIER"
        account_id    = "987654321"
        access_control_translation = {
          owner = "Destination"
        }
      }
    }]
  }
}

Debug Output

Panic Output

 module.my-bucket.aws_s3_bucket.this[0]: Modifying... [id=my-bucket]
 Error: rpc error: code = Canceled desc = context canceled
 Error: rpc error: code = Unavailable desc = transport is closing
 !!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
 Terraform crashed! This is always indicative of a bug within Terraform.
 A crash log has been placed at "crash.log" relative to your current
 working directory. It would be immensely helpful if you could please
 report the crash with Terraform[1] so that we can fix this.
 When reporting bugs, please include your terraform version. That
 information is available on the first line of crash.log. You can also
 get it by running 'terraform --version' on the command line.
 SECURITY WARNING: the "crash.log" file that was created may contain 
 sensitive information that must be redacted before it is safe to share 
 on the issue tracker.
 [1]: https://github.com/hashicorp/terraform/issues
 !!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
 panic: interface conversion: interface {} is nil, not map[string]interface {}
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: goroutine 128 [running]:
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: github.com/terraform-providers/terraform-provider-aws/aws.rulesHash(0x0, 0x0, 0x0)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_s3_bucket.go:2374 +0x8b8
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Set).hash(0xc000e93c20, 0x0, 0x0, 0xc000f00000, 0x0)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/set.go:221 +0x3d
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Set).add(0xc000e93c20, 0x0, 0x0, 0xc000878800, 0x0, 0xc000a81500)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/set.go:198 +0x83
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*ConfigFieldReader).readSet(0xc000d609f0, 0xc000d618f0, 0x3, 0x3, 0xc0008788c0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/field_reader_config.go:309 +0x329
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*ConfigFieldReader).readField(0xc000d609f0, 0xc000d618f0, 0x3, 0x3, 0xc00007ca01, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/field_reader_config.go:132 +0x97f
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*nestedConfigFieldReader).ReadField(0xc0005c5e10, 0xc000d618f0, 0x3, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/field_reader_config.go:352 +0x8e
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.readObjectField(0x6156e00, 0xc0005c5e10, 0xc000e93b60, 0x2, 0x2, 0xc000d16600, 0x0, 0x0, 0x0, 0x0, ...)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/field_reader.go:244 +0x1fc
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*ConfigFieldReader).readField(0xc000d609f0, 0xc000e93b60, 0x2, 0x2, 0xc00007ca01, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/field_reader_config.go:134 +0x8c7
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*nestedConfigFieldReader).ReadField(0xc0005c5e00, 0xc000e93b60, 0x2, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/field_reader_config.go:352 +0x8e
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.readListField(0x6156e00, 0xc0005c5e00, 0xc000885b20, 0x1, 0x1, 0xc000878640, 0x0, 0x0, 0x0, 0x0, ...)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/field_reader.go:211 +0x340
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*ConfigFieldReader).readField(0xc000d609f0, 0xc000885b20, 0x1, 0x1, 0xc0008b6800, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/field_reader_config.go:128 +0x60f
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*ConfigFieldReader).ReadField(0xc000d609f0, 0xc000885b20, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0004ff4c0, ...)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/field_reader_config.go:28 +0xae
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*MultiLevelFieldReader).ReadFieldExact(0xc000e93620, 0xc000885b20, 0x1, 0x1, 0x5845b96, 0x6, 0x0, 0x0, 0x0, 0x0, ...)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/field_reader_multi.go:31 +0xd0
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*ResourceData).get(0xc0002f2e00, 0xc000885b20, 0x1, 0x1, 0x12, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/resource_data.go:540 +0xfa
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*ResourceData).getChange(0xc0002f2e00, 0x58993e2, 0x19, 0xc000e71201, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/resource_data.go:516 +0x122
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*ResourceData).diffChange(0xc0002f2e00, 0x58993e2, 0x19, 0xc000885a30, 0x0, 0x0, 0x585c6be, 0xc0008a9680)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/resource_data.go:493 +0x97
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.schemaMap.diffList(0xc000d16330, 0x58993e2, 0x19, 0xc000878640, 0xc0008cf4b8, 0x6208800, 0xc0002f2e00, 0x42d200, 0x0, 0x0)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/schema.go:958 +0x66
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.schemaMap.diff(0xc000d16330, 0x58993e2, 0x19, 0xc000878640, 0xc000e93520, 0x6208800, 0xc0002f2e00, 0xc0008a2000, 0x0, 0x0)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/schema.go:919 +0x464
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.schemaMap.Diff(0xc000d16330, 0xc000f1b9a0, 0xc000d41680, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x8020102)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/schema.go:500 +0x215
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.diffFromValues(0x61f3960, 0xc0005c4ef8, 0x4bafae0, 0xc000ad28d0, 0x61f3960, 0xc0005c5188, 0x4bafae0, 0xc000cf67e0, 0xc000f0ae00, 0x0, ...)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/shims.go:38 +0x13b
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.DiffFromValues(...)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/shims.go:19
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc000602b08, 0x61f2ca0, 0xc000984cf0, 0xc000d52780, 0xc000602b08, 0xc000984cf0, 0xc000a2aa80)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin/grpc_provider.go:838 +0x1135
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x5708680, 0xc000602b08, 0x61f2ca0, 0xc000984cf0, 0xc000d52720, 0x0, 0x61f2ca0, 0xc000984cf0, 0xc000ceac80, 0xc7f)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5/tfplugin5.pb.go:3189 +0x217
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: google.golang.org/grpc.(*Server).processUnaryRPC(0xc000402000, 0x6213480, 0xc000547380, 0xc000166a00, 0xc000290c30, 0x95a5060, 0x0, 0x0, 0x0)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/google.golang.org/grpc/server.go:995 +0x460
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: google.golang.org/grpc.(*Server).handleStream(0xc000402000, 0x6213480, 0xc000547380, 0xc000166a00, 0x0)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/google.golang.org/grpc/server.go:1275 +0xd97
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc000654280, 0xc000402000, 0x6213480, 0xc000547380, 0xc000166a00)
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/google.golang.org/grpc/server.go:710 +0xbb
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: created by google.golang.org/grpc.(*Server).serveStreams.func1
 2020-03-19T12:02:01.111Z [DEBUG] plugin.terraform-provider-aws_v2.51.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/google.golang.org/grpc/server.go:708 +0xa1
 2020-03-19T12:02:01.113Z [DEBUG] plugin: plugin process exited: path=/my-path/.terraform/plugins/linux_amd64/terraform-provider-aws_v2.51.0_x4 pid=142 error="exit status 2"
 2020/03/19 12:02:01 [DEBUG] module.my-bucket.aws_s3_bucket.this[0]: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing
 2020/03/19 12:02:01 [TRACE] module.my-bucket: eval: *terraform.EvalMaybeTainted
 2020/03/19 12:02:01 [TRACE] module.my-bucket: eval: *terraform.EvalWriteState
 2020/03/19 12:02:01 [TRACE] EvalWriteState: recording 0 dependencies for module.my-bucket.aws_s3_bucket.this[0]
 2020/03/19 12:02:01 [TRACE] EvalWriteState: writing current state object for module.my-bucket.aws_s3_bucket.this[0]
 2020/03/19 12:02:01 [TRACE] module.my-bucket: eval: *terraform.EvalApplyProvisioners
 2020/03/19 12:02:01 [TRACE] EvalApplyProvisioners: aws_s3_bucket.this[0] is not freshly-created, so no provisioning is required
 2020/03/19 12:02:01 [TRACE] module.my-bucket: eval: *terraform.EvalMaybeTainted
 2020/03/19 12:02:01 [TRACE] module.my-bucket: eval: *terraform.EvalWriteState
 2020/03/19 12:02:01 [TRACE] EvalWriteState: recording 0 dependencies for module.my-bucket.aws_s3_bucket.this[0]
 2020/03/19 12:02:01 [TRACE] EvalWriteState: writing current state object for module.my-bucket.aws_s3_bucket.this[0]
 2020/03/19 12:02:01 [TRACE] module.my-bucket: eval: *terraform.EvalIf
 2020/03/19 12:02:01 [TRACE] module.my-bucket: eval: *terraform.EvalIf
 2020/03/19 12:02:01 [TRACE] module.my-bucket: eval: *terraform.EvalWriteDiff
 2020/03/19 12:02:01 [TRACE] module.my-bucket: eval: *terraform.EvalApplyPost
 2020/03/19 12:02:01 [ERROR] module.my-bucket: eval: *terraform.EvalApplyPost, err: rpc error: code = Unavailable desc = transport is closing
 2020/03/19 12:02:01 [ERROR] module.my-bucket: eval: *terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing
 2020/03/19 12:02:01 [TRACE] [walkApply] Exiting eval tree: module.my-bucket.aws_s3_bucket.this[0]
 2020/03/19 12:02:01 [TRACE] vertex "module.my-bucket.aws_s3_bucket.this[0]": visit complete
 2020/03/19 12:02:01 [TRACE] module.my-bucket: eval: *terraform.EvalSequence
 2020/03/19 12:02:01 [TRACE] module.my-bucket: eval: *terraform.EvalGetProvider
 2020/03/19 12:02:01 [TRACE] module.my-bucket: eval: *terraform.EvalReadDiff
 2020/03/19 12:02:01 [TRACE] EvalReadDiff: Read Update change from plan for module.my-bucket.aws_s3_bucket.this[0]
 2020/03/19 12:02:01 [TRACE] module.my-bucket: eval: *terraform.EvalIf
 2020/03/19 12:02:01 [TRACE] module.my-bucket: eval: terraform.EvalNoop
 2020/03/19 12:02:01 [TRACE] module.my-bucket: eval: *terraform.EvalIf
 2020/03/19 12:02:01 [TRACE] module.my-bucket: eval: *terraform.EvalReadState
 2020/03/19 12:02:01 [TRACE] EvalReadState: reading state for module.my-bucket.aws_s3_bucket.this[0]
 2020/03/19 12:02:01 [TRACE] UpgradeResourceState: schema version of module.my-bucket.aws_s3_bucket.this[0] is still 0; calling provider "registry.terraform.io/-/aws" for any other minor fixups
 2020/03/19 12:02:01 [TRACE] GRPCProvider: UpgradeResourceState
 2020/03/19 12:02:01 [ERROR] module.my-bucket: eval: *terraform.EvalReadState, err: rpc error: code = Canceled desc = context canceled
 2020/03/19 12:02:01 [ERROR] module.my-bucket: eval: *terraform.EvalSequence, err: rpc error: code = Canceled desc = context canceled
 2020/03/19 12:02:01 [TRACE] [walkApply] Exiting eval tree: module.my-bucket.aws_s3_bucket.this[0]
 2020/03/19 12:02:01 [TRACE] vertex "module.my-bucket.aws_s3_bucket.this[0]": visit complete
 2020/03/19 12:02:01 [TRACE] dag/walk: upstream of "meta.count-boundary (EachMode fixup)" errored, so skipping
 2020/03/19 12:02:01 [TRACE] dag/walk: upstream of "provider.aws (close)" errored, so skipping
 2020/03/19 12:02:01 [TRACE] dag/walk: upstream of "root" errored, so skipping
 2020/03/19 12:02:01 [DEBUG] Uploading remote state to S3: {
   Body: buffer(0xc0014c71a0),
   Bucket: "my-remote-state-bucket",
   ContentLength: 11590,
   ContentType: "application/json",
   Key: "tfstate",
   ServerSideEncryption: "AES256"
 }
 2020-03-19T12:02:01.330Z [DEBUG] plugin: plugin exited

Expected Behavior

The S3 bucket replication configuration gets updated.

Actual Behavior

Terraform panic crash

Steps to Reproduce

  1. terraform plan to see the weird plan result for replication rules
  2. terraform apply to see the panic error

Important Factoids

Please note that the plan before applying the changes looks weird in terms of replication rules, there's an empty rule config, probably the cause of the crash ⚠️

An execution plan has been generated and is shown below.
 Resource actions are indicated with the following symbols:
   ~ update in-place
 Terraform will perform the following actions:
   # module.my-bucket.aws_s3_bucket.this[0] will be updated in-place
   ~ resource "aws_s3_bucket" "this" {
         acl                         = "private"
         arn                         = "arn:aws:s3:::my-bucket"
         bucket                      = "my-bucket"
         bucket_domain_name          = "my-bucket.s3.amazonaws.com"
         bucket_regional_domain_name = "my-bucket.s3.us-west-1.amazonaws.com"
         force_destroy               = false
         hosted_zone_id              = "XXXXXXXXXXX"
         id                          = "my-bucket"
         region                      = "us-west-1"
         request_payer               = "BucketOwner"
         tags                        = {}
       ~ replication_configuration {
             role = "arn:aws:iam::123456789:role/replication-role"
           + rules {
               + id       = "replication"
               + priority = 1
               + status   = "Enabled"
               + destination {
                   + account_id    = "987654321"
                   + bucket        = "arn:aws:s3:::destination-bucket"
                   + storage_class = "GLACIER"
                   + access_control_translation {
                       + owner = "Destination"
                     }
                 }
             }
           - rules {
               - id       = "replication" -> null
               - priority = 1 -> null
               - status   = "Enabled" -> null
               - destination {
                   - account_id    = "987654321" -> null
                   - bucket        = "arn:aws:s3:::destination-bucket" -> null
                   - storage_class = "GLACIER" -> null
                 }
               - filter {}
             }
           + rules { # why an empty "rules" block?
             }
         }
     }
 Plan: 0 to add, 1 to change, 0 to destroy.

References

  • N/A
@ghost ghost added service/s3 Issues and PRs that pertain to the s3 service. bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. labels Mar 19, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Mar 19, 2020
@bflad bflad removed the needs-triage Waiting for first response or review from a maintainer. label Apr 1, 2020
bflad added a commit that referenced this issue Apr 1, 2020
…on blocks

Reference: #11420
Reference: #12480

This does not contain a fully reproducible configuration for #12480 after a few timeboxed attempts, but left a test that adds `access_control_translation` since that most closely mimics what was reported and was previously untested. The addition of an empty configuration block in the plan difference appears to be a bug in the Terraform Plugin SDK or Terraform core logic.

If/when these various S3 configurations are potentially moved to their own resources, we should try to remove the Set hashing functions then. Generally they are unnecessary except in specific situations.

Previously:

```
=== CONT  TestAccAWSS3Bucket_LifecycleRule_Expiration_EmptyConfigurationBlock
panic: interface conversion: interface {} is nil, not map[string]interface {}

goroutine 228 [running]:
github.com/terraform-providers/terraform-provider-aws/aws.expirationHash(0x0, 0x0, 0xc000e4bf10)
	/Users/bflad/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_s3_bucket.go:2503 +0x3d6
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Set).hash(0xc000e4bf00, 0x0, 0x0, 0x746172697078652e, 0x2e302e6e6f69)
	/Users/bflad/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.8.0/helper/schema/set.go:221 +0x3d
```

Output from acceptance testing:

```
--- PASS: TestAccAWSS3Bucket_acceleration (62.39s)
--- PASS: TestAccAWSS3Bucket_AclToGrant (62.44s)
--- PASS: TestAccAWSS3Bucket_basic (37.44s)
--- PASS: TestAccAWSS3Bucket_Bucket_EmptyString (35.25s)
--- PASS: TestAccAWSS3Bucket_Cors_Delete (30.46s)
--- PASS: TestAccAWSS3Bucket_Cors_EmptyOrigin (37.46s)
--- PASS: TestAccAWSS3Bucket_Cors_Update (64.62s)
--- PASS: TestAccAWSS3Bucket_disableDefaultEncryption_whenDefaultEncryptionIsEnabled (62.63s)
--- PASS: TestAccAWSS3Bucket_enableDefaultEncryption_whenAES256IsUsed (36.77s)
--- PASS: TestAccAWSS3Bucket_enableDefaultEncryption_whenTypical (64.54s)
--- PASS: TestAccAWSS3Bucket_forceDestroy (34.28s)
--- PASS: TestAccAWSS3Bucket_forceDestroyWithEmptyPrefixes (33.82s)
--- PASS: TestAccAWSS3Bucket_forceDestroyWithObjectLockEnabled (40.74s)
--- PASS: TestAccAWSS3Bucket_generatedName (34.28s)
--- PASS: TestAccAWSS3Bucket_GrantToAcl (55.10s)
--- PASS: TestAccAWSS3Bucket_LifecycleBasic (85.90s)
--- PASS: TestAccAWSS3Bucket_LifecycleExpireMarkerOnly (60.69s)
--- PASS: TestAccAWSS3Bucket_LifecycleRule_Expiration_EmptyConfigurationBlock (29.75s)
--- PASS: TestAccAWSS3Bucket_Logging (53.50s)
--- PASS: TestAccAWSS3Bucket_namePrefix (34.09s)
--- PASS: TestAccAWSS3Bucket_objectLock (61.56s)
--- PASS: TestAccAWSS3Bucket_Policy (88.91s)
--- PASS: TestAccAWSS3Bucket_region (35.91s)
--- PASS: TestAccAWSS3Bucket_Replication (173.40s)
--- PASS: TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AccessControlTranslation (109.21s)
--- PASS: TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AddAccessControlTranslation (87.98s)
--- PASS: TestAccAWSS3Bucket_ReplicationExpectVersioningValidationError (27.38s)
--- PASS: TestAccAWSS3Bucket_ReplicationSchemaV2 (150.14s)
--- PASS: TestAccAWSS3Bucket_ReplicationWithoutPrefix (51.20s)
--- PASS: TestAccAWSS3Bucket_ReplicationWithoutStorageClass (51.04s)
--- PASS: TestAccAWSS3Bucket_RequestPayer (61.18s)
--- PASS: TestAccAWSS3Bucket_shouldFailNotFound (17.00s)
--- PASS: TestAccAWSS3Bucket_tagsWithNoSystemTags (114.98s)
--- PASS: TestAccAWSS3Bucket_tagsWithSystemTags (148.05s)
--- PASS: TestAccAWSS3Bucket_UpdateAcl (60.53s)
--- PASS: TestAccAWSS3Bucket_UpdateGrant (90.89s)
--- PASS: TestAccAWSS3Bucket_Versioning (89.97s)
--- PASS: TestAccAWSS3Bucket_Website_Simple (89.17s)
--- PASS: TestAccAWSS3Bucket_WebsiteRedirect (89.72s)
--- PASS: TestAccAWSS3Bucket_WebsiteRoutingRules (63.15s)
```
@bflad bflad self-assigned this Apr 1, 2020
@bflad
Copy link
Member

bflad commented Apr 1, 2020

Crash fix submitted: #12614

The underlying plan difference issue with an empty rules configuration block being added is certainly bizarre, but I wasn't able to reproduce it easily. If that is still happening after this fix on the latest version of the Terraform CLI (0.12.24+), its probably worth opening a new bug report with the prior and updated configurations for reproduction. 👍

bflad added a commit that referenced this issue Apr 1, 2020
…on blocks (#12614)

Reference: #11420
Reference: #12480

This does not contain a fully reproducible configuration for #12480 after a few timeboxed attempts, but left a test that adds `access_control_translation` since that most closely mimics what was reported and was previously untested. The addition of an empty configuration block in the plan difference appears to be a bug in the Terraform Plugin SDK or Terraform core logic.

If/when these various S3 configurations are potentially moved to their own resources, we should try to remove the Set hashing functions then. Generally they are unnecessary except in specific situations.

Previously:

```
=== CONT  TestAccAWSS3Bucket_LifecycleRule_Expiration_EmptyConfigurationBlock
panic: interface conversion: interface {} is nil, not map[string]interface {}

goroutine 228 [running]:
github.com/terraform-providers/terraform-provider-aws/aws.expirationHash(0x0, 0x0, 0xc000e4bf10)
	/Users/bflad/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_s3_bucket.go:2503 +0x3d6
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Set).hash(0xc000e4bf00, 0x0, 0x0, 0x746172697078652e, 0x2e302e6e6f69)
	/Users/bflad/go/pkg/mod/github.com/hashicorp/terraform-plugin-sdk@v1.8.0/helper/schema/set.go:221 +0x3d
```

Output from acceptance testing:

```
--- PASS: TestAccAWSS3Bucket_acceleration (62.39s)
--- PASS: TestAccAWSS3Bucket_AclToGrant (62.44s)
--- PASS: TestAccAWSS3Bucket_basic (37.44s)
--- PASS: TestAccAWSS3Bucket_Bucket_EmptyString (35.25s)
--- PASS: TestAccAWSS3Bucket_Cors_Delete (30.46s)
--- PASS: TestAccAWSS3Bucket_Cors_EmptyOrigin (37.46s)
--- PASS: TestAccAWSS3Bucket_Cors_Update (64.62s)
--- PASS: TestAccAWSS3Bucket_disableDefaultEncryption_whenDefaultEncryptionIsEnabled (62.63s)
--- PASS: TestAccAWSS3Bucket_enableDefaultEncryption_whenAES256IsUsed (36.77s)
--- PASS: TestAccAWSS3Bucket_enableDefaultEncryption_whenTypical (64.54s)
--- PASS: TestAccAWSS3Bucket_forceDestroy (34.28s)
--- PASS: TestAccAWSS3Bucket_forceDestroyWithEmptyPrefixes (33.82s)
--- PASS: TestAccAWSS3Bucket_forceDestroyWithObjectLockEnabled (40.74s)
--- PASS: TestAccAWSS3Bucket_generatedName (34.28s)
--- PASS: TestAccAWSS3Bucket_GrantToAcl (55.10s)
--- PASS: TestAccAWSS3Bucket_LifecycleBasic (85.90s)
--- PASS: TestAccAWSS3Bucket_LifecycleExpireMarkerOnly (60.69s)
--- PASS: TestAccAWSS3Bucket_LifecycleRule_Expiration_EmptyConfigurationBlock (29.75s)
--- PASS: TestAccAWSS3Bucket_Logging (53.50s)
--- PASS: TestAccAWSS3Bucket_namePrefix (34.09s)
--- PASS: TestAccAWSS3Bucket_objectLock (61.56s)
--- PASS: TestAccAWSS3Bucket_Policy (88.91s)
--- PASS: TestAccAWSS3Bucket_region (35.91s)
--- PASS: TestAccAWSS3Bucket_Replication (173.40s)
--- PASS: TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AccessControlTranslation (109.21s)
--- PASS: TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AddAccessControlTranslation (87.98s)
--- PASS: TestAccAWSS3Bucket_ReplicationExpectVersioningValidationError (27.38s)
--- PASS: TestAccAWSS3Bucket_ReplicationSchemaV2 (150.14s)
--- PASS: TestAccAWSS3Bucket_ReplicationWithoutPrefix (51.20s)
--- PASS: TestAccAWSS3Bucket_ReplicationWithoutStorageClass (51.04s)
--- PASS: TestAccAWSS3Bucket_RequestPayer (61.18s)
--- PASS: TestAccAWSS3Bucket_shouldFailNotFound (17.00s)
--- PASS: TestAccAWSS3Bucket_tagsWithNoSystemTags (114.98s)
--- PASS: TestAccAWSS3Bucket_tagsWithSystemTags (148.05s)
--- PASS: TestAccAWSS3Bucket_UpdateAcl (60.53s)
--- PASS: TestAccAWSS3Bucket_UpdateGrant (90.89s)
--- PASS: TestAccAWSS3Bucket_Versioning (89.97s)
--- PASS: TestAccAWSS3Bucket_Website_Simple (89.17s)
--- PASS: TestAccAWSS3Bucket_WebsiteRedirect (89.72s)
--- PASS: TestAccAWSS3Bucket_WebsiteRoutingRules (63.15s)
```
@bflad bflad added this to the v2.56.0 milestone Apr 1, 2020
@bflad
Copy link
Member

bflad commented Apr 1, 2020

The fix mentioned above has been merged and will release with version 2.56.0 of the Terraform AWS Provider, later this week. 👍

@ghost
Copy link

ghost commented Apr 3, 2020

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

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented May 2, 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 May 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. service/s3 Issues and PRs that pertain to the s3 service.
Projects
None yet
3 participants