kubernetes/kops · error

computed SSH key fingerprint mismatch: %q %q

Error message

computed SSH key fingerprint mismatch: %q %q

What it means

Consistency guard in the SSHKey task's Find: the remote key's fingerprint does not contain the locally computed fingerprint of the spec's public key, meaning the key stored in IAM differs from the key kOps intends to use. Applying would create a mismatched key, so Find aborts. Both fingerprints are printed (spec's, then remote's).

Source

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

	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
	if !strings.Contains(fi.ValueOf(sshKey.KeyPairFingerPrint), fi.ValueOf(s.KeyPairFingerPrint)) {
		return nil, fmt.Errorf("computed SSH key fingerprint mismatch: %q %q", fi.ValueOf(s.KeyPairFingerPrint), fi.ValueOf(sshKey.KeyPairFingerPrint))
	}

	klog.V(2).Infof("SSH key fingerprints match; assuming public keys match")
	sshKey.PublicKey = s.PublicKey
	sshKey.KeyPairFingerPrint = s.KeyPairFingerPrint

	return sshKey, nil
}

func (s *SSHKey) Run(c *fi.CloudupContext) error {
	if s.KeyPairFingerPrint == nil && s.PublicKey != nil {
		publicKey, err := fi.ResourceAsString(*s.PublicKey)
		if err != nil {
			return fmt.Errorf("error reading SSH public key: %w", err)
		}

		keyPairFingerPrint, err := pki.ComputeOpenSSHKeyFingerprint(publicKey)
		if err != nil {

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Compare the two fingerprints in the message to confirm the mismatch
  2. Delete the stale key in IAM so kOps recreates it from the spec's public key
  3. Or update the cluster spec to reference the existing public key
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at upup/pkg/fi/cloudup/scalewaytasks/sshkey.go:75 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/cf024e75c3088429. Report an issue: GitHub.