kubernetes/kops · error

providerID was not set for node %s

Error message

providerID was not set for node %s

What it means

IdentifyNode requires node.Spec.ProviderID to be set, since the Linode... the OpenStack identifier derives the instance ID from it. This error is thrown when the Node object has an empty ProviderID, so no OpenStack server can be looked up.

Source

Thrown at pkg/nodeidentity/openstack/identify.go:98

		Type:   "compute",
		Region: region,
	})
	if err != nil {
		return nil, fmt.Errorf("error building nova client: %v", err)
	}

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

// IdentifyNode queries OpenStack 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 was not set for node %s", node.Name)
	}
	if !strings.HasPrefix(providerID, "openstack://") {
		return nil, fmt.Errorf("providerID %q not recognized for node %s", providerID, node.Name)
	}

	instanceID := strings.TrimPrefix(providerID, "openstack://")
	// instanceid looks like its openstack:/// but no idea is that really correct like that?
	// this supports now both openstack:// and openstack:/// format

	instanceID = strings.TrimPrefix(instanceID, "/")

	// 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(instanceID)
		if err != nil {
			klog.Warningf("Nodeidentity info cache lookup failure: %v", err)
		}
		if exists {

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Ensure the OpenStack cloud-controller-manager is running and configured to set providerIDs on Nodes
  2. Configure kubelet with the proper cloud-provider/cloud-config so ProviderID is populated at registration
  3. Wait for/restart the CCM so the existing Node objects get their providerID backfilled

Example fix

// before
# node has spec.providerID: ""
// after
# openstack CCM sets: spec.providerID: "openstack://<instance-uuid>"
Defensive patterns

Strategy: validation

Validate before calling

if node.Spec.ProviderID == "" {
    return fmt.Errorf("skip IdentifyNode: node %s has empty providerID", node.Name)
}

Type guard

func hasProviderID(n *corev1.Node) bool {
    return n != nil && n.Spec.ProviderID != ""
}

Try / catch

info, err := identifier.IdentifyNode(ctx, node)
if err != nil && strings.Contains(err.Error(), "providerID was not set") {
    // defer identification until the CCM assigns a providerID
    return requeueAfter(ctx, node, time.Minute)
}

Prevention

When it happens

Trigger: IdentifyNode is called for a Node whose Spec.ProviderID is "" — kubelet or the OpenStack cloud-controller-manager never populated it (e.g. --cloud-provider not configured, external CCM missing).

Common situations: Clusters where kubelet runs without a cloud provider so providerID is never set, newly-joined nodes processed before the CCM assigns providerIDs, or nodes registered manually.

Related errors


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