{"record":{"id":"db77c6a256f35044","repo":"kubernetes/kops","slug":"cluster-not-found-q-db77c6","errorCode":null,"errorMessage":"cluster not found %q","messagePattern":"cluster not found %q","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/toolbox_dump.go","lineNumber":136,"sourceCode":"\tcmd.Flags().StringVar(&options.SSHUser, \"ssh-user\", options.SSHUser, \"The remote user for SSH access to instances\")\n\tcmd.RegisterFlagCompletionFunc(\"ssh-user\", cobra.NoFileCompletions)\n\n\treturn cmd\n}\n\nfunc RunToolboxDump(ctx context.Context, f commandutils.Factory, out io.Writer, options *ToolboxDumpOptions) error {\n\tclientset, err := f.KopsClient()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcluster, err := clientset.GetCluster(ctx, options.ClusterName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif cluster == nil {\n\t\treturn fmt.Errorf(\"cluster not found %q\", options.ClusterName)\n\t}\n\n\tcloud, err := cloudup.BuildCloud(cluster)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar cloudResources *resources.Dump\n\tif options.CloudResources {\n\t\tresourceMap, err := resourceops.ListResources(cloud, cluster)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\td, err := resources.BuildDump(ctx, cloud, resourceMap)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcloudResources = d","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/toolbox_dump.go#L118-L154","documentation":"RunToolboxDump (kops toolbox dump) calls clientset.GetCluster and, like GetCluster in root.go, receives a nil cluster with nil error when the cluster is absent from the state store. This explicit check converts that into 'cluster not found'. The dump cannot proceed without the cluster spec because it needs it to build the cloud provider.","triggerScenarios":"Running `kops toolbox dump --name <cluster>` where no cluster object with that name exists in the state store at options.ClusterName.","commonSituations":"Typoed or partial cluster name on the toolbox dump command; KOPS_STATE_STORE pointing at the wrong bucket/region; cluster was deleted but its name lingers in old kubeconfig or shell history; gossip cluster name missing the .k8s.local suffix.","solutions":["Run kops get clusters to confirm the exact name and use it verbatim with --name.","Fix KOPS_STATE_STORE (or --state) to the bucket that actually holds the cluster.","Include the full DNS name, e.g. --name mycluster.k8s.local for gossip clusters.","If the cluster was intentionally deleted, there is nothing to dump — verify against the correct environment."],"exampleFix":"// before\nkops toolbox dump --name prod   # not found\n// after\nkops toolbox dump --name prod.k8s.local --state s3://my-state-bucket","handlingStrategy":"validation","validationCode":"kops get cluster \"$CLUSTER_NAME\" >/dev/null 2>&1 || { echo \"cluster $CLUSTER_NAME not found\"; exit 1; }\nkops toolbox dump --name \"$CLUSTER_NAME\"","typeGuard":null,"tryCatchPattern":"cluster, err := clientset.GetCluster(ctx, options.ClusterName)\nif err != nil {\n    return fmt.Errorf(\"getting cluster %q: %w\", options.ClusterName, err)\n}\nif cluster == nil {\n    return fmt.Errorf(\"cluster %q not found; check --name and KOPS_STATE_STORE\", options.ClusterName)\n}","preventionTips":["Verify with kops get clusters before toolbox dump","Use the full DNS name including .k8s.local for gossip clusters","Confirm the state store bucket/region matches the target environment","Clean up stale names from kubeconfig and shell scripts after cluster deletion"],"tags":["kops","toolbox-dump","cluster-not-found"],"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"}