{"record":{"id":"25e4acf7e53cea9f","repo":"kubernetes/kops","slug":"vmscalesetvm-is-missing-id","errorCode":null,"errorMessage":"VMScaleSetVM is missing ID","messagePattern":"VMScaleSetVM is missing ID","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/resources/azure/azure.go","lineNumber":522,"sourceCode":"\tfor lb := range lbs {\n\t\tblocks = append(blocks, toKey(typeLoadBalancer, lb))\n\t}\n\n\treturn &resources.Resource{\n\t\tObj:     vmss,\n\t\tType:    typeVMScaleSet,\n\t\tID:      *vmss.ID,\n\t\tName:    *vmss.Name,\n\t\tDeleter: g.deleteVMScaleSet,\n\t\tBlocks:  blocks,\n\t\tBlocked: blocked,\n\t\tDumper:  DumpVMScaleSet,\n\t}, nil\n}\n\nfunc (g *resourceGetter) toVMScaleSetVMResource(vmss *compute.VirtualMachineScaleSet, vm *compute.VirtualMachineScaleSetVM) (*resources.Resource, error) {\n\tif vm == nil || vm.ID == nil {\n\t\treturn nil, fmt.Errorf(\"VMScaleSetVM is missing ID\")\n\t}\n\tif vmss == nil || vmss.Name == nil || vmss.ID == nil {\n\t\treturn nil, fmt.Errorf(\"VMScaleSet is missing ID or Name\")\n\t}\n\n\trid, err := arm.ParseResourceID(*vm.ID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tinstanceID := rid.Name\n\n\tname := \"\"\n\tif vm.Properties != nil && vm.Properties.OSProfile != nil && vm.Properties.OSProfile.ComputerName != nil {\n\t\tname = *vm.Properties.OSProfile.ComputerName\n\t} else if vm.Name != nil {\n\t\tname = *vm.Name\n\t} else {\n\t\tname = instanceID","sourceCodeStart":504,"sourceCodeEnd":540,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/resources/azure/azure.go#L504-L540","documentation":"Fires in toVMScaleSetVMResource when a VM Scale Set VM instance is nil or has a nil ID, so it cannot be converted into a trackable resource during Azure cluster resource discovery. The input at fault is an incompletely returned VM instance from the Azure API.","triggerScenarios":"Thrown at pkg/resources/azure/azure.go:522 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run discovery; the instance may have been mid-creation/deletion","List VMSS instances via az CLI to find the malformed instance","Delete the broken instance directly in Azure if it persists"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}