{"record":{"id":"496ed8a7ec400cdd","repo":"kubernetes/kops","slug":"error-creating-ssh-keypair-w","errorCode":null,"errorMessage":"error creating SSH keypair: %w","messagePattern":"error creating SSH keypair: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/scalewaytasks/sshkey.go","lineNumber":136,"sourceCode":"\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}\n\nfunc (_ *SSHKey) RenderTerraform(t *terraform.TerraformTarget, actual, expected, changes *SSHKey) error {\n\ttfName := strings.ReplaceAll(fi.ValueOf(expected.Name), \".\", \"-\")\n\tpublicKeyStr, err := fi.ResourceAsString(fi.ValueOf(expected.PublicKey))\n\tif err != nil {\n\t\treturn err\n\t}","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/scalewaytasks/sshkey.go#L118-L154","documentation":"Thrown in RenderScw after building the CreateSSHKeyRequest when the Scaleway IAM API call CreateSSHKey fails. This is a cloud-side failure: invalid credentials, expired token, quota limits, a duplicate key name already registered in the Scaleway project, or a network/API outage.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/scalewaytasks/sshkey.go:136 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error for the Scaleway API status (409 duplicate name, 401 auth, 429 quota/rate limit)","Delete a pre-existing SSH key with the same name in the Scaleway console, or rename the key in the spec","Verify Scaleway API credentials and that the organization/project has SSH key quota available","Retry after transient API errors; the apply is idempotent and will re-render"],"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"}