{"record":{"id":"09d0e336b16fe001","repo":"kubernetes/kops","slug":"no-secrets-found","errorCode":null,"errorMessage":"no secrets found","messagePattern":"no secrets found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/get_secrets.go","lineNumber":133,"sourceCode":"\t\treturn err\n\t}\n\n\tcluster, err := GetCluster(ctx, f, options.ClusterName)\n\tif err != nil {\n\t\treturn err\n\t}\n\tsecretStore, err := clientset.SecretStore(cluster)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\titems, err := listSecrets(secretStore, options.SecretNames)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif len(items) == 0 {\n\t\treturn fmt.Errorf(\"no secrets found\")\n\t}\n\tswitch options.Output {\n\n\tcase OutputTable:\n\t\tt := &tables.Table{}\n\t\tt.AddColumn(\"NAME\", func(i string) string {\n\t\t\treturn i\n\t\t})\n\t\treturn t.Render(items, out, \"NAME\")\n\n\tcase OutputYaml:\n\t\treturn fmt.Errorf(\"yaml output format is not (currently) supported for secrets\")\n\tcase OutputJSON:\n\t\treturn fmt.Errorf(\"json output format is not (currently) supported for secrets\")\n\tcase \"plaintext\":\n\t\tfor _, item := range items {\n\t\t\tvar data string\n\t\t\tsecret, err := secretStore.FindSecret(item)","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/get_secrets.go#L115-L151","documentation":"After listing secrets, RunGetSecrets returns this error when the filtered result set is empty. It signals that the secret store has no secrets matching the requested names (or no secrets at all when no names were given), rather than printing an empty table.","triggerScenarios":"Running `kops get secrets` on a cluster whose secret store is empty, or `kops get secrets <name>` where no secret matches the given name(s).","commonSituations":"Typo in the secret name argument; querying a different cluster than the one holding the secret; secrets were deleted or never created for this cluster.","solutions":["Run `kops get secrets` with no name filter to see what exists","Verify the secret name spelling","Confirm you are targeting the right cluster with --name and the right state store with --state","Create the secret with `kops create secret` if it does not exist"],"exampleFix":"// before\nkops get secrets my-scret\n\n// after\nkops get secrets            # list all to find correct name\nkops get secrets my-secret","handlingStrategy":"validation","validationCode":"# check the secret exists before filtering:\nkops get secrets | grep -q \"^$SECRET_NAME$\" || echo \"secret not found: $SECRET_NAME\"","typeGuard":null,"tryCatchPattern":"items, err := listSecrets(store, names)\nif err != nil {\n\treturn err\n}\nif len(items) == 0 {\n\treturn fmt.Errorf(\"no secrets found (cluster=%q, names=%v)\", cluster, names)\n}","preventionTips":["List all secrets first, then filter","Verify cluster name and state store before querying","Confirm secrets were created for this cluster"],"tags":["cli","kops","empty-result","not-found"],"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"}