{"record":{"id":"28161c1097d1547d","repo":"kubernetes/kops","slug":"error-rendering-ssh-public-key-w","errorCode":null,"errorMessage":"error rendering SSH public key: %w","messagePattern":"error rendering SSH public key: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/scalewaytasks/sshkey.go","lineNumber":129,"sourceCode":"func (*SSHKey) RenderScw(t *scaleway.ScwAPITarget, actual, expected, changes *SSHKey) error {\n\tif actual != nil {\n\t\tklog.Infof(\"Scaleway does not support changes to ssh keys for the moment\")\n\t\treturn nil\n\t}\n\n\tname := fi.ValueOf(expected.Name)\n\tif name == \"\" {\n\t\treturn fi.RequiredField(\"Name\")\n\t}\n\tklog.V(2).Infof(\"Creating keypair with name: %q\", name)\n\n\tkeyArgs := &iam.CreateSSHKeyRequest{\n\t\tName: name,\n\t}\n\tif expected.PublicKey != nil {\n\t\td, err := fi.ResourceAsString(*expected.PublicKey)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error rendering SSH public key: %w\", err)\n\t\t}\n\t\tkeyArgs.PublicKey = d\n\t}\n\n\tkey, err := t.Cloud.IamService().CreateSSHKey(keyArgs)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating SSH keypair: %w\", err)\n\t}\n\texpected.KeyPairFingerPrint = new(key.Fingerprint)\n\tklog.V(2).Infof(\"Created a new SSH keypair, id=%q fingerprint=%q\", key.ID, key.Fingerprint)\n\n\treturn nil\n}\n\ntype terraformSSHKey struct {\n\tName      *string `cty:\"name\"`\n\tPublicKey *string `cty:\"public_key\"`\n}","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/scalewaytasks/sshkey.go#L111-L147","documentation":"Thrown in RenderScw while materializing the expected PublicKey resource into a string before creating the Scaleway SSH key. fi.ResourceAsString failed, meaning the resource backing the PublicKey field could not be loaded (missing secret, unreadable file, or failed fetch) — the failure is in reading the resource, not in talking to Scaleway.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/scalewaytasks/sshkey.go:129 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the resource referenced by expected.PublicKey (file, secret, or generated keypair) exists and is readable","If the key comes from a secret, verify the secret was created in an earlier task and its dependency is declared","Inspect the underlying error to see whether it is an auth/path problem on the resource source"],"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-12T07:17:12.445Z"}