{"record":{"id":"d8e8a9e6e3a30a9f","repo":"kubernetes/kops","slug":"no-cluster-found","errorCode":null,"errorMessage":"no cluster found","messagePattern":"no cluster found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/get_all.go","lineNumber":87,"sourceCode":"\t\t},\n\t}\n\n\treturn cmd\n}\n\nfunc RunGetAll(ctx context.Context, f commandutils.Factory, out io.Writer, options *GetAllOptions) error {\n\tclient, err := f.KopsClient()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcluster, err := client.GetCluster(ctx, options.ClusterName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif cluster == nil {\n\t\treturn fmt.Errorf(\"no cluster found\")\n\t}\n\n\tigList, err := client.InstanceGroupsFor(cluster).List(ctx, metav1.ListOptions{})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif igList == nil || igList.Items == nil || len(igList.Items) == 0 {\n\t\tfmt.Fprintf(os.Stderr, \"No instance groups found\\n\")\n\t}\n\n\tvar instancegroups []*api.InstanceGroup\n\tfor i := range igList.Items {\n\t\tinstancegroups = append(instancegroups, &igList.Items[i])\n\t}\n\n\tvar addonObjects []*unstructured.Unstructured\n\t{","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/get_all.go#L69-L105","documentation":"RunGetAll returns this hard-coded error when client.GetCluster succeeds (no transport/state-store error) but returns a nil cluster, meaning no cluster with the given name exists in the state store. It is a sentinel-style message indicating lookup returned empty rather than an error.","triggerScenarios":"`kops get all <name>` where <name> does not match any cluster in the configured state store, or KOPS_STATE_STORE points at the wrong/empty location, or the cluster name is misspelled.","commonSituations":"Wrong KOPS_STATE_STORE env var (e.g. pointing at a different bucket or an unset default); typo in cluster name or missing full DNS name (must be exact, e.g. mycluster.example.com, not just mycluster); cluster was deleted; running from a different AWS profile/account so the bucket/objects are invisible.","solutions":["Run `kops get clusters` (or `kops get` with no args) to list clusters actually visible in the state store","Verify KOPS_STATE_STORE points at the correct location (s3://bucket etc.) and credentials/profile can read it","Use the exact full cluster name (FQDN) as registered, correcting typos","Recreate the cluster or import state if the cluster config was deleted"],"exampleFix":"// before\nkops get all mycluster\n// after\nkops get clusters          # confirm name\nkops get all mycluster.example.com","handlingStrategy":"validation","validationCode":"clusters, err := client.ListClusters(ctx, nil)\nif err != nil { return err }\nfound := false\nfor _, c := range clusters {\n    if c.ObjectMeta.Name == options.ClusterName { found = true; break }\n}\nif !found {\n    return fmt.Errorf(\"cluster %q not found in state store; run 'kops get clusters' to list\", options.ClusterName)\n}","typeGuard":"if cluster == nil {\n    return fmt.Errorf(\"cluster %q not found\", options.ClusterName)\n}","tryCatchPattern":"cluster, err := client.GetCluster(ctx, name)\nif err != nil { return err }\nif cluster == nil {\n    return fmt.Errorf(\"no cluster found for %q; check KOPS_STATE_STORE and exact cluster FQDN\", name)\n}","preventionTips":["Verify KOPS_STATE_STORE is set and readable before running get commands","Always use the full cluster FQDN","List clusters with `kops get clusters` to confirm names","Confirm cloud credentials/profile can access the state store"],"tags":["cli","state-store","cluster-lookup"],"backgroundTag":"cluster-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"}