kubernetes/kops · error
corresponding VM Scale Set not found for Role Assignment: %s
Error message
corresponding VM Scale Set not found for Role Assignment: %s
What it means
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.
Source
Thrown at upup/pkg/fi/cloudup/azuretasks/roleassignment.go:114
}
// Query VM Scale Sets and find one that has matching Principal ID.
vs, err := cloud.VMScaleSet().List(context.TODO(), *r.VMScaleSet.ResourceGroup.Name)
if err != nil {
return nil, err
}
var foundVMSS *compute.VirtualMachineScaleSet
for _, v := range vs {
if v.Identity == nil {
continue
}
if *v.Identity.PrincipalID == principalID {
foundVMSS = v
break
}
}
if foundVMSS == nil {
return nil, fmt.Errorf("corresponding VM Scale Set not found for Role Assignment: %s", *found.ID)
}
r.ID = found.ID
return &RoleAssignment{
Name: r.Name,
Lifecycle: r.Lifecycle,
Scope: found.Properties.Scope,
VMScaleSet: &VMScaleSet{
Name: foundVMSS.Name,
},
ID: found.ID,
RoleDefID: to.Ptr(filepath.Base(*found.Properties.RoleDefinitionID)),
}, nil
}
// Run implements fi.Task.Run.
func (r *RoleAssignment) Run(c *fi.CloudupContext) error {
return fi.CloudupDefaultDeltaRunMethod(r, c)View on GitHub (pinned to 4c8573c808)
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
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at upup/pkg/fi/cloudup/azuretasks/roleassignment.go:114 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/03ba12fc7bb2908c.
Report an issue: GitHub.