{"record":{"id":"03ba12fc7bb2908c","repo":"kubernetes/kops","slug":"corresponding-vm-scale-set-not-found-for-role-assi","errorCode":null,"errorMessage":"corresponding VM Scale Set not found for Role Assignment: %s","messagePattern":"corresponding VM Scale Set not found for Role Assignment: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azuretasks/roleassignment.go","lineNumber":114,"sourceCode":"\t}\n\n\t// Query VM Scale Sets and find one that has matching Principal ID.\n\tvs, err := cloud.VMScaleSet().List(context.TODO(), *r.VMScaleSet.ResourceGroup.Name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar foundVMSS *compute.VirtualMachineScaleSet\n\tfor _, v := range vs {\n\t\tif v.Identity == nil {\n\t\t\tcontinue\n\t\t}\n\t\tif *v.Identity.PrincipalID == principalID {\n\t\t\tfoundVMSS = v\n\t\t\tbreak\n\t\t}\n\t}\n\tif foundVMSS == nil {\n\t\treturn nil, fmt.Errorf(\"corresponding VM Scale Set not found for Role Assignment: %s\", *found.ID)\n\t}\n\n\tr.ID = found.ID\n\treturn &RoleAssignment{\n\t\tName:      r.Name,\n\t\tLifecycle: r.Lifecycle,\n\t\tScope:     found.Properties.Scope,\n\t\tVMScaleSet: &VMScaleSet{\n\t\t\tName: foundVMSS.Name,\n\t\t},\n\t\tID:        found.ID,\n\t\tRoleDefID: to.Ptr(filepath.Base(*found.Properties.RoleDefinitionID)),\n\t}, nil\n}\n\n// Run implements fi.Task.Run.\nfunc (r *RoleAssignment) Run(c *fi.CloudupContext) error {\n\treturn fi.CloudupDefaultDeltaRunMethod(r, c)","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azuretasks/roleassignment.go#L96-L132","documentation":"Lookup guard while finding an Azure RoleAssignment: after locating the role assignment by ID, kOps searches VM Scale Sets for one whose principal ID matches, and none matched. Fires when the VMSS backing the assignment does not exist (deleted, wrong resource group, or identity not yet assigned) so the assignment cannot be mapped to a cluster resource.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/azuretasks/roleassignment.go:114 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the VMSS with the matching system-assigned identity principal exists","Wait for the VMSS identity to be assigned and re-run","Delete the orphaned role assignment if its VMSS was intentionally removed"],"exampleFix":null,"handlingStrategy":"validation","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-12T07:17:12.445Z"}