{"record":{"id":"4e529454ee4bd28d","repo":"kubernetes/kops","slug":"listing-instancegroups-v","errorCode":null,"errorMessage":"listing InstanceGroups: %v","messagePattern":"listing InstanceGroups: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/delete_instancegroup.go","lineNumber":153,"sourceCode":"\tclientset, err := f.KopsClient()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tgroup, err := clientset.InstanceGroupsFor(cluster).Get(ctx, groupName, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error reading InstanceGroup %q: %v\", groupName, err)\n\t}\n\tif group == nil {\n\t\treturn fmt.Errorf(\"InstanceGroup %q not found\", groupName)\n\t}\n\n\tfmt.Fprintf(out, \"InstanceGroup %q found for deletion\\n\", groupName)\n\n\tif group.Spec.Role.HasControlPlane() {\n\t\tgroups, err := clientset.InstanceGroupsFor(cluster).List(ctx, metav1.ListOptions{})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"listing InstanceGroups: %v\", err)\n\t\t}\n\n\t\tonlyMaster := true\n\t\tfor _, ig := range groups.Items {\n\t\t\tif ig.Name != groupName && ig.Spec.Role.HasControlPlane() {\n\t\t\t\tonlyMaster = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif onlyMaster {\n\t\t\treturn fmt.Errorf(\"cannot delete the only control plane instance group\")\n\t\t}\n\t}\n\n\tif !options.Yes {\n\t\tfmt.Fprintf(out, \"\\nMust specify --yes to delete instancegroup\\n\")\n\t\treturn nil","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/delete_instancegroup.go#L135-L171","documentation":"When deleting a control-plane instance group, the command lists all instance groups of the cluster to check whether others with a control-plane role exist. If that List API call fails, the error is wrapped as \"listing InstanceGroups: %v\".","triggerScenarios":"group.Spec.Role.HasControlPlane() is true and clientset.InstanceGroupsFor(cluster).List(ctx, metav1.ListOptions{}) returns a non-nil error (state store unreachable, auth failure).","commonSituations":"Deleting a control-plane IG while the kOps state store (S3/GCS/etc.) is unreachable or credentials are broken; malformed cluster config.","solutions":["Inspect the wrapped %v message for the root cause","Verify state store access: kops get clusters --state <store>","Fix credentials/permissions on the state store bucket, then retry"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"kops get clusters --state $KOPS_STATE_STORE  # verify state store reachability first","typeGuard":null,"tryCatchPattern":"err := RunDeleteInstanceGroup(ctx, f, out, opts)\nif err != nil && strings.Contains(err.Error(), \"listing InstanceGroups\") {\n    // transient state store failure: back off and retry\n    time.Sleep(2 * time.Second)\n    err = RunDeleteInstanceGroup(ctx, f, out, opts)\n}","preventionTips":["Ensure state store (S3/GCS) credentials are valid and reachable before control-plane operations","Retry transient backend errors with backoff","Use `kops toolbox dump` or kops get to smoke-test API access first"],"tags":["cli","instancegroup","api"],"backgroundTag":"state-store-unreachable","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"}