{"record":{"id":"c6c904f9524e4d2a","repo":"kubernetes/kops","slug":"listing-vmsss-w","errorCode":null,"errorMessage":"listing VMSSs: %w","messagePattern":"listing VMSSs: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azure/vmscaleset.go","lineNumber":70,"sourceCode":"\t}\n\treturn &resp.VirtualMachineScaleSet, nil\n}\n\nfunc (c *vmScaleSetsClientImpl) List(ctx context.Context, resourceGroupName string) ([]*compute.VirtualMachineScaleSet, error) {\n\tif resourceGroupName == \"\" {\n\t\treturn nil, nil\n\t}\n\n\tvar l []*compute.VirtualMachineScaleSet\n\tpager := c.c.NewListPager(resourceGroupName, nil)\n\tfor pager.More() {\n\t\tresp, err := pager.NextPage(ctx)\n\t\tif err != nil {\n\t\t\tvar respErr *azcore.ResponseError\n\t\t\tif errors.As(err, &respErr) && respErr.ErrorCode == \"ResourceGroupNotFound\" {\n\t\t\t\treturn nil, nil\n\t\t\t}\n\t\t\treturn nil, fmt.Errorf(\"listing VMSSs: %w\", err)\n\t\t}\n\t\tl = append(l, resp.Value...)\n\t}\n\treturn l, nil\n}\n\nfunc (c *vmScaleSetsClientImpl) Get(ctx context.Context, resourceGroupName string, vmssName string) (*compute.VirtualMachineScaleSet, error) {\n\topts := &compute.VirtualMachineScaleSetsClientGetOptions{\n\t\tExpand: to.Ptr(compute.ExpandTypesForGetVMScaleSetsUserData),\n\t}\n\tresp, err := c.c.Get(ctx, resourceGroupName, vmssName, opts)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"getting VMSS: %w\", err)\n\t}\n\treturn &resp.VirtualMachineScaleSet, nil\n}\n\nfunc (c *vmScaleSetsClientImpl) Delete(ctx context.Context, resourceGroupName, vmssName string) error {","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azure/vmscaleset.go#L52-L88","documentation":"Wrapped when paging through virtual machine scale sets in a resource group fails in vmScaleSetsClientImpl.List (used by kops cloud verification's Run). As with vnet List, a ResourceGroupNotFound ResponseError is tolerated (returns nil, nil); every other pager error is wrapped. It signals that cluster inventory discovery could not enumerate VMSS instances.","triggerScenarios":"List's pager.NextPage(ctx) returns an error other than ResponseError with ErrorCode ResourceGroupNotFound — e.g. AuthorizationFailed, TooManyRequests (429), or a transient network failure.","commonSituations":"Verification against a cluster whose resource group was deleted concurrently (non-404 error path); service principal lacking Microsoft.Compute read; ARM throttling during large verifications; SDK paging across many VMSSs hitting intermittent failures.","solutions":["Grant the principal Reader/Contributor on the resource group (check for AuthorizationFailed in the wrapped error)","Retry with backoff if the error is 429/throttling","Confirm the resource group name in the cluster spec matches Azure (missing groups return empty, other errors do not)","Inspect errors.Unwrap for the underlying azcore.ResponseError code"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Go: ensure RBAC read access before enumerating VMSSs\n// az role assignment create --assignee <principal> --role Reader --resource-group <rg>\nif resourceGroup == \"\" {\n    return fmt.Errorf(\"resource group is required to list VMSSs\")\n}","typeGuard":"func isThrottled(err error) bool {\n    var respErr *azcore.ResponseError\n    return errors.As(err, &respErr) && respErr.StatusCode == http.StatusTooManyRequests\n}","tryCatchPattern":"vmssList, err := vmssClient.List(ctx, rg)\nif err != nil {\n    var respErr *azcore.ResponseError\n    if errors.As(err, &respErr) && respErr.StatusCode == http.StatusTooManyRequests {\n        time.Sleep(retryAfter(respErr))\n        vmssList, err = vmssClient.List(ctx, rg)\n    }\n    if err != nil {\n        return fmt.Errorf(\"VMSS enumeration failed (check RBAC/ResourceGroup): %w\", err)\n    }\n}","preventionTips":["Grant Reader/Contributor on the cluster resource group before verification","Respect Retry-After on 429s during large enumerations","Keep the resource group name in the cluster spec consistent with Azure","Handle transient network errors with bounded retries in verification tooling"],"tags":["azure","go","vmss","compute","list"],"backgroundTag":"azure-api-list-failed","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"}