{"record":{"id":"c3348fbe3bee0fae","repo":"kubernetes/kops","slug":"listing-keysets-v-c3348f","errorCode":null,"errorMessage":"listing keysets: %v","messagePattern":"listing keysets: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/distrust_keypair.go","lineNumber":133,"sourceCode":"\t}\n\n\tcluster, err := GetCluster(ctx, f, options.ClusterName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tkeyStore, err := clientset.KeyStore(cluster)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif options.Keyset != \"all\" {\n\t\treturn distrustKeypair(ctx, out, options.Keyset, options.KeypairIDs, keyStore)\n\t}\n\n\tkeysets, err := keyStore.ListKeysets()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"listing keysets: %v\", err)\n\t}\n\n\tfor name := range keysets {\n\t\tif rotatableKeysetFilter(name, nil) {\n\t\t\tif err := distrustKeypair(ctx, out, name, nil, keyStore); err != nil {\n\t\t\t\treturn fmt.Errorf(\"distrusting keypair for %s: %v\", name, err)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc distrustKeypair(ctx context.Context, out io.Writer, name string, keypairIDs []string, keyStore fi.CAStore) error {\n\tkeyset, err := keyStore.FindKeyset(ctx, name)\n\tif err != nil {\n\t\treturn err\n\t} else if keyset == nil {","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/distrust_keypair.go#L115-L151","documentation":"With keyset 'all', RunDistrustKeypair lists every keyset from the keystore to distrust each rotatable one; this wraps ListKeysets failing - the state store (VFS) could not be read due to missing bucket, permissions, or connectivity.","triggerScenarios":"Thrown at cmd/kops/distrust_keypair.go:133 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the cluster state store path and credentials","Check the underlying storage (S3/GCS) is reachable","Target a specific keyset instead of 'all' to bypass listing"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}