kubernetes/kops · error

providerID was not set for node %s

Error message

providerID was not set for node %s

What it means

IdentifyNode was asked to identify a Kubernetes Node whose spec.providerID is empty. The AWS identifier requires a provider ID of the form aws:///<zone>/<instance-id> to locate the instance, so node registration fails until the cloud-provider sets it.

Source

Thrown at pkg/nodeidentity/aws/identify.go:94

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

// stringKeyFunc is a string as cache key function
func stringKeyFunc(obj interface{}) (string, error) {
	key := obj.(*nodeidentity.Info).InstanceID
	return key, nil
}

// IdentifyNode queries AWS 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, "aws://") {
		return nil, fmt.Errorf("providerID %q not recognized for node %s", providerID, node.Name)
	}

	tokens := strings.Split(strings.TrimPrefix(providerID, "aws://"), "/")
	if len(tokens) != 3 {
		return nil, fmt.Errorf("providerID %q not recognized for node %s", providerID, node.Name)
	}

	// zone := tokens[1]
	instanceID := tokens[2]

	// If caching is enabled try pulling nodeidentity.Info from cache before
	// doing a EC2 API call.
	if i.cacheEnabled {
		obj, exists, err := i.cache.GetByKey(instanceID)
		if err != nil {

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Ensure the AWS cloud-provider (kubelet --cloud-provider=aws / external CCM) is configured so it stamps node.spec.providerID
  2. Wait for node registration to complete before node-identity lookups
  3. If nodes are imported, patch node.spec.providerID with the correct aws:///<zone>/<instance-id> value
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/nodeidentity/aws/identify.go:94 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/068a6d1f9e3dd60f. Report an issue: GitHub.