{"record":{"id":"233681de4f9ae098","repo":"kubernetes/kops","slug":"spotinst-error-building-ocean-v","errorCode":null,"errorMessage":"spotinst: error building ocean: %v","messagePattern":"spotinst: error building ocean: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/awsmodel/spotinst.go","lineNumber":203,"sourceCode":"\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),\n\t\tImageID:              new(ig.Spec.Image),\n\t\tOnDemandInstanceType: new(strings.Split(ig.Spec.MachineType, \",\")[0]),\n\t\tSpotInstanceTypes:    strings.Split(ig.Spec.MachineType, \",\"),\n\t}\n\n\t// Cloud config.","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/awsmodel/spotinst.go#L185-L221","documentation":"buildOcean failed while constructing the SpotInst Ocean cluster for the collected node instance groups; wraps task-building errors for the Ocean resource, with the real cause in the wrapped error.","triggerScenarios":"Thrown at pkg/model/awsmodel/spotinst.go:203 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error for the failing field","Verify the node instance group specs are compatible with Ocean","Retry after fixing the cluster spec"],"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-12T12:17:11.808Z"}