Git Product home page Git Product logo

Comments (3)

radeksimko avatar radeksimko commented on June 13, 2024 1

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:

for ik := range innerRaw.(map[string]interface{}) {

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.

radeksimko avatar radeksimko commented on June 13, 2024

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.

 avatar commented on June 13, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.