{"record":{"id":"c389afb334c28813","repo":"kubernetes/kops","slug":"instance-group-q-not-found","errorCode":null,"errorMessage":"instance group %q not found","messagePattern":"instance group %q not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/commands/toolbox_enroll.go","lineNumber":563,"sourceCode":"\n\tinstanceGroups, err := b.GetInstanceGroups(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif b.InstanceGroupName == \"\" {\n\t\treturn nil, fmt.Errorf(\"InstanceGroup name is missing\")\n\t}\n\n\t// Build full IG spec to ensure we end up with a valid IG\n\tfor i := range instanceGroups.Items {\n\t\tig := &instanceGroups.Items[i]\n\t\tif ig.Name == b.InstanceGroupName {\n\t\t\tb.InstanceGroup = ig\n\t\t\treturn ig, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"instance group %q not found\", b.InstanceGroupName)\n}\n\nfunc (b *ConfigBuilder) GetFullInstanceGroup(ctx context.Context) (*kops.InstanceGroup, error) {\n\tif b.fullInstanceGroup != nil {\n\t\treturn b.fullInstanceGroup, nil\n\t}\n\n\tclientset, err := b.GetClientset(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfullCluster, err := b.GetFullCluster(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcloud, err := b.GetCloud(ctx)","sourceCodeStart":545,"sourceCodeEnd":581,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/commands/toolbox_enroll.go#L545-L581","documentation":"After listing the cluster's instance groups, GetInstanceGroup finds none matching b.InstanceGroupName and returns this error naming the requested group. The name was provided but does not exist in the cluster's state store.","triggerScenarios":"GetInstanceGroup called with an InstanceGroupName that doesn't match any group returned by clientset.InstanceGroupsFor(cluster).List — typo, group deleted, or wrong cluster.","commonSituations":"Typo in `kops toolbox enroll --name <ig>`; instance group was deleted or renamed; pointing at the wrong cluster name so the group list is a different cluster's; case mismatch.","solutions":["Run `kops get instancegroups <cluster>` (or kubectl get ig) and copy the exact group name","Confirm the ClusterName on the builder matches the intended cluster","Recreate the missing instance group with `kops create ig` if it was deleted","Check for case/whitespace differences in the name"],"exampleFix":"// before\nb.InstanceGroupName = \"Nodes\"   // actual group is \"nodes\"\n// after\n$ kops get ig --name c1.example.com\nb.InstanceGroupName = \"nodes\"","handlingStrategy":"validation","validationCode":"igs, err := b.GetInstanceGroups(ctx)\nif err != nil { return err }\nnames := map[string]bool{}\nfor _, ig := range igs.Items { names[ig.Name] = true }\nif !names[b.InstanceGroupName] {\n    return fmt.Errorf(\"%q not in %v\", b.InstanceGroupName, names)\n}","typeGuard":"func instanceGroupExists(igs *kops.InstanceGroupList, name string) bool {\n    for _, ig := range igs.Items { if ig.Name == name { return true } }\n    return false\n}","tryCatchPattern":"ig, err := b.GetInstanceGroup(ctx)\nif err != nil && strings.Contains(err.Error(), \"not found\") {\n    return fmt.Errorf(\"run `kops get ig` and use an exact group name\")\n}","preventionTips":["Copy instance group names exactly from `kops get ig`","Confirm the cluster name before looking up groups","Don't rename/delete groups referenced by automation"],"tags":["instance-group","not-found","configuration"],"backgroundTag":"resource-not-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"}