{"record":{"id":"70c7472907f21d4d","repo":"kubernetes/kops","slug":"found-multiple-ssh-keys-named-q-70c747","errorCode":null,"errorMessage":"found multiple SSH keys named %q","messagePattern":"found multiple SSH keys named %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/scalewaytasks/sshkey.go","lineNumber":61,"sourceCode":"\nfunc (s *SSHKey) CompareWithID() *string {\n\treturn s.Name\n}\n\nfunc (s *SSHKey) Find(c *fi.CloudupContext) (*SSHKey, error) {\n\tcloud := c.T.Cloud.(scaleway.ScwCloud)\n\n\tkeysResp, err := cloud.IamService().ListSSHKeys(&iam.ListSSHKeysRequest{\n\t\tName: s.Name,\n\t}, scw.WithAllPages())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error listing SSH keys: %v\", err)\n\t}\n\tif keysResp.TotalCount == 0 {\n\t\treturn nil, nil\n\t}\n\tif keysResp.TotalCount != 1 {\n\t\treturn nil, fmt.Errorf(\"found multiple SSH keys named %q\", *s.Name)\n\t}\n\n\tklog.V(2).Infof(\"found matching SSH key named %q\", *s.Name)\n\tk := keysResp.SSHKeys[0]\n\tsshKey := &SSHKey{\n\t\tID:                 new(k.ID),\n\t\tName:               new(k.Name),\n\t\tKeyPairFingerPrint: new(k.Fingerprint),\n\t\tLifecycle:          s.Lifecycle,\n\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","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/scalewaytasks/sshkey.go#L43-L79","documentation":"Uniqueness validation in the SSHKey task's Find: ListSSHKeys returned more than one key with the same name in the IAM account, so kOps cannot decide which key the cluster spec refers to. Typically caused by re-running creation under different projects or manually duplicated keys.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/scalewaytasks/sshkey.go:61 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["List SSH keys with the Scaleway CLI and delete the stale duplicate","Keep exactly one key with that name in the account","Re-run the kOps operation"],"exampleFix":null,"handlingStrategy":"validation","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"}