{"record":{"id":"f268a092427b346c","repo":"kubernetes/kops","slug":"ssh-key-q-not-found-in-akamai-linode","errorCode":null,"errorMessage":"SSH key %q not found in Akamai (Linode)","messagePattern":"SSH key %q not found in Akamai \\(Linode\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/linodetasks/instance.go","lineNumber":293,"sourceCode":"\t\t\t}\n\t\t\tauthorizedKeys = append(authorizedKeys, strings.TrimSpace(publicKey))\n\t\t\tcontinue\n\t\t}\n\n\t\tif keysByName == nil {\n\t\t\tlistedKeys, err := client.ListSSHKeys(context.TODO(), nil)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"error listing Akamai (Linode) SSH keys: %w\", err)\n\t\t\t}\n\t\t\tkeysByName = make(map[string]string, len(listedKeys))\n\t\t\tfor _, listedKey := range listedKeys {\n\t\t\t\tkeysByName[listedKey.Label] = listedKey.SSHKey\n\t\t\t}\n\t\t}\n\n\t\tpublicKey, found := keysByName[fi.ValueOf(key.Name)]\n\t\tif !found {\n\t\t\treturn nil, fmt.Errorf(\"SSH key %q not found in Akamai (Linode)\", fi.ValueOf(key.Name))\n\t\t}\n\t\tauthorizedKeys = append(authorizedKeys, strings.TrimSpace(publicKey))\n\t}\n\n\treturn authorizedKeys, nil\n}\n\n// buildLinodeInterfaces builds the Akamai (Linode) interfaces for the instance based on the subnet ID and whether a public interface is required.\nfunc buildLinodeInterfaces(subnetID int, requirePublicInterface bool) []linodego.LinodeInterfaceCreateOptions {\n\tvar interfaces []linodego.LinodeInterfaceCreateOptions\n\tif requirePublicInterface {\n\t\tinterfaces = append(interfaces, linodego.LinodeInterfaceCreateOptions{\n\t\t\tPublic: &linodego.PublicInterfaceCreateOptions{},\n\t\t})\n\t}\n\tinterfaces = append(interfaces, linodego.LinodeInterfaceCreateOptions{\n\t\tVPC: &linodego.VPCInterfaceCreateOptions{SubnetID: subnetID},\n\t})","sourceCodeStart":275,"sourceCodeEnd":311,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/linodetasks/instance.go#L275-L311","documentation":"After listing the account's SSH keys, resolveAuthorizedKeys looks up each name-referenced key in the label map. It throws this when no Linode SSH key with that label exists, so the key cannot be added to authorized_keys.","triggerScenarios":"A cluster spec AuthorizedKeys entry uses Name to reference a key whose label does not match any SSH key registered in the Linode account.","commonSituations":"Typo in the key name, the key was deleted from the Linode account, or the key exists in a different Linode account than the token targets.","solutions":["Upload the missing SSH key to the Linode account (linode-cli sshkeys create or the Cloud Manager)","Correct the Name in the cluster spec to match the existing key label exactly","Or replace the name reference with inline PublicKey content"],"exampleFix":"// before\n- name: my-ssh-key\n// after\n- name: my-ssh-key-prod  # matches a key registered in the Linode account","handlingStrategy":"validation","validationCode":"keys, _ := client.ListSSHKeys(ctx, nil)\nfor _, ref := range keyNameRefs {\n    if !slices.ContainsFunc(keys, func(k linodego.SSHKey) bool { return k.Label == ref }) {\n        return fmt.Errorf(\"SSH key %q not registered in Linode account\", ref)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Cross-check spec key names against `linode-cli sshkeys list` before applying","Upload keys to Linode before referencing them by name","Prefer inline PublicKey content to eliminate the lookup"],"tags":["ssh","linode","lookup"],"backgroundTag":"ssh-key-not-found","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"}