{"record":{"id":"35ec35e98dd8e26f","repo":"kubernetes/kops","slug":"error-building-cloud-tags-v-35ec35","errorCode":null,"errorMessage":"error building cloud tags: %v","messagePattern":"error building cloud tags: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/awsmodel/spotinst.go","lineNumber":341,"sourceCode":"\t\treturn fmt.Errorf(\"error building public ip options: %v\", err)\n\t}\n\n\t// Subnets.\n\tgroup.Subnets, err = b.buildSubnets(ig)\n\tif err != nil {\n\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","sourceCodeStart":323,"sourceCodeEnd":359,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/awsmodel/spotinst.go#L323-L359","documentation":"buildElastigroup calls b.buildTags(ig) to compute the AWS cloud tags applied to the Elastigroup. This wrapper fires when tag construction fails, aborting creation of the Elastigroup task during `kops update cluster`.","triggerScenarios":"`kops update cluster` with Spotinst where tag building fails — usually an invalid tag spec (unparseable value) supplied via cluster/IG spec or Spotinst label-driven tag overrides.","commonSituations":"Hand-edited cluster.yaml with malformed tag entries; external tooling injecting non-string tag values; reserved-key conflicts introduced via cluster.spec.cloudLabels.","solutions":["Read the wrapped inner error to find the offending tag key/value.","Fix the tag entry in cluster.yaml / instance group spec (values must be plain strings).","Run `kops replace -f cluster.yaml` then `kops update cluster` to apply the corrected spec."],"exampleFix":"// before\ncloudLabels:\n  cost-center: 12345\n// after\ncloudLabels:\n  cost-center: \"12345\"","handlingStrategy":"validation","validationCode":"for k, v := range cluster.Spec.CloudLabels {\n  if k == \"\" || v == \"\" {\n    return fmt.Errorf(\"invalid cloud label %q=%q\", k, v)\n  }\n}","typeGuard":null,"tryCatchPattern":"if err := kopsUpdate(); err != nil {\n  if strings.Contains(err.Error(), \"error building cloud tags\") {\n    // fix the offending cloudLabels entry and retry\n  }\n}","preventionTips":["Quote all tag values in YAML so they stay strings.","Avoid reserved/conflicting tag keys in cloudLabels.","Lint cluster.yaml before `kops update`."],"tags":["aws","tags","spotinst"],"backgroundTag":"invalid-cloud-tag","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"}