{"record":{"id":"23ea99cd59edd83d","repo":"kubernetes/kops","slug":"found-multiple-instance-groups-matching-servergrp","errorCode":null,"errorMessage":"found multiple instance groups matching servergrp %q","messagePattern":"found multiple instance groups matching servergrp %q","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/do/cloud.go","lineNumber":503,"sourceCode":"\n// matchInstanceGroup filters a list of instancegroups for recognized cloud groups\nfunc matchInstanceGroup(name string, clusterName string, instancegroups []*kops.InstanceGroup) (*kops.InstanceGroup, error) {\n\tvar instancegroup *kops.InstanceGroup\n\tfor _, g := range instancegroups {\n\t\tvar groupName string\n\n\t\tswitch {\n\t\tcase g.Spec.Role.HasControlPlane(),\n\t\t\tg.Spec.Role.HasNode():\n\t\t\tgroupName = clusterName + \"-\" + g.ObjectMeta.Name\n\t\tdefault:\n\t\t\tklog.Warningf(\"Ignoring InstanceGroup of unknown role %q\", g.Spec.Role)\n\t\t\tcontinue\n\t\t}\n\n\t\tif name == groupName {\n\t\t\tif instancegroup != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"found multiple instance groups matching servergrp %q\", groupName)\n\t\t\t}\n\t\t\tinstancegroup = g\n\t\t}\n\t}\n\n\treturn instancegroup, nil\n}\n\nfunc buildCloudInstanceGroup(c *doCloudImplementation, ig *kops.InstanceGroup, g DOInstanceGroup, nodeMap map[string]*v1.Node) (*cloudinstances.CloudInstanceGroup, error) {\n\tcg := &cloudinstances.CloudInstanceGroup{\n\t\tHumanName:     g.InstanceGroupName,\n\t\tInstanceGroup: ig,\n\t\tRaw:           g,\n\t\tMinSize:       int(fi.ValueOf(ig.Spec.MinSize)),\n\t\tTargetSize:    int(fi.ValueOf(ig.Spec.MinSize)),\n\t\tMaxSize:       int(fi.ValueOf(ig.Spec.MaxSize)),\n\t}\n","sourceCodeStart":485,"sourceCodeEnd":521,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/do/cloud.go#L485-L521","documentation":"While mapping a cloud server group name to kops InstanceGroups, more than one InstanceGroup produced the same expected group name (clusterName + instancegroup name) for the given servergrp. The mapping is expected to be unique; duplicates make it impossible to decide which InstanceGroup the instances belong to, usually caused by two InstanceGroups with the same ObjectMeta.Name or conflicting roles.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/do/cloud.go:503 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["List the cluster's InstanceGroups and find the duplicate name","Rename or delete the redundant InstanceGroup so group names are unique","Re-run the cloud group discovery afterwards"],"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"}