{"record":{"id":"bf83e2f7e4699ca3","repo":"kubernetes/kops","slug":"listing-public-ip-addresses-w","errorCode":null,"errorMessage":"listing public ip addresses: %w","messagePattern":"listing public ip addresses: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azure/publicipaddress.go","lineNumber":68,"sourceCode":"\t}\n\treturn &resp.PublicIPAddress, err\n}\n\nfunc (c *publicIPAddressesClientImpl) List(ctx context.Context, resourceGroupName string) ([]*network.PublicIPAddress, error) {\n\tif resourceGroupName == \"\" {\n\t\treturn nil, nil\n\t}\n\n\tvar l []*network.PublicIPAddress\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 public ip addresses: %w\", err)\n\t\t}\n\t\tl = append(l, resp.Value...)\n\t}\n\treturn l, nil\n}\n\nfunc (c *publicIPAddressesClientImpl) Delete(ctx context.Context, resourceGroupName, publicIPAddressName string) error {\n\tfuture, err := c.c.BeginDelete(ctx, resourceGroupName, publicIPAddressName, nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"deleting public ip address: %w\", err)\n\t}\n\tif _, err := future.PollUntilDone(ctx, nil); err != nil {\n\t\treturn fmt.Errorf(\"waiting for public ip address deletion completion: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc newPublicIPAddressesClientImpl(subscriptionID string, cred *azidentity.DefaultAzureCredential) (*publicIPAddressesClientImpl, error) {","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azure/publicipaddress.go#L50-L86","documentation":"This error wraps any failure returned by the Azure SDK pager while iterating pages of public IP addresses in a resource group. kOps' publicIPAddressesClientImpl.List uses azcore's pager; when NextPage fails for any reason other than a tolerable ResourceGroupNotFound, it is wrapped with this message. The underlying cause (auth, network, throttling, bad subscription) is preserved in the wrapped error chain.","triggerScenarios":"Calling List(ctx) on publicIPAddressesClientImpl when pager.NextPage(ctx) returns an error whose ErrorCode is not 'ResourceGroupNotFound' — e.g. invalid subscription ID, expired/missing Azure credentials, network failure, or ARM throttling (429).","commonSituations":"Azure CLI login expired (az login needed); AZURE_SUBSCRIPTION_ID wrong or pointing to a deleted subscription; RBAC lacks Microsoft.Network/publicIPAddresses/read; transient ARM 429/503 during cluster listing.","solutions":["Run 'az login' and 'az account set --subscription <id>' to refresh credentials and confirm the subscription ID passed to newAzureCloud is correct","Verify the identity has Reader on the resource group (Microsoft.Network/publicIPAddresses/read)","Inspect the wrapped error via errors.As(err, *azcore.ResponseError) to read StatusCode/ErrorCode and act on it (retry 429/503)","Retry the listing after a backoff if the error is throttling or transient"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if subID == \"\" || cred == nil { return errors.New(\"azure: subscription ID and credentials required before listing public IPs\") }\nif err := azidentity.NewDefaultAzureCredential(nil); err != nil { /* resolve auth first */ }","typeGuard":"var respErr *azcore.ResponseError\nif errors.As(err, &respErr) { return respErr.StatusCode, respErr.ErrorCode }","tryCatchPattern":"_, err := client.List(ctx)\nvar re *azcore.ResponseError\nif errors.As(err, &re) {\n  if re.StatusCode == 429 || re.StatusCode >= 500 { /* retry with backoff */ }\n  return fmt.Errorf(\"list public IPs (code=%s): %w\", re.ErrorCode, err)\n}","preventionTips":["Run 'az account show' to validate credentials and subscription before cluster operations","Grant the identity Reader on the resource group/subscription","Wrap List calls with exponential backoff retry on 429/5xx","Log the wrapped *azcore.ResponseError ErrorCode for diagnosis"],"tags":["azure","networking","pagination","error-wrapping"],"backgroundTag":"azure-sdk-request-failed","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"}