{"record":{"id":"c4ab06a0fc5e8277","repo":"kubernetes/kops","slug":"error-reading-ssh-public-key-v-c4ab06","errorCode":null,"errorMessage":"error reading SSH public key: %v","messagePattern":"error reading SSH public key: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/dotasks/sshkey.go","lineNumber":103,"sourceCode":"\t}\n\tactual.Lifecycle = e.Lifecycle\n\n\te.ID = actual.ID\n\tif e.IsExistingKey() && *e.Name != \"\" {\n\t\te.KeyFingerprint = actual.KeyFingerprint\n\t}\n\n\t// We aren't allowed two keys with the same fingerprint but different names...\n\te.Name = actual.Name\n\n\treturn actual, nil\n}\n\nfunc (e *SSHKey) Normalize(c *fi.CloudupContext) error {\n\tif e.KeyFingerprint == nil && e.PublicKey != nil {\n\t\tpublicKey, err := fi.ResourceAsString(e.PublicKey)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error reading SSH public key: %v\", err)\n\t\t}\n\n\t\tkeyFingerprint, err := pki.ComputeAWSKeyFingerprint(publicKey)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error computing key fingerprint for SSH key: %v\", err)\n\t\t}\n\t\tklog.V(2).Infof(\"Computed SSH key fingerprint as %q\", keyFingerprint)\n\t\te.KeyFingerprint = &keyFingerprint\n\t}\n\n\treturn nil\n}\n\nfunc (e *SSHKey) Run(c *fi.CloudupContext) error {\n\treturn fi.CloudupDefaultDeltaRunMethod(e, c)\n}\n\nfunc (s *SSHKey) CheckChanges(a, e, changes *SSHKey) error {","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/dotasks/sshkey.go#L85-L121","documentation":"Wraps fi.ResourceAsString failure while reading the SSH public key resource in Normalize, done to derive the key fingerprint when it was not supplied. Fires when the PublicKey resource cannot be materialized into a string.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/dotasks/sshkey.go:103 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the public key resource/config in the cluster spec","Inspect the wrapped read error","Fix the key reference and re-run"],"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-12T12:17:11.808Z"}