{"record":{"id":"49ad3a13a34f553e","repo":"kubernetes/kops","slug":"error-reading-ssh-public-key-w","errorCode":null,"errorMessage":"error reading SSH public key: %w","messagePattern":"error reading SSH public key: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/scalewaytasks/sshkey.go","lineNumber":89,"sourceCode":"\t}\n\n\t// Avoid spurious changes\n\tif !strings.Contains(fi.ValueOf(sshKey.KeyPairFingerPrint), fi.ValueOf(s.KeyPairFingerPrint)) {\n\t\treturn nil, fmt.Errorf(\"computed SSH key fingerprint mismatch: %q %q\", fi.ValueOf(s.KeyPairFingerPrint), fi.ValueOf(sshKey.KeyPairFingerPrint))\n\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}","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/scalewaytasks/sshkey.go#L71-L107","documentation":"In the SSHKey task's Run, fi.ResourceAsBytes failed to read the PublicKey resource when the key has no fingerprint yet (first creation). This is a local failure to load the public key material (missing file or unresolvable resource), not a cloud API error.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/scalewaytasks/sshkey.go:89 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the SSH public key resource referenced by the cluster spec exists and is readable","Inspect the wrapped error for the resource-resolution failure","Fix or regenerate the key pair, then 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"}