Terraform: helper/schema: Crash while updating set in MapFieldWriter.setSet

Created on 11 May 2017  ยท  5Comments  ยท  Source: hashicorp/terraform

Terraform Version

terraform --version
Terraform v0.9.5

Affected Resource(s)

Overall it seems to happen across multiple resources but aws_launch_configuration is always included with unexpected EOF, while other resources will have a connection is shut down or the unexpected EOF error.

  • aws_launch_configuration
  • aws_autoscaling_group

Terraform Configuration Files

I will need to scrub the configuration files before posting.

Debug Output

I will need to scrub the debug output before posting.

Panic Output

https://gist.github.com/kpettijohn/82eef460a4cdf094efce08100fbba5d0

Expected Behavior

Successful plan

Actual Behavior

Crash

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform plan or terraform apply

Terraform will crash roughly 50-75% of the time when executing a plan or apply.

bug crash provider-sdk

Most helpful comment

The panic prevention fix for the Terraform Provider SDK has been merged and will release with version 0.12.0-beta2 of Terraform in the coming weeks. Terraform Providers will need to update their Terraform Provider SDK dependency to receive this fix. The new behavior is setting an empty list into the Terraform state when attempting to write a typed nil of *schema.Set for TypeSet attributes.

All 5 comments

I was also having the unexpected EOF issue on 0.9.5. I was running terraform inside a docker container with a CPU shares limit imposed on it. I was able to stop terraform from crashing by increasing the amount of CPU resources available to the docker container.

Here is the stack trace from the panic output, for easier reference:

panic: set item just set doesn't exist
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5:
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5: goroutine 552 [running]:
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5: github.com/hashicorp/terraform/helper/schema.(*MapFieldWriter).setSet(0xc421e43d80, 0xc421de72a0, 0x1, 0x1, 0x4f8de40, 0xc421ed85a0, 0xc421602780, 0x0, 0x1)
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5:   /opt/gopath/src/github.com/hashicorp/terraform/helper/schema/field_writer_map.go:302 +0x938
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5: github.com/hashicorp/terraform/helper/schema.(*MapFieldWriter).set(0xc421e43d80, 0xc421de72a0, 0x1, 0x1, 0x4f8de40, 0xc421ed8480, 0x1, 0x0)
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5:   /opt/gopath/src/github.com/hashicorp/terraform/helper/schema/field_writer_map.go:94 +0x364
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5: github.com/hashicorp/terraform/helper/schema.(*MapFieldWriter).WriteField(0xc421e43d80, 0xc421de72a0, 0x1, 0x1, 0x4f8de40, 0xc421ed8480, 0x0, 0x0)
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5:   /opt/gopath/src/github.com/hashicorp/terraform/helper/schema/field_writer_map.go:76 +0x18c
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5: github.com/hashicorp/terraform/helper/schema.(*ResourceData).Set(0xc420232310, 0x5d46bca, 0x11, 0x4f8de40, 0xc421ed8480, 0x0, 0x0)
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5:   /opt/gopath/src/github.com/hashicorp/terraform/helper/schema/resource_data.go:171 +0x143
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5: github.com/hashicorp/terraform/builtin/providers/aws.readLCBlockDevices(0xc420232310, 0xc421af2270, 0xc421a8c380, 0x4f6b900, 0xc421e44040)
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5:   /opt/gopath/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_launch_configuration.go:593 +0x281
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5: github.com/hashicorp/terraform/builtin/providers/aws.resourceAwsLaunchConfigurationRead(0xc420232310, 0x55ce500, 0xc4203d0000, 0x0, 0x8777080)
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5:   /opt/gopath/src/github.com/hashicorp/terraform/builtin/providers/aws/resource_aws_launch_configuration.go:552 +0x7bf
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5: github.com/hashicorp/terraform/helper/schema.(*Resource).Refresh(0xc4215fe000, 0xc421a2fcc0, 0x55ce500, 0xc4203d0000, 0xc4216743c8, 0xc422366101, 0xc4202ac000)
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5:   /opt/gopath/src/github.com/hashicorp/terraform/helper/schema/resource.go:314 +0x21d
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5: github.com/hashicorp/terraform/helper/schema.(*Provider).Refresh(0xc42065d180, 0xc421a2fc70, 0xc421a2fcc0, 0x9b284b0, 0x0, 0x5004a00)
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5:   /opt/gopath/src/github.com/hashicorp/terraform/helper/schema/provider.go:267 +0x91
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5: github.com/hashicorp/terraform/plugin.(*ResourceProviderServer).Refresh(0xc4215a4260, 0xc4213d0ee0, 0xc4213d14b0, 0x0, 0x0)
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5:   /opt/gopath/src/github.com/hashicorp/terraform/plugin/resource_provider.go:510 +0x4e
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5: reflect.Value.call(0xc4207b52c0, 0xc42121ab40, 0x13, 0x5d0d1f4, 0x4, 0xc421b73f20, 0x3, 0x3, 0xe, 0x0, ...)
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5:   /opt/go/src/reflect/value.go:434 +0x91f
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5: reflect.Value.Call(0xc4207b52c0, 0xc42121ab40, 0x13, 0xc421992f20, 0x3, 0x3, 0x11cb0d0, 0x86e4740, 0xc421a104e0)
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5:   /opt/go/src/reflect/value.go:302 +0xa4
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5: net/rpc.(*service).call(0xc42154e2c0, 0xc42154e280, 0xc421591300, 0xc421550b00, 0xc4215a42e0, 0x4e841e0, 0xc4213d0ee0, 0x16, 0x4e84220, 0xc4213d14b0, ...)
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5:   /opt/go/src/net/rpc/server.go:387 +0x144
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5: created by net/rpc.(*Server).ServeCodec
2017/05/11 14:35:49 [DEBUG] plugin: terraform_v0_9_5:   /opt/go/src/net/rpc/server.go:481 +0x404

I'm also seeing this, with v0.9.6.

The panic prevention fix for the Terraform Provider SDK has been merged and will release with version 0.12.0-beta2 of Terraform in the coming weeks. Terraform Providers will need to update their Terraform Provider SDK dependency to receive this fix. The new behavior is setting an empty list into the Terraform state when attempting to write a typed nil of *schema.Set for TypeSet attributes.

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.

Was this page helpful?
0 / 5 - 0 ratings