kubernetes/kops · error

providerID %q not recognized for node %s

Error message

providerID %q not recognized for node %s

What it means

The Node's providerID is set but does not use the Hetzner 'hcloud://' scheme, so the Hetzner identifier cannot extract a server ID from it. This guards against Nodes from other clouds or malformed provider IDs reaching the Hetzner lookup path.

Source

Thrown at pkg/nodeidentity/hetzner/identify.go:75

		hcloud.WithApplication("kops", version.Version),
	}
	hcloudClient := hcloud.NewClient(opts...)

	return &nodeIdentifier{
		client:       hcloudClient,
		cache:        expirationcache.NewTTLStore(stringKeyFunc, cacheTTL),
		cacheEnabled: cacheNodeidentityInfo,
	}, nil
}

// IdentifyNode queries Hetzner Cloud for the node identity information
func (i *nodeIdentifier) IdentifyNode(ctx context.Context, node *corev1.Node) (*nodeidentity.Info, error) {
	providerID := node.Spec.ProviderID
	if providerID == "" {
		return nil, fmt.Errorf("providerID not set for node %s", node.Name)
	}
	if !strings.HasPrefix(providerID, "hcloud://") {
		return nil, fmt.Errorf("providerID %q not recognized for node %s", providerID, node.Name)
	}

	serverID := strings.TrimPrefix(providerID, "hcloud://")

	// If caching is enabled try pulling nodeidentity.Info from cache before doing a Hetzner Cloud API call.
	if i.cacheEnabled {
		obj, exists, err := i.cache.GetByKey(serverID)
		if err != nil {
			klog.Warningf("Nodeidentity info cache lookup failure: %v", err)
		}
		if exists {
			return obj.(*nodeidentity.Info), nil
		}
	}

	server, err := i.getServer(serverID)
	if err != nil {
		return nil, err

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Fix the Node's providerID to hcloud://<numeric-server-id>
  2. Recycle Nodes created under a different cloud so they re-register with hcloud:// IDs
  3. Verify the correct cloud provider is configured in the kops cluster spec
  4. If an external CCM writes another format, align the CCM version with kops' expectations

Example fix

// before
providerID: aws:///eu-central-1a/i-0abc123
// after
providerID: hcloud://12345678
Defensive patterns

Strategy: validation

Validate before calling

if !strings.HasPrefix(node.Spec.ProviderID, "hcloud://") { /* route to correct cloud handler */ }

Type guard

func isHcloudProviderID(n *corev1.Node) bool {
  return n != nil && strings.HasPrefix(n.Spec.ProviderID, "hcloud://")
}

Try / catch

info, err := IdentifyNode(ctx, node)
if err != nil && strings.Contains(err.Error(), "not recognized") {
  // node from another cloud or malformed: skip
}

Prevention

When it happens

Trigger: !strings.HasPrefix(providerID, "hcloud://") — e.g. providerID is 'aws:///...', 'gce://...', or a bare server ID without the prefix, for a Node routed to the Hetzner identifier.

Common situations: Cluster migrated from another cloud and Nodes not recycled; hand-edited providerID; multiple cloud providers present in one cluster; older kubelet/cloud-controller versions emitting a different format.

Related errors


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