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 spec.providerID is set but does not carry the expected aws:/// prefix format, so the instance ID cannot be extracted. The prefix/shape check is a type guard over the providerID string; the offending value and node are included in the message.

Source

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

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

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Correct node.spec.providerID to the aws:///<availability-zone>/<instance-id> format
  2. Check whether a wrong cloud-provider integration stamped the providerID
Defensive patterns

Strategy: type-guard

When it happens

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