{"record":{"id":"054edd8fdb81d6ab","repo":"kubernetes/kops","slug":"no-instancegroup-objects-found-054edd","errorCode":null,"errorMessage":"no InstanceGroup objects found","messagePattern":"no InstanceGroup objects found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/validation/validate_cluster.go","lineNumber":123,"sourceCode":"\tfor _, h := range hostAddrs {\n\t\tif h == dns.PlaceholderIP || h == dns.PlaceholderIPv6 {\n\t\t\treturn h, nil\n\t\t}\n\t}\n\n\treturn \"\", nil\n}\n\nfunc NewClusterValidator(cluster *kops.Cluster, cloud fi.Cloud, instanceGroupList *kops.InstanceGroupList, filterInstanceGroups func(ig *kops.InstanceGroup) bool, filterPodsForValidation func(pod *v1.Pod) bool, maxUnreadyNodes int, restConfig *rest.Config, k8sClient kubernetes.Interface) (ClusterValidator, error) {\n\tvar allInstanceGroups []*kops.InstanceGroup\n\n\tfor i := range instanceGroupList.Items {\n\t\tig := &instanceGroupList.Items[i]\n\t\tallInstanceGroups = append(allInstanceGroups, ig)\n\t}\n\n\tif len(allInstanceGroups) == 0 {\n\t\treturn nil, fmt.Errorf(\"no InstanceGroup objects found\")\n\t}\n\n\t// If no filter is provided, validate all instance groups\n\tif filterInstanceGroups == nil {\n\t\tfilterInstanceGroups = func(ig *kops.InstanceGroup) bool {\n\t\t\treturn true\n\t\t}\n\t}\n\n\t// If no filter is provided, validate all pods\n\tif filterPodsForValidation == nil {\n\t\tfilterPodsForValidation = func(pod *v1.Pod) bool {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn &clusterValidatorImpl{\n\t\tcluster:                 cluster,","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/validation/validate_cluster.go#L105-L141","documentation":"NewClusterValidator builds a ClusterValidator after fetching all InstanceGroups from the cluster's state store. If the InstanceGroup list is empty it refuses to construct a validator, because validation of nodes/instance groups is meaningless (and would produce misleading results) for a cluster with no IGs. This is an intentional guard, not a transient failure.","triggerScenarios":"Building a validator (kops validate cluster, rolling-update, delete instance) for a cluster whose state store contains zero InstanceGroup objects.","commonSituations":"Running commands against the wrong KOPS_STATE_STORE / cluster name so the (existing but empty or wrong) cluster is loaded; a cluster spec where all IGs were accidentally deleted; a typo'd --name matching a non-existent cluster; fresh create before kops update/IG creation completed.","solutions":["Confirm you target the right state store and cluster: echo $KOPS_STATE_STORE and kops get instancegroups --name <cluster>","If IGs are missing, recreate them (kops create ig / restore from the cluster YAML) and apply with kops update cluster --yes","If the cluster is genuinely the wrong target, re-run with the correct --name and state store","Check with kops get clusters that the cluster exists where you expect it"],"exampleFix":"// before\nKOPS_STATE_STORE=s3://wrong-bucket kops validate cluster --name prod.example.com\n# no InstanceGroup objects found\n// after\nexport KOPS_STATE_STORE=s3://correct-bucket\nkops get instancegroups --name prod.example.com   # lists IGs\nkops validate cluster --name prod.example.com","handlingStrategy":"validation","validationCode":"igs, err := clientset.InstanceGroupsFor(cluster).List(ctx, metav1.ListOptions{})\nif err != nil {\n    return err\n}\nif len(igs.Items) == 0 {\n    return fmt.Errorf(\"cluster %s has no instance groups; check KOPS_STATE_STORE and --name\", cluster.Name)\n}","typeGuard":null,"tryCatchPattern":"validator, err := NewClusterValidator(cluster, clientset, cloud, ...\nif err != nil {\n    if strings.Contains(err.Error(), \"no InstanceGroup objects found\") {\n        return fmt.Errorf(\"wrong cluster/state store or IGs deleted: %w\", err)\n    }\n    return err\n}","preventionTips":["Pin KOPS_STATE_STORE and cluster --name in scripts/CI to avoid targeting the wrong store","Keep IG definitions in version control so they can be recreated","Run kops get instancegroups before mutating/validation commands"],"tags":["kops","instancegroups","state-store","cli","validation"],"backgroundTag":"missing-instance-groups","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"}