{"record":{"id":"89c9e89638fb39f1","repo":"kubernetes/kops","slug":"providerid-q-not-recognized-for-node-s-89c9e8","errorCode":null,"errorMessage":"providerID %q not recognized for node %s","messagePattern":"providerID %q not recognized for node (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/nodeidentity/gce/identify.go","lineNumber":102,"sourceCode":"\n\treturn &nodeIdentifier{\n\t\tcomputeService: computeService,\n\t\tproject:        project,\n\t\tclusterName:    clusterName,\n\t\tcapiManager:    capiManager,\n\t}, nil\n}\n\n// IdentifyNode queries GCE for the node identity information\nfunc (i *nodeIdentifier) IdentifyNode(ctx context.Context, node *corev1.Node) (*nodeidentity.Info, error) {\n\t// log := klog.FromContext(ctx)\n\n\tproviderID := node.Spec.ProviderID\n\tif providerID == \"\" {\n\t\treturn nil, fmt.Errorf(\"providerID was not set for node %s\", node.Name)\n\t}\n\tif !strings.HasPrefix(providerID, \"gce://\") {\n\t\treturn nil, fmt.Errorf(\"providerID %q not recognized for node %s\", providerID, node.Name)\n\t}\n\n\ttokens := strings.Split(strings.TrimPrefix(providerID, \"gce://\"), \"/\")\n\tif len(tokens) != 3 {\n\t\treturn nil, fmt.Errorf(\"providerID %q not recognized for node %s\", providerID, node.Name)\n\t}\n\n\tproject := tokens[0]\n\tzone := tokens[1]\n\tinstanceName := tokens[2]\n\n\tif project != i.project {\n\t\treturn nil, fmt.Errorf(\"providerID %q did not match our project %q\", providerID, i.project)\n\t}\n\n\tinstance, err := i.getInstance(zone, instanceName)\n\tif err != nil {\n\t\treturn nil, err","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/nodeidentity/gce/identify.go#L84-L120","documentation":"After confirming the providerID is non-empty, IdentifyNode validates that it starts with the \"gce://\" scheme. ProviderIDs from other clouds (aws://, azure://, etc.) or arbitrary strings cannot be parsed as GCE identifiers, so the node is rejected.","triggerScenarios":"Calling IdentifyNode with a Node whose Spec.ProviderID does not begin with \"gce://\" — e.g. it is \"aws:///us-east-1a/i-0abc\", a bare instance name, or an already-rewritten canonical ID.","commonSituations":"Running the GCE node-identity controller in a hybrid/multi-cloud cluster where some nodes are not GCE instances; nodes managed by another cloud provider's CCM; test fixtures with placeholder provider IDs; clusters migrated from another cloud where old providerIDs persist.","solutions":["Verify the Node is actually a GCE instance; only feed GCE nodes to this identifier (check node labels like topology.kubernetes.io/region or the providerID prefix).","If the node belongs to another cloud, use the corresponding nodeidentity package (pkg/nodeidentity/aws, etc.) instead.","If the providerID exists but with a different scheme casing/format, fix the component that set it — the GCE CCM always writes \"gce://\".","For migration scenarios, re-register or patch the node so spec.providerID is the GCE canonical form."],"exampleFix":"// before\nnode.Spec.ProviderID = \"aws:///us-east-1a/i-0abc123\"\ninfo, err := gceIdentifier.IdentifyNode(ctx, node) // not recognized\n// after\nnode.Spec.ProviderID = \"gce://my-project/us-central1-a/my-instance\"\ninfo, err := gceIdentifier.IdentifyNode(ctx, node)","handlingStrategy":"validation","validationCode":"pid := node.Spec.ProviderID\nif !strings.HasPrefix(pid, \"gce://\") {\n    return fmt.Errorf(\"node %s is not a GCE node (providerID %q); use matching cloud identifier\", node.Name, pid)\n}","typeGuard":"func isGCEProviderID(node *corev1.Node) bool {\n    return node != nil && strings.HasPrefix(node.Spec.ProviderID, \"gce://\")\n}","tryCatchPattern":"info, err := identifier.IdentifyNode(ctx, node)\nif err != nil && strings.Contains(err.Error(), \"not recognized\") {\n    // route to the correct cloud's identifier or ignore non-GCE node\n    return routeToCorrectIdentifier(node)\n}","preventionTips":["Filter nodes by providerID prefix before passing to a cloud-specific identifier.","Use the nodeidentity package matching each node's cloud in multi-cloud setups.","Keep providerID scheme lowercase \"gce://\" as written by the GCE CCM.","Audit providerIDs after cloud migrations."],"tags":["gce","kubernetes","node-identity","providerid","validation"],"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-12T12:17:11.808Z"}