Comments (3)
Hi @shakefu
Firstly I want to thank you for providing the config - this was incredibly helpful.
It is clear to me that the crash comes from this line:
https://github.com/hashicorp/terraform/blob/e0fd3ddd704b230897723a7ca251f36b71c2b67a/helper/schema/field_reader_config.go#L170
which still exists today in the current SDK in the same form and shape:
I was able to reproduce it under 0.11.14
. It can be triggered by setting any map field (such as tags
in your config) to a list.
Terraform 0.12 (with HCL2) validates configuration very early on, before the provider (SDK) lines are even executed. The SDK will therefore always receive valid HCL2 configuration from 0.12 which should not cause such crash.
Here is output from terraform apply
(w/ Terraform 0.12.0) which doesn't crash anymore and instead returns human-readable error:
$ terraform apply
Error: Incorrect attribute value type
on main.tf line 12, in resource "aws_route53_zone" "vpc":
12: tags = ["${var.tags}"]
Inappropriate value for attribute "tags": map of string required.
I will therefore conclude that this bug is fixed in 0.12 and users can upgrade to any 0.12 version.
from terraform-plugin-sdk.
Thanks for the report.
Clipping out the relevant part of crash log:
panic: interface conversion: interface {} is string, not map[string]interface {}
2018-01-30T14:01:12.649-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4:
2018-01-30T14:01:12.649-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: goroutine 145 [running]:
2018-01-30T14:01:12.649-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*ConfigFieldReader).readMap(0xc4208bf800, 0x34f81dc, 0x4, 0xc420b63a40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
2018-01-30T14:01:12.649-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/field_reader_config.go:170 +0xfb3
2018-01-30T14:01:12.649-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*ConfigFieldReader).readField(0xc4208bf800, 0xc4202cba80, 0x1, 0x1, 0xc420180f00, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
2018-01-30T14:01:12.649-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/field_reader_config.go:113 +0xd72
2018-01-30T14:01:12.649-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*ConfigFieldReader).ReadField(0xc4208bf800, 0xc4202cba80, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
2018-01-30T14:01:12.649-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/field_reader_config.go:27 +0x110
2018-01-30T14:01:12.649-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*MultiLevelFieldReader).ReadFieldExact(0xc4205d6380, 0xc4202cba80, 0x1, 0x1, 0x34f9c48, 0x6, 0x0, 0x0, 0x0, 0x0, ...)
2018-01-30T14:01:12.649-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/field_reader_multi.go:31 +0x12e
2018-01-30T14:01:12.649-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*ResourceData).get(0xc42060d7a0, 0xc4202cba80, 0x1, 0x1, 0xc4202cba12, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
2018-01-30T14:01:12.649-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/resource_data.go:497 +0x16e
2018-01-30T14:01:12.649-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*ResourceData).getChange(0xc42060d7a0, 0x34f81dc, 0x4, 0x1011201, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
2018-01-30T14:01:12.649-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/resource_data.go:473 +0x135
2018-01-30T14:01:12.649-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*ResourceData).diffChange(0xc42060d7a0, 0x34f81dc, 0x4, 0x34f6f55, 0x1, 0xc4204fd2b8, 0x5, 0xc4204fd2a0)
2018-01-30T14:01:12.649-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/resource_data.go:450 +0xa5
2018-01-30T14:01:12.650-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.schemaMap.diffMap(0xc420861560, 0x34f81dc, 0x4, 0xc420b63a40, 0xc42080b610, 0x4fec000, 0xc42060d7a0, 0x1029100, 0x35914b0, 0xc42004a618)
2018-01-30T14:01:12.650-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/schema.go:932 +0x115
2018-01-30T14:01:12.650-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.schemaMap.diff(0xc420861560, 0x34f81dc, 0x4, 0xc420b63a40, 0xc4205d6280, 0x4fec000, 0xc42060d7a0, 0x756ea1bb759700, 0x10, 0xca4cf4bf0980aa8b)
2018-01-30T14:01:12.650-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/schema.go:778 +0x593
2018-01-30T14:01:12.650-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.schemaMap.Diff(0xc420861560, 0xc420823b30, 0xc4208bf530, 0x0, 0x30fe7e0, 0xc4201bc500, 0xc42004aa18, 0xc42004aa20, 0xc4204f1514)
2018-01-30T14:01:12.650-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/schema.go:424 +0x24a
2018-01-30T14:01:12.650-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*Resource).Diff(0xc420b30e00, 0xc420823b30, 0xc4208bf530, 0x30fe7e0, 0xc4201bc500, 0x1, 0xc4208bf5f0, 0xc4208bf5f0)
2018-01-30T14:01:12.650-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/resource.go:252 +0x187
2018-01-30T14:01:12.650-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*Provider).Diff(0xc42060c540, 0xc420823ae0, 0xc420823b30, 0xc4208bf530, 0x5e9d000, 0x0, 0x18)
2018-01-30T14:01:12.650-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/provider.go:296 +0xa4
2018-01-30T14:01:12.650-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/plugin.(*ResourceProviderServer).Diff(0xc420876100, 0xc420887d20, 0xc4202cb9f0, 0x0, 0x0)
2018-01-30T14:01:12.650-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/plugin/resource_provider.go:538 +0x57
2018-01-30T14:01:12.650-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: reflect.Value.call(0xc4203c4720, 0xc420180188, 0x13, 0x34f7a78, 0x4, 0xc42004af20, 0x3, 0x3, 0x0, 0x0, ...)
2018-01-30T14:01:12.650-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: /usr/local/go/src/reflect/value.go:434 +0x905
2018-01-30T14:01:12.650-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: reflect.Value.Call(0xc4203c4720, 0xc420180188, 0x13, 0xc4203adf20, 0x3, 0x3, 0xc4203a3ce0, 0xc4203a3da0, 0xc4202c26e0)
2018-01-30T14:01:12.650-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: /usr/local/go/src/reflect/value.go:302 +0xa4
2018-01-30T14:01:12.650-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: net/rpc.(*service).call(0xc4208d2100, 0xc420822000, 0xc4205d2140, 0xc420820200, 0xc4208761c0, 0x2c730e0, 0xc420887d20, 0x16, 0x2c73120, 0xc4202cb9f0, ...)
2018-01-30T14:01:12.650-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: /usr/local/go/src/net/rpc/server.go:381 +0x142
2018-01-30T14:01:12.650-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: created by net/rpc.(*Server).ServeCodec
2018-01-30T14:01:12.650-0800 [DEBUG] plugin.terraform-provider-aws_v1.8.0_x4: /usr/local/go/src/net/rpc/server.go:475 +0x36b
from terraform-plugin-sdk.
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
from terraform-plugin-sdk.
Related Issues (20)
- Behaviour of `terraform providers schema` command for computed fields HOT 4
- `diff.GetOk` return `nil` for the value of `TypeList` defined in `TypeSet` HOT 1
- Not Helpful Err When Running Tests For Provider HOT 4
- Unsupported Field Type for Resource
- TypeSet resource wanting to destroy and recreate everything when diff is found HOT 2
- losing precision when using maximum value for a 64-bit signed integer
- helper/schema: Provide Functionality to Reduce Resident Memory Usage from Schemas HOT 1
- Consider Method for Disabling Legacy SDK Data Consistency Warning Log Demotion HOT 7
- Updates for Protocol Version 5.4 HOT 1
- Value out of range on 32-bit architecture HOT 3
- Update Go Module to Go 1.20 Minimum HOT 1
- `Schema.Set` adds an empty value when attempting to Patch HOT 1
- `meta.SDKVersion` reporting incorrect version HOT 6
- Terraform CloudFormation Multi Region Stacksets HOT 3
- Is it possible to have a dependency between 2 attributes? HOT 2
- `schema.ResourceData.GetRaw<whatever>()` not populated during provider configuration HOT 3
- Consider Migrating from mitchellh/mapstructure to go-viper/mapstructure
- Low performance in deduplicate strings function HOT 4
- ForceNew doesn't trigger resource recreation when defined on TypeSet, which leads to Update error HOT 1
- helper/resource: Add Go Deprecation Messages That Point To terraform-plugin-testing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-plugin-sdk.