{"record":{"id":"889294f5c6f47b1d","repo":"kubernetes/kops","slug":"determining-computername-for-s","errorCode":null,"errorMessage":"determining ComputerName for %s","messagePattern":"determining ComputerName for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azure/verifier.go","lineNumber":253,"sourceCode":"\treturn result, nil\n}\n\n// extractNodeIdentity cross-verifies the attested vmId against the Azure API vmId for the claimed resource and\n// extracts the node name and instance group from the API object. desc is a human-readable resource description\n// used in errors and logs.\nfunc extractNodeIdentity(data *attestedData, desc string, apiVMID *string, osProfile *compute.OSProfile, tags map[string]*string) (nodeName, igName string, err error) {\n\tif apiVMID == nil {\n\t\treturn \"\", \"\", fmt.Errorf(\"determining VMID for %s\", desc)\n\t}\n\n\t// Cross-verify: the vmId from the cryptographically signed attested document must match the vmId from the\n\t// Azure API for the claimed resource ID.\n\tklog.V(4).Infof(\"Azure verifier for %s cross-verifying vmId: attested=%q api=%q\", desc, data.VMId, *apiVMID)\n\tif data.VMId != *apiVMID {\n\t\treturn \"\", \"\", fmt.Errorf(\"attested vmId %q does not match %s (API vmId %q)\", data.VMId, desc, *apiVMID)\n\t}\n\tif osProfile == nil || osProfile.ComputerName == nil || *osProfile.ComputerName == \"\" {\n\t\treturn \"\", \"\", fmt.Errorf(\"determining ComputerName for %s\", desc)\n\t}\n\n\tnodeName = strings.ToLower(*osProfile.ComputerName)\n\tigNameTag, ok := tags[InstanceGroupNameTag]\n\tif !ok || igNameTag == nil {\n\t\treturn \"\", \"\", fmt.Errorf(\"determining IG name for %s\", desc)\n\t}\n\tklog.V(4).Infof(\"Azure verifier for %s resolved identity: node=%q instanceGroup=%q\", desc, nodeName, *igNameTag)\n\n\treturn nodeName, *igNameTag, nil\n}\n\n// privateIPEndpoints collects the private IP addresses and nodeup challenge endpoints from a\n// network interface's IP configurations.\nfunc privateIPEndpoints(ni network.Interface, desc string) (addrs, challengeEndpoints []string, err error) {\n\tif ni.Properties == nil {\n\t\treturn nil, nil, fmt.Errorf(\"determining IP configurations for %s network interface\", desc)\n\t}","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azure/verifier.go#L235-L271","documentation":"After vmId cross-verification succeeds, the verifier must map the VM to a Kubernetes node name via the VM's osProfile.computerName. If osProfile is nil or ComputerName is empty/nil, the node name cannot be derived and the token verification fails.","triggerScenarios":"Calling Get on the VM (or VMSS VM) returns a VirtualMachine whose Properties.OSProfile is nil, or whose ComputerName pointer is nil/empty string, and extractNodeIdentity then errors.","commonSituations":"Azure API returned a partial/degraded response (e.g. instanceView-only call or truncated response); VMSS VMs may not populate osProfile the same way; a proxied or stubbed compute client in tests returns minimal objects; API version drift omits the field.","solutions":["Confirm the VM has a valid OS profile with computerName set in the portal/CLI: az vm show --query osProfile.computerName","For scale-set nodes verify the model exposes computerName; otherwise use the VMSS path in the verifier","Retry verification — transient API responses occasionally omit fields; check klog V(4) output","Ensure the verifier's compute SDK version matches the subscription's API behavior (update kOps/Azure SDK modules)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"vm, err := vmsClient.Get(ctx, rg, name, nil)\nif err != nil { return err }\nif vm.Properties == nil || vm.Properties.OSProfile == nil || vm.Properties.OSProfile.ComputerName == nil {\n\treturn fmt.Errorf(\"VM %s has no osProfile.computerName; cannot map to node name\", name)\n}","typeGuard":"func hasComputerName(vm *compute.VirtualMachine) bool {\n\treturn vm != nil && vm.Properties != nil && vm.Properties.OSProfile != nil &&\n\t\tvm.Properties.OSProfile.ComputerName != nil && *vm.Properties.OSProfile.ComputerName != \"\"\n}","tryCatchPattern":"_, _, err := verifier.VerifyToken(ctx, token)\nif err != nil && strings.Contains(err.Error(), \"determining ComputerName\") {\n\t// transient/partial API response: back off and retry once before failing the node\n}","preventionTips":["Don't strip osProfile via custom images or arm templates","Retry verification with backoff on freshly booted nodes","Keep the Azure SDK in kops on a supported API version","Alert on VMs whose osProfile.computerName is empty"],"tags":["azure","compute","nodename"],"backgroundTag":"missing-computername","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"}