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

Error unexpected EOF occurs when filter, prefix, tags are missing in aws_s3_bucket_metric #8344

Closed
ghost opened this issue Apr 16, 2019 · 4 comments · Fixed by #8852
Closed
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

@ghost
Copy link

ghost commented Apr 16, 2019

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


Terraform Version

Terraform v0.11.13
+ provider.aws v1.60.0
+ provider.null v2.1.1
+ provider.template v2.1.1

Terraform Configuration Files

resource aws_s3_bucket_metric bucket-metric-prefix-root {
  bucket = "${aws_s3_bucket.bucket.bucket}"
  name = "prefix-root"
}

Debug Output

Crash Output

Expected Behavior

According to s3_bucket_metric document, filter argument is optional. filter should be ok to be absent. Further, prefix and tags configurations under filter argument are both optional. It should allow filter argument to be empty.

Since AWS S3 allows empty prefix / tags, it makes sense to support empty string in prefix and tags under filter argument.

Actual Behavior

* aws_s3_bucket_metric.bucket-metric-prefix-root: 1 error(s) occurred:

* aws_s3_bucket_metric.bucket-metric-prefix-root: unexpected EOF 

Steps to Reproduce

terraform init
terraform plan
terraform apply

Additional Context

I have a workaround by putting prefix = "/" under filter, S3 metric filter will be created and becomes empty finally.

The Terraform command was executed directly from MacOS 10.14.4 with Bash shell 5.0.

References

@papalagichen
Copy link

Turn on TF_LOG

panic: interface conversion: interface {} is nil, not map[string]interface {}
2019-04-16T17:29:23.269-0700 [DEBUG] plugin.terraform-provider-aws_v1.60.0_x4: 
2019-04-16T17:29:23.269-0700 [DEBUG] plugin.terraform-provider-aws_v1.60.0_x4: goroutine 52 [running]:
2019-04-16T17:29:23.269-0700 [DEBUG] plugin.terraform-provider-aws_v1.60.0_x4: github.com/terraform-providers/terraform-provider-aws/aws.resourceAwsS3BucketMetricPut(0xc00064a230, 0x408f060, 0xc0003c0800, 0xc00064a230, 0x0)
2019-04-16T17:29:23.269-0700 [DEBUG] plugin.terraform-provider-aws_v1.60.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_s3_bucket_metric.go:65 +0x624
2019-04-16T17:29:23.269-0700 [DEBUG] plugin.terraform-provider-aws_v1.60.0_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc0005564d0, 0xc0007440a0, 0xc000157ee0, 0x408f060, 0xc0003c0800, 0x100b601, 0xc0003dcb80, 0x10bddbc)
2019-04-16T17:29:23.269-0700 [DEBUG] plugin.terraform-provider-aws_v1.60.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/resource.go:225 +0x351
2019-04-16T17:29:23.269-0700 [DEBUG] plugin.terraform-provider-aws_v1.60.0_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*Provider).Apply(0xc000608620, 0xc000744050, 0xc0007440a0, 0xc000157ee0, 0xc000086400, 0x18, 0x9701b00)
2019-04-16T17:29:23.269-0700 [DEBUG] plugin.terraform-provider-aws_v1.60.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/provider.go:283 +0x9c
2019-04-16T17:29:23.269-0700 [DEBUG] plugin.terraform-provider-aws_v1.60.0_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/plugin.(*ResourceProviderServer).Apply(0xc000156d00, 0xc0001574c0, 0xc000676290, 0x0, 0x0)
2019-04-16T17:29:23.269-0700 [DEBUG] plugin.terraform-provider-aws_v1.60.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/plugin/resource_provider.go:527 +0x57
2019-04-16T17:29:23.269-0700 [DEBUG] plugin.terraform-provider-aws_v1.60.0_x4: reflect.Value.call(0xc0001741e0, 0xc0000b2d30, 0x13, 0x477008d, 0x4, 0xc0003dcf18, 0x3, 0x3, 0xc00028d800, 0xc0000b8fc0, ...)
2019-04-16T17:29:23.269-0700 [DEBUG] plugin.terraform-provider-aws_v1.60.0_x4: 	/opt/goenv/versions/1.11.5/src/reflect/value.go:447 +0x454
2019-04-16T17:29:23.269-0700 [DEBUG] plugin.terraform-provider-aws_v1.60.0_x4: reflect.Value.Call(0xc0001741e0, 0xc0000b2d30, 0x13, 0xc000b71718, 0x3, 0x3, 0xc000326b60, 0xc000326b20, 0xc000326ae0)
2019-04-16T17:29:23.269-0700 [DEBUG] plugin.terraform-provider-aws_v1.60.0_x4: 	/opt/goenv/versions/1.11.5/src/reflect/value.go:308 +0xa4
2019-04-16T17:29:23.269-0700 [DEBUG] plugin.terraform-provider-aws_v1.60.0_x4: net/rpc.(*service).call(0xc0003ce140, 0xc0003320a0, 0xc0004b2138, 0xc0004b2160, 0xc000192480, 0xc0003d08a0, 0x3a260c0, 0xc0001574c0, 0x16, 0x3a26100, ...)
2019-04-16T17:29:23.269-0700 [DEBUG] plugin.terraform-provider-aws_v1.60.0_x4: 	/opt/goenv/versions/1.11.5/src/net/rpc/server.go:384 +0x14e
2019-04-16T17:29:23.269-0700 [DEBUG] plugin.terraform-provider-aws_v1.60.0_x4: created by net/rpc.(*Server).ServeCodec
2019-04-16T17:29:23.269-0700 [DEBUG] plugin.terraform-provider-aws_v1.60.0_x4: 	/opt/goenv/versions/1.11.5/src/net/rpc/server.go:481 +0x47e
2019/04/16 17:29:23 [TRACE] root: eval: *terraform.EvalWriteState
2019/04/16 17:29:23 [TRACE] root: eval: *terraform.EvalApplyProvisioners
2019/04/16 17:29:23 [TRACE] root: eval: *terraform.EvalIf
2019/04/16 17:29:23 [TRACE] root: eval: *terraform.EvalWriteState
2019/04/16 17:29:23 [TRACE] root: eval: *terraform.EvalWriteDiff
2019/04/16 17:29:23 [TRACE] root: eval: *terraform.EvalApplyPost
2019/04/16 17:29:23 [ERROR] root: eval: *terraform.EvalApplyPost, err: 1 error(s) occurred:

* aws_s3_bucket_metric.enigma-so-graph-metric-prefix-root: unexpected EOF
2019/04/16 17:29:23 [ERROR] root: eval: *terraform.EvalSequence, err: 1 error(s) occurred:

* aws_s3_bucket_metric.enigma-so-graph-metric-prefix-root: unexpected EOF
2019/04/16 17:29:23 [TRACE] [walkApply] Exiting eval tree: aws_s3_bucket_metric.enigma-so-graph-metric-prefix-root

@nywilken nywilken added bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. labels Apr 17, 2019
@nywilken
Copy link
Contributor

nywilken commented Apr 17, 2019

Relevant part from the crash log

panic: interface conversion: interface {} is nil, not map[string]interface {}
2019-04-16T17:29:23.269-0700 [DEBUG] plugin.terraform-provider-aws_v1.60.0_x4: 
2019-04-16T17:29:23.269-0700 [DEBUG] plugin.terraform-provider-aws_v1.60.0_x4: goroutine 52 [running]:
2019-04-16T17:29:23.269-0700 [DEBUG] plugin.terraform-provider-aws_v1.60.0_x4: github.com/terraform-providers/terraform-provider-aws/aws.resourceAwsS3BucketMetricPut(0xc00064a230, 0x408f060, 0xc0003c0800, 0xc00064a230, 0x0)
2019-04-16T17:29:23.269-0700 [DEBUG] plugin.terraform-provider-aws_v1.60.0_x4: 	/opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_s3_bucket_metric.go:65

@bflad
Copy link
Contributor

bflad commented Jun 7, 2019

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

@ghost
Copy link
Author

ghost commented Nov 3, 2019

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 Nov 3, 2019
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
Development

Successfully merging a pull request may close this issue.

4 participants