{"record":{"id":"261eab32277446c3","repo":"kubernetes/kops","slug":"spotinst-error-building-elastigroup-v","errorCode":null,"errorMessage":"spotinst: error building elastigroup: %v","messagePattern":"spotinst: error building elastigroup: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/awsmodel/spotinst.go","lineNumber":197,"sourceCode":"\t\t// Create both Master and Bastion instance groups as Elastigroups.\n\t\tcase kops.InstanceGroupRoleControlPlane, kops.InstanceGroupRoleBastion:\n\t\t\terr = b.buildElastigroup(c, ig)\n\n\t\t// Create Node instance groups as Elastigroups or a single Ocean with\n\t\t// multiple LaunchSpecs.\n\t\tcase kops.InstanceGroupRoleNode:\n\t\t\tif featureflag.SpotinstOcean.Enabled() {\n\t\t\t\tnodeSpotInstanceGroups = append(nodeSpotInstanceGroups, ig)\n\t\t\t} else {\n\t\t\t\terr = b.buildElastigroup(c, ig)\n\t\t\t}\n\n\t\tdefault:\n\t\t\terr = fmt.Errorf(\"spotinst: unexpected instance group role: %s\", ig.Spec.Role)\n\t\t}\n\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"spotinst: error building elastigroup: %v\", err)\n\t\t}\n\t}\n\n\tif len(nodeSpotInstanceGroups) > 0 {\n\t\tif err = b.buildOcean(c, nodeSpotInstanceGroups...); err != nil {\n\t\t\treturn fmt.Errorf(\"spotinst: error building ocean: %v\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (b *SpotInstanceGroupModelBuilder) buildElastigroup(c *fi.CloudupModelBuilderContext, ig *kops.InstanceGroup) (err error) {\n\tklog.V(4).Infof(\"Building instance group as Elastigroup: %q\", b.AutoscalingGroupName(ig))\n\tgroup := &spotinsttasks.Elastigroup{\n\t\tLifecycle:            b.Lifecycle,\n\t\tName:                 new(b.AutoscalingGroupName(ig)),\n\t\tRegion:               new(b.Region),","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/awsmodel/spotinst.go#L179-L215","documentation":"buildElastigroup failed for one instance group; the wrap aggregates any error from SpotInst task construction (subnets, instance types, labels, volumes) so the real cause is in the wrapped error.","triggerScenarios":"Thrown at pkg/model/awsmodel/spotinst.go:197 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error for the specific construction failure","Verify the instance group's machine type, subnets, and labels are valid for SpotInst","Fix the instance group spec and re-run kops update"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}