{"record":{"id":"1b4e6d5775be404d","repo":"kubernetes/kops","slug":"error-computing-key-fingerprint-for-ssh-key-v-1b4e6d","errorCode":null,"errorMessage":"error computing key fingerprint for SSH key: %v","messagePattern":"error computing key fingerprint for SSH key: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/scalewaytasks/sshkey.go","lineNumber":94,"sourceCode":"\t}\n\n\tklog.V(2).Infof(\"SSH key fingerprints match; assuming public keys match\")\n\tsshKey.PublicKey = s.PublicKey\n\tsshKey.KeyPairFingerPrint = s.KeyPairFingerPrint\n\n\treturn sshKey, nil\n}\n\nfunc (s *SSHKey) Run(c *fi.CloudupContext) error {\n\tif s.KeyPairFingerPrint == nil && s.PublicKey != nil {\n\t\tpublicKey, err := fi.ResourceAsString(*s.PublicKey)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error reading SSH public key: %w\", err)\n\t\t}\n\n\t\tkeyPairFingerPrint, err := pki.ComputeOpenSSHKeyFingerprint(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\", keyPairFingerPrint)\n\t\ts.KeyPairFingerPrint = &keyPairFingerPrint\n\t}\n\treturn fi.CloudupDefaultDeltaRunMethod(s, c)\n}\n\nfunc (s *SSHKey) CheckChanges(actual, expected, changes *SSHKey) error {\n\tif actual != nil {\n\t\tif changes.Name != nil {\n\t\t\treturn fi.CannotChangeField(\"Name\")\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (*SSHKey) RenderScw(t *scaleway.ScwAPITarget, actual, expected, changes *SSHKey) error {\n\tif actual != nil {","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/scalewaytasks/sshkey.go#L76-L112","documentation":"Thrown during SSHKey.Run when the SSH public key resource was read successfully but pki.ComputeOpenSSHKeyFingerprint could not parse it into a valid OpenSSH public key. It fires when the key material is malformed, truncated, in an unsupported format (e.g. PEM instead of OpenSSH), or contains stray whitespace/newlines, so the fingerprint cannot be derived to compare against the stored KeyPairFingerPrint.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/scalewaytasks/sshkey.go:94 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Regenerate the SSH public key in OpenSSH format (ssh-keygen -t ed25519) and update the key resource","Inspect the key material for truncation, stray newlines, or PEM formatting and fix the source of the key","Verify the resource supplying PublicKey actually yields the raw public key string and not an error page or path"],"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"}