kubernetes/kops · error

error listing Akamai (Linode) SSH keys: %w

Error message

error listing Akamai (Linode) SSH keys: %w

What it means

SSHKey.Find wraps the linodego ListSSHKeys error while locating an existing Akamai (Linode) SSH key by label. It fires when the Linode API call fails (auth, rate limit, network), aborting reconciliation of the SSHKey task because current state cannot be determined.

Source

Thrown at upup/pkg/fi/cloudup/linodetasks/sshkey.go:54

}

var _ fi.CloudupTask = &SSHKey{}
var _ fi.CompareWithID = &SSHKey{}

func (s *SSHKey) CompareWithID() *string {
	return s.Name
}

func (s *SSHKey) Find(c *fi.CloudupContext) (*SSHKey, error) {
	cloud := c.T.Cloud.(linode.LinodeCloud)
	name := fi.ValueOf(s.Name)
	if name == "" {
		return nil, fmt.Errorf("SSHKey.Name is required")
	}

	keys, err := cloud.Client().ListSSHKeys(c.Context(), nil)
	if err != nil {
		return nil, fmt.Errorf("error listing Akamai (Linode) SSH keys: %w", err)
	}

	var matched *linodego.SSHKey
	for i := range keys {
		key := &keys[i]
		if key.Label != name {
			continue
		}

		if matched != nil {
			return nil, fmt.Errorf("found multiple SSH keys named %q", name)
		}
		matched = key
	}

	if matched == nil {
		return nil, nil
	}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Verify the API token is valid and has read scopes
  2. Check connectivity to api.linode.com
  3. Retry the apply if the API error was transient
Defensive patterns

Strategy: retry

Validate before calling

// sanity-check API access before running apply
if _, err := client.ListSSHKeys(ctx, nil); err != nil { return err }

Try / catch

keys, err := cloud.Client().ListSSHKeys(ctx, nil)
if err != nil {
    // retry with backoff for transient errors, then wrap and fail
    return nil, fmt.Errorf("error listing Akamai (Linode) SSH keys: %w", err)
}

Prevention

When it happens

Trigger: cloud.Client().ListSSHKeys fails — invalid/expired token, insufficient scopes, network failure, or Linode API error — during Find.

Common situations: Expired LINODE_TOKEN, a token without account read scope, firewall/proxy blocking api.linode.com from a CI environment.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/de8832f9de802d93. Report an issue: GitHub.