Closed JPScutt closed 5 years ago
After looking through the panic error stack and the terraform provider code I removed the spot_options section from the terraform
instance_market_options { market_type = "spot"
**spot_options { max_price = "${var.spot_price}" }** }
var.spot_price was set to "". Reading through the aws provider code this should not be an issue
if v, ok := so["max_price"].(string); ok && v != "" { spotOptions.MaxPrice = aws.String(v) }
The error has not happened since removing that section
Relevant part of log
panic: interface conversion: interface {} is nil, not map[string]interface {}
2019-03-11T10:28:25.739Z [DEBUG] plugin.terraform-provider-aws_v2.1.0_x4:
2019-03-11T10:28:25.739Z [DEBUG] plugin.terraform-provider-aws_v2.1.0_x4: goroutine 83 [running]:
2019-03-11T10:28:25.739Z [DEBUG] plugin.terraform-provider-aws_v2.1.0_x4: github.com/terraform-providers/terraform-provider-aws/aws.readInstanceMarketOptionsFromConfig(0xc0008cf920, 0x3bd9681, 0x17, 0x2e8c200)
2019-03-11T10:28:25.739Z [DEBUG] plugin.terraform-provider-aws_v2.1.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_launch_template.go:1360 +0x808
2019-03-11T10:28:25.739Z [DEBUG] plugin.terraform-provider-aws_v2.1.0_x4: github.com/terraform-providers/terraform-provider-aws/aws.buildLaunchTemplateData(0xc00092b0a0, 0x3c80d20, 0xc000af99c8, 0x0)
2019-03-11T10:28:25.739Z [DEBUG] plugin.terraform-provider-aws_v2.1.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_launch_template.go:1071 +0x1624
2019-03-11T10:28:25.739Z [DEBUG] plugin.terraform-provider-aws_v2.1.0_x4: github.com/terraform-providers/terraform-provider-aws/aws.resourceAwsLaunchTemplateUpdate(0xc00092b0a0, 0x2e3bd20, 0xc000228c00, 0x24, 0x72db140)
2019-03-11T10:28:25.739Z [DEBUG] plugin.terraform-provider-aws_v2.1.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_launch_template.go:677 +0x1ad
2019-03-11T10:28:25.740Z [DEBUG] plugin.terraform-provider-aws_v2.1.0_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc000592fc0, 0xc00066fe50, 0xc0005355e0, 0x2e3bd20, 0xc000228c00, 0x40b801, 0xc000af9b80, 0x4c1a0c)
2019-03-11T10:28:25.740Z [DEBUG] plugin.terraform-provider-aws_v2.1.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema/resource.go:231 +0x250
2019-03-11T10:28:25.740Z [DEBUG] plugin.terraform-provider-aws_v2.1.0_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*Provider).Apply(0xc000247110, 0xc00066fe00, 0xc00066fe50, 0xc0005355e0, 0xc000056380, 0x18, 0x7fe923c836c0)
2019-03-11T10:28:25.740Z [DEBUG] plugin.terraform-provider-aws_v2.1.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-03-11T10:28:25.740Z [DEBUG] plugin.terraform-provider-aws_v2.1.0_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/plugin.(*ResourceProviderServer).Apply(0xc00031abc0, 0xc000535560, 0xc0009237d0, 0x0, 0x0)
2019-03-11T10:28:25.740Z [DEBUG] plugin.terraform-provider-aws_v2.1.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-03-11T10:28:25.740Z [DEBUG] plugin.terraform-provider-aws_v2.1.0_x4: reflect.Value.call(0xc000075080, 0xc00000c030, 0x13, 0x3b9c1f7, 0x4, 0xc000af9f18, 0x3, 0x3, 0xc0005a8480, 0xc000136700, ...)
Hi @JPScutt thanks for reporting this issue and for detailing your workaround. Looks like we might need a nil check or two in place.
Hi @JPScutt - any chance you'd be able to test this using the most recent version of the AWS provider? I've so far been unable to reproduce this on 2.11.0 or 2.10.0, but if you're still seeing it on those versions that will be a good data point for us to start digging into more. Thanks!
Hey @JPScutt - I was just able to reproduce this crash on 2.11.0 so probably no need to test on your end if you haven't already - I'll continue looking into this now. Thanks!
Okay, it was on the list to look at today so saved me a job.
Thanks
On Mon, May 20, 2019 at 12:38 PM Ryn Daniels notifications@github.com wrote:
Hey @JPScutt https://github.com/JPScutt - I was just able to reproduce this crash on 2.11.0 so probably no need to test on your end if you haven't already - I'll continue looking into this now. Thanks!
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/terraform-providers/terraform-provider-aws/issues/7885?email_source=notifications&email_token=AHXFILJEXP4JKICJCIFXS3TPWKEOFA5CNFSM4G5BNUNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVYRGZY#issuecomment-493949799, or mute the thread https://github.com/notifications/unsubscribe-auth/AHXFILLOFY4YFXCYKBHT3FDPWKEOFANCNFSM4G5BNUNA .
--
Jonathan Scutt Platform Engineer Direct: +44 (0)1285 853235 jonathan.scutt@iress.co.uk
Office: +44 (0)345 068 1000
Jessop House, Jessop Avenue
Cheltenham, GL50 3SH
www.iress.com
[image: Twitter] https://twitter.com/iressUK
[image: Youtube] https://www.youtube.com/channel/UCXXYqZvVHp0rqKYh9pJ9fbQ
[image: Linkedin] https://www.linkedin.com/company/iress/
--
Important Note This email (including any attachments) contains information which is confidential and may be subject to legal privilege. If you are not the intended recipient you must not use, distribute or copy this email. If you have received this email in error please notify the sender immediately and delete this email. Any views expressed in this email are not necessarily the views of IRESS Limited.
It is the duty of the recipient to virus scan and otherwise test the information provided before loading onto any computer system. IRESS Limited does not warrant that the information is free of a virus or any other defect or error.
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.
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!
Community Note
Terraform Version
Terraform v0.11.11 provider.aws v2.1.0
Affected Resource(s)
aws_launch_template aws_security_group
Terraform Configuration Files
Debug Output
Expected Behavior
The new auto scaling instances would successfully be created
Actual Behavior
panic
Steps to Reproduce
Issue is intermittent, 1 in 4 CI builds are successfully (with no changes made)
References
I couldn't find any.