{"record":{"id":"17df7c3ab5a6faf4","repo":"kubernetes/kops","slug":"error-building-akamai-linode-ssh-key-task-w","errorCode":null,"errorMessage":"error building Akamai (Linode) SSH key task: %w","messagePattern":"error building Akamai \\(Linode\\) SSH key task: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/linodemodel/instances.go","lineNumber":108,"sourceCode":"\t\t\tImage:                  ig.Spec.Image,\n\t\t\tUserData:               userData,\n\t\t\tTags:                   tags,\n\t\t}\n\n\t\tc.AddTask(&instanceGroup)\n\t}\n\n\treturn nil\n}\n\nfunc (b *InstanceModelBuilder) buildSSHKeyTask(c *fi.CloudupModelBuilderContext) (*linodetasks.SSHKey, error) {\n\tif !b.UseSSHKey() {\n\t\treturn nil, nil\n\t}\n\n\tname, err := b.SSHKeyName()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error building Akamai (Linode) SSH key task: %w\", err)\n\t}\n\tname = linode.NormalizeLinodeLabel(name)\n\tif len(name) > maxLinodeSSHKeyNameLength {\n\t\tname = strings.Trim(name[:maxLinodeSSHKeyNameLength], \"-_\")\n\t}\n\n\tsshKeyTask := &linodetasks.SSHKey{\n\t\tName:      new(name),\n\t\tLifecycle: b.SSHKeyLifecycle,\n\t}\n\tif len(b.SSHPublicKeys) > 0 {\n\t\tpublicKey := fi.Resource(fi.NewBytesResource(b.SSHPublicKeys[0]))\n\t\tsshKeyTask.PublicKey = &publicKey\n\t}\n\tc.AddTask(sshKeyTask)\n\n\treturn sshKeyTask, nil\n}","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/linodemodel/instances.go#L90-L126","documentation":"buildSSHKeyTask creates the Linode SSH key task for the cluster and wraps any failure from computing the SSH key name (b.SSHKeyName()) with this error. The underlying cause (e.g. missing cluster name or SSH key naming input) is chained via %w, so the real reason is printed after this message.","triggerScenarios":"Calling kops update cluster for a Linode cluster when SSH keys are enabled (UseSSHKey() true) and SSHKeyName() returns an error — typically because the cluster or keyset name cannot be resolved from the model context.","commonSituations":"Cluster spec missing fields the SSH key name derives from; corrupted cluster name in state store; custom build flows/test harnesses invoking the builder without a fully populated LinodeModelContext.","solutions":["Read the wrapped cause after this message to find the real SSHKeyName() failure.","Verify the cluster name and related spec fields are set correctly in the cluster manifest and state store.","Ensure the cluster was created with a valid name (kops update cluster --name <cluster> with proper KOPS_STATE_STORE access).","If SSH keys are not needed, disable SSH key usage for the instance groups so the task is skipped.","Re-run with -v to trace the model context population."],"exampleFix":"// before: running with an unset cluster name\nkops update cluster\n// after\nkops update cluster --name mycluster.example.com --state s3://my-state-store","handlingStrategy":"try-catch","validationCode":"if clusterName == \"\" {\n    return errors.New(\"cluster name must be set before building Linode SSH key task\")\n}","typeGuard":null,"tryCatchPattern":"sshKeyTask, err := b.buildSSHKeyTask(c)\nif err != nil {\n    return fmt.Errorf(\"failed to build instance model: %w\", err)\n}\n// inspect chained cause: errors.Unwrap / %v will show SSHKeyName's error","preventionTips":["Always pass --name <cluster> and a reachable KOPS_STATE_STORE.","Keep the cluster manifest fields the SSH key name depends on populated.","Test model building with kops create --dry-run before apply.","Confirm SSH keyset exists in state store if SSH access is enabled."],"tags":["linode","ssh","model-builder"],"backgroundTag":"ssh-key-task-build-failed","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"}