{"record":{"id":"2bb4d484765092f8","repo":"kubernetes/kops","slug":"found-multiple-autoscalinggroups-with-name-q","errorCode":null,"errorMessage":"found multiple AutoscalingGroups with name: %q","messagePattern":"found multiple AutoscalingGroups with name: %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/autoscalinggroup.go","lineNumber":324,"sourceCode":"\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif aws.ToString(g.AutoScalingGroupName) == name {\n\t\t\t\tfound = append(found, &g)\n\t\t\t} else {\n\t\t\t\tklog.Warningf(\"Got ASG with unexpected name %q\", fi.ValueOf(g.AutoScalingGroupName))\n\t\t\t}\n\t\t}\n\t}\n\n\tswitch len(found) {\n\tcase 0:\n\t\treturn nil, nil\n\tcase 1:\n\t\treturn found[0], nil\n\t}\n\n\treturn nil, fmt.Errorf(\"found multiple AutoscalingGroups with name: %q\", name)\n}\n\nfunc (e *AutoscalingGroup) Normalize(c *fi.CloudupContext) error {\n\tsort.Strings(e.Metrics)\n\tawsup.GetCloud(c).AddTags(e.Name, e.Tags)\n\n\treturn nil\n}\n\n// Run is responsible for running the task\nfunc (e *AutoscalingGroup) Run(c *fi.CloudupContext) error {\n\treturn fi.CloudupDefaultDeltaRunMethod(e, c)\n}\n\n// CheckChanges is responsible for checking for changes??\nfunc (e *AutoscalingGroup) CheckChanges(a, ex, changes *AutoscalingGroup) error {\n\tif a != nil {\n\t\tif ex.Name == nil {","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/autoscalinggroup.go#L306-L342","documentation":"kOps expects exactly one AutoScalingGroup to match the task name (the kops-generated ASG name). After listing, if more than one group matched, the state is ambiguous so it refuses to guess and returns this error.","triggerScenarios":"Two or more AutoScalingGroups with the same name exist in the account/region being queried — typically created by re-importing a cluster, manual duplication in the console, or stale groups left by a previous apply in a different region/account view.","commonSituations":"A developer manually copied an ASG for testing, or an interrupted delete left a duplicate; kops apply then fails during Find instead of silently updating the wrong group.","solutions":["List ASGs (`aws autoscaling describe-auto-scaling-groups --filters Name=tag:Name,Values=<name>`) and identify the duplicate","Delete the unwanted duplicate ASG (or the stale one from the old cluster)","Verify the kops cluster spec instance group name hasn't been reused across clusters sharing one account","Re-run `kops update cluster --yes`"],"exampleFix":"// before\n$ aws autoscaling create-auto-scaling-group --auto-scaling-group-name nodes-eu-west-1a ... // duplicate\n// after: delete the duplicate, then\n$ kops update cluster --name mycluster --yes","handlingStrategy":"validation","validationCode":"aws autoscaling describe-auto-scaling-groups \\\n  --query 'AutoScalingGroups[?AutoScalingGroupName==`nodes-<zone>`]' | jq 'length'\n# must return 1 before running kops update","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Never manually create ASGs with kops-generated names","Clean up interrupted deletes before re-applying","Use one kops state store/account per cluster to avoid name collisions"],"tags":["aws","autoscaling","duplicate-resource"],"backgroundTag":"duplicate-resource-found","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"}