kubernetes/kops · error

error listing SSH keys: %v

Error message

error listing SSH keys: %v

What it means

In the SSHKey task's Find, the IAM API ListSSHKeys call (filtered by key name, all pages) failed while trying to locate the existing key pair. Note the message uses %v rather than %w, so the SDK error is stringified, not wrapped. The lookup result decides whether the key must be created.

Source

Thrown at upup/pkg/fi/cloudup/scalewaytasks/sshkey.go:55

	Lifecycle          fi.Lifecycle
	PublicKey          *fi.Resource
	KeyPairFingerPrint *string
}

var _ fi.CompareWithID = (*SSHKey)(nil)

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

func (s *SSHKey) Find(c *fi.CloudupContext) (*SSHKey, error) {
	cloud := c.T.Cloud.(scaleway.ScwCloud)

	keysResp, err := cloud.IamService().ListSSHKeys(&iam.ListSSHKeysRequest{
		Name: s.Name,
	}, scw.WithAllPages())
	if err != nil {
		return nil, fmt.Errorf("error listing SSH keys: %v", err)
	}
	if keysResp.TotalCount == 0 {
		return nil, nil
	}
	if keysResp.TotalCount != 1 {
		return nil, fmt.Errorf("found multiple SSH keys named %q", *s.Name)
	}

	klog.V(2).Infof("found matching SSH key named %q", *s.Name)
	k := keysResp.SSHKeys[0]
	sshKey := &SSHKey{
		ID:                 new(k.ID),
		Name:               new(k.Name),
		KeyPairFingerPrint: new(k.Fingerprint),
		Lifecycle:          s.Lifecycle,
	}

	// Avoid spurious changes

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Check IAM permissions for listing SSH keys
  2. Verify credentials and connectivity to the Scaleway API
  3. Retry the operation
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at upup/pkg/fi/cloudup/scalewaytasks/sshkey.go:55 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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