kubernetes/kops · error

error listing Akamai (Linode) SSH keys: %w

Error message

error listing Akamai (Linode) SSH keys: %w

What it means

When an authorized key is referenced by name instead of inline content, resolveAuthorizedKeys lazily lists the account's SSH keys via ListSSHKeys to build a label->key map. This wraps any API failure from that listing call.

Source

Thrown at upup/pkg/fi/cloudup/linodetasks/instance.go:283

	var keysByName map[string]string

	for _, key := range keys {
		if key == nil {
			continue
		}
		if key.PublicKey != nil {
			publicKey, err := fi.ResourceAsString(*key.PublicKey)
			if err != nil {
				return nil, fmt.Errorf("error rendering SSH key data: %w", err)
			}
			authorizedKeys = append(authorizedKeys, strings.TrimSpace(publicKey))
			continue
		}

		if keysByName == nil {
			listedKeys, err := client.ListSSHKeys(context.TODO(), nil)
			if err != nil {
				return nil, fmt.Errorf("error listing Akamai (Linode) SSH keys: %w", err)
			}
			keysByName = make(map[string]string, len(listedKeys))
			for _, listedKey := range listedKeys {
				keysByName[listedKey.Label] = listedKey.SSHKey
			}
		}

		publicKey, found := keysByName[fi.ValueOf(key.Name)]
		if !found {
			return nil, fmt.Errorf("SSH key %q not found in Akamai (Linode)", fi.ValueOf(key.Name))
		}
		authorizedKeys = append(authorizedKeys, strings.TrimSpace(publicKey))
	}

	return authorizedKeys, nil
}

// buildLinodeInterfaces builds the Akamai (Linode) interfaces for the instance based on the subnet ID and whether a public interface is required.

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Verify the Linode API token is valid and has read access
  2. Check network connectivity to api.linode.com
  3. Retry the apply (transient API errors often resolve)
  4. Alternatively provide the key inline as PublicKey to avoid the lookup
Defensive patterns

Strategy: retry

Validate before calling

// verify token works before applying
if _, err := client.ListSSHKeys(ctx, nil); err != nil { return fmt.Errorf("linode API check failed: %w", err) }

Try / catch

listedKeys, err := client.ListSSHKeys(ctx, nil)
if err != nil {
    // retry with backoff; abort with wrapped error if persistent
    return nil, fmt.Errorf("error listing Akamai (Linode) SSH keys: %w", err)
}

Prevention

When it happens

Trigger: client.ListSSHKeys fails — bad/expired API token, network error, or Linode API outage — while resolving a name-referenced SSH key during RenderLinode.

Common situations: Expired or scope-limited LINODE_TOKEN, connectivity/DNS problems from a CI runner, or a transient Linode API error.

Related errors


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