{"record":{"id":"8e23dcd98fccfbb9","repo":"kubernetes/kops","slug":"keyset-not-found","errorCode":null,"errorMessage":"keyset not found","messagePattern":"keyset not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/distrust_keypair.go","lineNumber":152,"sourceCode":"\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 {\n\t\treturn fmt.Errorf(\"keyset not found\")\n\t}\n\n\tif len(keypairIDs) == 0 {\n\t\tprimarySerial := keyset.Primary.Certificate.Certificate.SerialNumber\n\t\tfor id, item := range keyset.Items {\n\t\t\tif item.DistrustTimestamp == nil && item.Certificate.Certificate.SerialNumber.Cmp(primarySerial) < 0 {\n\t\t\t\tkeypairIDs = append(keypairIDs, id)\n\t\t\t}\n\t\t}\n\n\t\tif len(keypairIDs) == 0 {\n\t\t\tklog.Infof(\"No %s keypairs older than the primary.\", name)\n\t\t\treturn nil\n\t\t}\n\t}\n\n\tfor _, id := range keypairIDs {\n\t\tif id == keyset.Primary.Id {","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/distrust_keypair.go#L134-L170","documentation":"distrustKeypair looked up the named keyset via FindKeyset; the lookup itself succeeded but returned nil, meaning no keyset with that name exists in the cluster keystore. This is a name/validation mismatch, not a store failure.","triggerScenarios":"Thrown at cmd/kops/distrust_keypair.go:152 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["List existing keysets (e.g. kops get keypairs) to find the correct name","Check the keyset name for typos"],"exampleFix":null,"handlingStrategy":"validation","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-12T12:17:11.808Z"}