{"record":{"id":"dcbe724d33cfef70","repo":"kubernetes/kops","slug":"unable-to-find-specified-ssh-key-q-dcbe72","errorCode":null,"errorMessage":"unable to find specified SSH key %q","messagePattern":"unable to find specified SSH key %q","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/dotasks/sshkey.go","lineNumber":66,"sourceCode":"\treturn e.Name\n}\n\nfunc (e *SSHKey) Find(c *fi.CloudupContext) (*SSHKey, error) {\n\tctx := c.Context()\n\n\tcloud := c.T.Cloud.(do.DOCloud)\n\n\treturn e.find(ctx, cloud)\n}\n\nfunc (e *SSHKey) find(ctx context.Context, cloud do.DOCloud) (*SSHKey, error) {\n\t// We aren't allowed to have two keys with the same fingerprint here.\n\t// So if we find a matching key, we use that one (with that name).\n\n\tk, response, err := cloud.KeysService().GetByFingerprint(ctx, *e.KeyFingerprint)\n\tif response.StatusCode == 404 {\n\t\tif e.IsExistingKey() && *e.Name != \"\" {\n\t\t\treturn nil, fmt.Errorf(\"unable to find specified SSH key %q\", *e.Name)\n\t\t}\n\t\treturn nil, nil\n\t}\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error listing SSH keys: %w\", err)\n\t}\n\n\tactual := &SSHKey{\n\t\tID:             &k.ID,\n\t\tName:           &k.Name,\n\t\tKeyFingerprint: &k.Fingerprint,\n\t}\n\n\tif fi.ValueOf(actual.KeyFingerprint) == fi.ValueOf(e.KeyFingerprint) {\n\t\tklog.V(2).Infof(\"SSH key fingerprints match; assuming public keys match\")\n\t\tactual.PublicKey = e.PublicKey\n\t} else {\n\t\tklog.V(2).Infof(\"Computed SSH key fingerprint mismatch: %q %q\", fi.ValueOf(e.KeyFingerprint), fi.ValueOf(actual.KeyFingerprint))","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/dotasks/sshkey.go#L48-L84","documentation":"Lookup guard in the DO SSH-key Find: the fingerprint lookup returned 404, but the key was declared as pre-existing (IsExistingKey) with a name, so kOps cannot adopt a key that does not exist in the account. Unlike non-existing keys, this is a hard error because the user explicitly referenced the key.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/dotasks/sshkey.go:66 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Upload the SSH public key to DigitalOcean","Fix the key name/fingerprint in the cluster spec","Or remove the existing-key designation so kOps creates a key"],"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-12T12:17:11.808Z"}