{"record":{"id":"9a989a345ebf4ba6","repo":"kubernetes/kops","slug":"keyset-s-primary-id-q-must-not-be-distrusted","errorCode":null,"errorMessage":"keyset's primary id %q must not be distrusted","messagePattern":"keyset's primary id %q must not be distrusted","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/vfs_castore.go","lineNumber":267,"sourceCode":"\n\terr = p.WriteFile(ctx, bytes.NewReader([]byte(sshCredential.Spec.PublicKey)), acl)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error writing %q: %v\", p, err)\n\t}\n\n\treturn nil\n}\n\nfunc (c *VFSCAStore) StoreKeyset(ctx context.Context, name string, keyset *Keyset) error {\n\tif keyset.Primary == nil || keyset.Primary.Id == \"\" {\n\t\treturn fmt.Errorf(\"keyset must have a primary key\")\n\t}\n\tprimaryId := keyset.Primary.Id\n\tif keyset.Items[primaryId] == nil {\n\t\treturn fmt.Errorf(\"keyset's primary id %q not present in items\", primaryId)\n\t}\n\tif keyset.Items[primaryId].DistrustTimestamp != nil {\n\t\treturn fmt.Errorf(\"keyset's primary id %q must not be distrusted\", primaryId)\n\t}\n\tif keyset.Items[primaryId].PrivateKey == nil {\n\t\treturn fmt.Errorf(\"keyset's primary id %q must have a private key\", primaryId)\n\t}\n\tif keyset.Items[primaryId].Certificate == nil {\n\t\treturn fmt.Errorf(\"keyset's primary id %q must have a certificate\", primaryId)\n\t}\n\n\t{\n\t\tp := c.buildPrivateKeyPoolPath(name)\n\t\tif err := writeKeysetBundle(ctx, c.cluster, p, name, keyset); err != nil {\n\t\t\treturn fmt.Errorf(\"writing private bundle: %v\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/vfs_castore.go#L249-L285","documentation":"Error \"keyset's primary id %q must not be distrusted\" thrown in kubernetes/kops.","triggerScenarios":"Thrown at upup/pkg/fi/vfs_castore.go:267 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"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"}