{"record":{"id":"3ce5359cc08d199c","repo":"kubernetes/kops","slug":"providerid-q-not-recognized-for-node-q","errorCode":null,"errorMessage":"providerID %q not recognized for node %q","messagePattern":"providerID %q not recognized for node %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/nodeidentity/azure/identify.go","lineNumber":77,"sourceCode":"\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &nodeIdentifier{\n\t\tazureClient:  client,\n\t\tcache:        expirationcache.NewTTLStore(stringKeyFunc, cacheTTL),\n\t\tcacheEnabled: cacheNodeidentityInfo,\n\t}, nil\n}\n\n// IdentifyNode queries Azure for the node identity information.\nfunc (i *nodeIdentifier) IdentifyNode(ctx context.Context, node *corev1.Node) (*nodeidentity.Info, error) {\n\tproviderID := node.Spec.ProviderID\n\tif providerID == \"\" {\n\t\treturn nil, fmt.Errorf(\"providerID not set for node %q\", node.Name)\n\t}\n\tif !strings.HasPrefix(providerID, \"azure://\") {\n\t\treturn nil, fmt.Errorf(\"providerID %q not recognized for node %q\", providerID, node.Name)\n\t}\n\n\tvmName, err := getVMNameFromProviderID(providerID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// If caching is enabled, try pulling nodeidentity.Info from the cache before doing an API call.\n\tif i.cacheEnabled {\n\t\tobj, exists, err := i.cache.GetByKey(vmName)\n\t\tif err != nil {\n\t\t\tklog.Warningf(\"Nodeidentity info cache lookup failure: %v\", err)\n\t\t}\n\t\tif exists {\n\t\t\treturn obj.(*nodeidentity.Info), nil\n\t\t}\n\t}\n","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/nodeidentity/azure/identify.go#L59-L95","documentation":"IdentifyNode maps a Kubernetes Node object to cloud identity info by parsing its Spec.ProviderID. If the providerID is present but does not start with the \"azure://\" scheme, kOps cannot treat it as an Azure resource and aborts identification. This indicates the node is running on a different cloud, the Cloud Provider Azure controller hasn't stamped a providerID yet, or the node was created with an unexpected providerID format.","triggerScenarios":"Calling IdentifyNode with a Node whose Spec.ProviderID is non-empty but lacks the \"azure://\" prefix, e.g. \"aws:///us-east-1a/i-abc123\" or a bare VM name. Typically occurs when the nodeidentifier is wired to a cluster whose nodes were provisioned by another cloud provider, or the azure providerID is in a legacy format.","commonSituations":"Running the kOps node-authorizer/azure nodeidentity code against nodes from a mixed or migrated cluster; kubelet's --cloud-provider not being azure so providerID is set by another component; copy-paste of cluster config from an AWS cluster; Azure providerID format changed between CCM versions (e.g. \"azure:///subscriptions/...\" vs \"azure://...\").","solutions":["Verify the Node's spec.providerID starts with \"azure://\" (kubectl get node <name> -o jsonpath='{.spec.providerID}').","Ensure kubelet and cloud-controller-manager are configured with --cloud-provider=azure so they stamp azure-formatted providerIDs.","Check for double-slash legacy format (\"azure:///...\") and update to the current CCM version or normalize the providerID before calling IdentifyNode.","If the node genuinely belongs to another cloud, route it to the matching nodeidentity package (aws/gce/do) instead of the azure one."],"exampleFix":"// before: routing every node through azure identifier\ninfo, err := azureIdentifier.IdentifyNode(ctx, node)\n\n// after: guard on prefix first\nif !strings.HasPrefix(node.Spec.ProviderID, \"azure://\") {\n    return nil, fmt.Errorf(\"skipping non-azure node %q\", node.Name)\n}\ninfo, err := azureIdentifier.IdentifyNode(ctx, node)","handlingStrategy":"validation","validationCode":"if node.Spec.ProviderID == \"\" || !strings.HasPrefix(node.Spec.ProviderID, \"azure://\") {\n    return fmt.Errorf(\"node %q has non-azure providerID %q\", node.Name, node.Spec.ProviderID)\n}","typeGuard":null,"tryCatchPattern":"info, err := identifier.IdentifyNode(ctx, node)\nif err != nil {\n    if strings.Contains(err.Error(), \"not recognized for node\") {\n        // skip non-azure node or route to correct cloud identifier\n        return nil, err\n    }\n    return nil, err\n}","preventionTips":["Always run with --cloud-provider=azure so kubelet stamps canonical providerIDs","Before identifying, filter nodes by providerID prefix (azure://)","Assert providerID format in admission/CI checks when provisioning hybrid clusters"],"tags":["azure","node-identity","provider-id","kops"],"backgroundTag":"invalid-provider-id-format","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}