{"record":{"id":"c2f36b1b38ca2623","repo":"kubernetes/kops","slug":"error-building-auto-scaler-options-v","errorCode":null,"errorMessage":"error building auto scaler options: %v","messagePattern":"error building auto scaler options: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/awsmodel/spotinst.go","lineNumber":347,"sourceCode":"\t\treturn fmt.Errorf(\"error building subnets: %v\", err)\n\t}\n\n\t// Capacity.\n\tgroup.MinSize, group.MaxSize = b.buildCapacity(ig)\n\n\t// Monitoring.\n\tgroup.Monitoring = ig.Spec.DetailedInstanceMonitoring\n\n\t// Tags.\n\tgroup.Tags, err = b.buildTags(ig)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error building cloud tags: %v\", err)\n\t}\n\n\t// Auto Scaler.\n\tgroup.AutoScalerOpts, err = b.buildAutoScalerOpts(b.ClusterName(), ig)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error building auto scaler options: %v\", err)\n\t}\n\tif group.AutoScalerOpts != nil { // remove unsupported options\n\t\tgroup.AutoScalerOpts.Taints = nil\n\t}\n\n\t// Instance Metadata Options\n\tgroup.InstanceMetadataOptions = b.buildInstanceMetadataOptions(ig)\n\n\tklog.V(4).Infof(\"Adding task: Elastigroup/%s\", fi.ValueOf(group.Name))\n\tc.AddTask(group)\n\n\treturn nil\n}\n\nfunc (b *SpotInstanceGroupModelBuilder) buildOcean(c *fi.CloudupModelBuilderContext, igs ...*kops.InstanceGroup) (err error) {\n\tklog.V(4).Infof(\"Building instance group as Ocean: %q\", \"nodes.\"+b.ClusterName())\n\tocean := &spotinsttasks.Ocean{\n\t\tLifecycle: b.Lifecycle,","sourceCodeStart":329,"sourceCodeEnd":365,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/awsmodel/spotinst.go#L329-L365","documentation":"buildElastigroup calls b.buildAutoScalerOpts(b.ClusterName(), ig) to derive cluster-autoscaler options (labels, taints, min/max, etc.) for the group. This wrapper fires when building those options fails, aborting Elastigroup creation during `kops update cluster`.","triggerScenarios":"`kops update cluster` with Spotinst where autoscaler option parsing fails — typically malformed autoscaler label/taint expressions on the instance group or cluster spec that the builder cannot parse.","commonSituations":"Hand-edited autoscaler taint/label strings with wrong key=value[:effect] syntax; clusters upgraded across kOps versions where option formats changed; copy-pasted Spotinst labels from other clusters.","solutions":["Read the wrapped inner error; it names the option that failed to parse.","Fix the autoscaler labels/taints syntax in the cluster or instance group spec.","Compare against a fresh kops cluster template for your kOps version to ensure the option format is current.","Re-run `kops update cluster`."],"exampleFix":"// before\nautoscaleLabels: \"role=node effect=NoSchedule\"\n// after\nautoscaleTaints: \"dedicated=gpu:NoSchedule\"","handlingStrategy":"validation","validationCode":"for _, t := range ig.Spec.TeamTaints() { // or your autoscaler taint labels\n  parts := strings.Split(t, \":\")\n  if len(parts) != 2 || !validEffects[parts[1]] {\n    return fmt.Errorf(\"invalid autoscaler taint %q\", t)\n  }\n}","typeGuard":null,"tryCatchPattern":"if err := kopsUpdate(); err != nil {\n  if strings.Contains(err.Error(), \"error building auto scaler options\") {\n    // correct the autoscaler label/taint syntax and retry\n  }\n}","preventionTips":["Use key=value:effect taint syntax exactly.","Compare Spotinst labels against the kOps Spotinst docs for your version.","Re-derive autoscaler options from fresh templates after kOps upgrades."],"tags":["autoscaler","spotinst","config"],"backgroundTag":"autoscaler-options-invalid","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"}