{"record":{"id":"38d54546f927093e","repo":"kubernetes/kops","slug":"error-getting-instance-group-for-asg-q","errorCode":null,"errorMessage":"error getting instance group for ASG %q","messagePattern":"error getting instance group for ASG %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awsup/aws_cloud.go","lineNumber":806,"sourceCode":"\n\treturn karpenterGroup, nil\n}\n\nfunc getCloudGroups(ctx context.Context, c AWSCloud, cluster *kops.Cluster, instancegroups []*kops.InstanceGroup, warnUnmatched bool, nodes []v1.Node) (map[string]*cloudinstances.CloudInstanceGroup, error) {\n\tnodeMap := cloudinstances.GetNodeMap(nodes, cluster)\n\n\tgroups := make(map[string]*cloudinstances.CloudInstanceGroup)\n\tasgs, err := FindAutoscalingGroups(c, c.Tags())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to find autoscale groups: %v\", err)\n\t}\n\n\tfor _, asg := range asgs {\n\t\tname := aws.ToString(asg.AutoScalingGroupName)\n\n\t\tinstancegroup, err := matchInstanceGroup(name, cluster.ObjectMeta.Name, instancegroups)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error getting instance group for ASG %q\", name)\n\t\t}\n\t\tif instancegroup == nil {\n\t\t\tif warnUnmatched {\n\t\t\t\tklog.Warningf(\"Found ASG with no corresponding instance group %q\", name)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tgroups[instancegroup.ObjectMeta.Name], err = awsBuildCloudInstanceGroup(ctx, c, cluster, instancegroup, asg, nodeMap)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error getting cloud instance group %q: %v\", instancegroup.ObjectMeta.Name, err)\n\t\t}\n\t}\n\n\treturn groups, nil\n}\n\n// FindAutoscalingGroups finds autoscaling groups matching the specified tags","sourceCodeStart":788,"sourceCodeEnd":824,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awsup/aws_cloud.go#L788-L824","documentation":"matchInstanceGroup could not unambiguously map an AWS AutoScalingGroup name to a kops InstanceGroup (it returns an error when multiple instance groups match the ASG name). The ASG name is the input at fault; the underlying matcher error is discarded by this wrapping.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/awsup/aws_cloud.go:806 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["List the cluster's instance groups and rename or delete the duplicate ones that match the reported ASG name","Check for leftover ASGs from a previous cluster with the same name and delete stale ASGs via the AWS console or CLI","Run 'kops get ig' to inspect instance group names for collisions"],"exampleFix":null,"handlingStrategy":"validation","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"}