-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Crash when importing aws_spot_fleet_request #13567
Comments
Relevant code:
|
In the acceptance tests (e.g. <DescribeSpotFleetRequestsResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
<requestId>e2b6b2b2-821c-48a5-a761-6aee39be1e87</requestId>
<spotFleetRequestConfigSet>
<item>
<activityStatus>pending_fulfillment</activityStatus>
<createTime>2020-06-01T13:48:28.705Z</createTime>
<spotFleetRequestConfig>
<allocationStrategy>lowestPrice</allocationStrategy>
<clientToken>terraform-20200601134817201100000002</clientToken>
<excessCapacityTerminationPolicy>Default</excessCapacityTerminationPolicy>
<fulfilledCapacity>0.0</fulfilledCapacity>
<iamFleetRole>arn:aws:iam::123456789012:role/rs6rguqo3t</iamFleetRole>
<instanceInterruptionBehavior>stop</instanceInterruptionBehavior>
<instancePoolsToUseCount>1</instancePoolsToUseCount>
<launchSpecifications>
<item>
<ebsOptimized>false</ebsOptimized>
<iamInstanceProfile>
<name/>
</iamInstanceProfile>
<imageId>ami-516b9131</imageId>
<instanceType>m1.small</instanceType>
<keyName>rs6rguqo3t</keyName>
<monitoring>
<enabled>false</enabled>
</monitoring>
<placement>
<availabilityZone/>
<tenancy/>
</placement>
<spotPrice/>
<subnetId/>
<userData/>
</item>
</launchSpecifications>
<onDemandAllocationStrategy>lowestPrice</onDemandAllocationStrategy>
<onDemandFulfilledCapacity>0.0</onDemandFulfilledCapacity>
<onDemandTargetCapacity>0</onDemandTargetCapacity>
<replaceUnhealthyInstances>false</replaceUnhealthyInstances>
<spotPrice>0.005</spotPrice>
<targetCapacity>2</targetCapacity>
<terminateInstancesWithExpiration>true</terminateInstancesWithExpiration>
<type>maintain</type>
<validUntil>2020-06-02T13:48:05.000Z</validUntil>
</spotFleetRequestConfig>
<spotFleetRequestId>sfr-9bd21fcc-a727-437a-8f6a-e7f969d31c30</spotFleetRequestId>
<spotFleetRequestState>active</spotFleetRequestState>
</item>
</spotFleetRequestConfigSet>
</DescribeSpotFleetRequestsResponse> whereas in the linked gist, the whole This is because when the resource is created the placement block is present (but with empty strings):
The solution is to check for |
Terraform crashed for me too when refreshing spot fleet request state. This happened with aws provider 2.64.0. Rolled it back to 2.57.0 and things worked without a hitch. |
The fix for this has been merged and will release with version 2.68.0 of the Terraform AWS Provider, likely tomorrow. Thanks to @ewbankkit for the investigation and fix implementation. 👍 |
This has been released in version 2.68.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
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! |
Terraform Version
Terraform Configuration Files
Debug Output
Crash Output
https://gist.github.com/aniaptebsft/eeec63169393a4475c9c8d2cd35a8c14
Expected Behavior
TF shouldn't have crashed, it should have imported the spot fleet request.
Actual Behavior
Terraform crashed, below are the top few lines of the crash
panic: interface conversion: interface {} is nil, not string 2020-06-01T08:38:18.956Z [DEBUG] plugin.terraform-provider-aws_v2.64.0_x4: 2020-06-01T08:38:18.956Z [DEBUG] plugin.terraform-provider-aws_v2.64.0_x4: goroutine 69 [running]: 2020-06-01T08:38:18.956Z [DEBUG] plugin.terraform-provider-aws_v2.64.0_x4: github.com/terraform-providers/terraform-provider-aws/aws.hashLaunchSpecification(0x4d37480, 0xc0009669c0, 0x1) 2020-06-01T08:38:18.956Z [DEBUG] plugin.terraform-provider-aws_v2.64.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_spot_fleet_request.go:1610 +0x6d9 2020-06-01T08:38:18.956Z [DEBUG] plugin.terraform-provider-aws_v2.64.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Set).hash(0xc000c99040, 0x4d37480, 0xc0009669c0, 0x417ae13, 0x4d37480) 2020-06-01T08:38:18.956Z [DEBUG] plugin.terraform-provider-aws_v2.64.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/set.go:254 +0x3d 2020-06-01T08:38:18.956Z [DEBUG] plugin.terraform-provider-aws_v2.64.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Set).add(0xc000c99040, 0x4d37480, 0xc0009669c0, 0xc00092f900, 0x0, 0x0) 2020-06-01T08:38:18.956Z [DEBUG] plugin.terraform-provider-aws_v2.64.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/set.go:231 +0x83 2020-06-01T08:38:18.956Z [DEBUG] plugin.terraform-provider-aws_v2.64.0_x4: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Set).Add(...) 2020-06-01T08:38:18.957Z [DEBUG] plugin.terraform-provider-aws_v2.64.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform-plugin-sdk/helper/schema/set.go:75 2020-06-01T08:38:18.957Z [DEBUG] plugin.terraform-provider-aws_v2.64.0_x4: github.com/terraform-providers/terraform-provider-aws/aws.launchSpecsToSet(0xc000921740, 0xc, 0xc, 0xc000a484f0, 0xc000eb2400, 0x0, 0x0) 2020-06-01T08:38:18.957Z [DEBUG] plugin.terraform-provider-aws_v2.64.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_spot_fleet_request.go:1276 +0x7b 2020-06-01T08:38:18.957Z [DEBUG] plugin.terraform-provider-aws_v2.64.0_x4: github.com/terraform-providers/terraform-provider-aws/aws.resourceAwsSpotFleetRequestRead(0xc000cd89a0, 0x4f27dc0, 0xc000140f00, 0xc000cd89a0, 0x0) 2020-06-01T08:38:18.957Z [DEBUG] plugin.terraform-provider-aws_v2.64.0_x4: /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_spot_fleet_request.go:1193 +0x43f
Steps to Reproduce
terraform init
terraform import aws_spot_fleet_request.fleet sfr-XXX
Additional Context
None
References
None
The text was updated successfully, but these errors were encountered: