{"record":{"id":"4e217bbf9df92075","repo":"kubernetes/kops","slug":"error-listing-addresses-v","errorCode":null,"errorMessage":"error listing Addresses: %v","messagePattern":"error listing Addresses: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/resources/gce/gce.go","lineNumber":836,"sourceCode":"\t\t\tklog.Infof(\"Route not found, assuming deleted: %q\", t.SelfLink)\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"error deleting Route %s: %v\", t.SelfLink, err)\n\t}\n\n\treturn c.WaitForOp(op)\n}\n\nfunc (d *clusterDiscoveryGCE) listAddresses() ([]*resources.Resource, error) {\n\tc := d.gceCloud\n\n\tvar resourceTrackers []*resources.Resource\n\n\tctx := context.Background()\n\n\taddrs, err := c.Compute().Addresses().List(ctx, c.Project(), c.Region())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error listing Addresses: %v\", err)\n\t}\n\n\tfor _, a := range addrs {\n\t\tif !d.matchesClusterName(a.Name) {\n\t\t\tklog.V(8).Infof(\"Skipping Address with name %q\", a.Name)\n\t\t\tcontinue\n\t\t}\n\n\t\tresourceTracker := &resources.Resource{\n\t\t\tName:    a.Name,\n\t\t\tID:      a.Name,\n\t\t\tType:    typeAddress,\n\t\t\tDeleter: deleteAddress,\n\t\t\tObj:     a,\n\t\t}\n\n\t\tklog.V(4).Infof(\"Found resource: %s\", a.SelfLink)\n\t\tresourceTrackers = append(resourceTrackers, resourceTracker)","sourceCodeStart":818,"sourceCodeEnd":854,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/resources/gce/gce.go#L818-L854","documentation":"Wraps a failure from Compute Addresses().List in listAddresses, which lists regional static IP addresses and filters by cluster name. A List failure aborts resource discovery for teardown. Unlike newer error paths, this uses %v so the original error is not wrapped for errors.As inspection.","triggerScenarios":"c.Compute().Addresses().List(ctx, project, region) fails with 403 missing compute.addresses.list, 429 quota, 5xx, or an invalid/unsupported region value (e.g. region field empty or mistyped in the cluster spec).","commonSituations":"Region misconfiguration after editing the cluster spec; IAM changes stripping compute.addresses.list; transient GCP outages; service-project credentials lacking access in shared VPC topologies.","solutions":["Verify the cluster's region is valid and matches where addresses were created.","Grant compute.addresses.list (roles/compute.viewer) to the kops credentials.","Retry on 429/5xx; these are transient.","If the region was changed after cluster creation, revert it or list addresses in the original region manually.","Because the error uses %v, check klog output for the raw Google API error string to identify the status."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// validate region and list access before discovery\nif region == \"\" || !strings.Contains(region, \"-\") {\n    return fmt.Errorf(\"invalid region %q in cluster spec\", region)\n}\nif _, err := computeService.Addresses.List(project, region).PageSize(1).Do(); err != nil {\n    if gerr, ok := err.(*googleapi.Error); ok && gerr.Code == 403 {\n        return fmt.Errorf(\"missing compute.addresses.list on %s\", project)\n    }\n}","typeGuard":"func isGCEAPIError(err error) (*googleapi.Error, bool) {\n    var gerr *googleapi.Error\n    return gerr, errors.As(err, &gerr)\n}","tryCatchPattern":"if err := deleteCluster(ctx, c); err != nil {\n    var gerr *googleapi.Error\n    if errors.As(err, &gerr) && (gerr.Code == 429 || gerr.Code >= 500) {\n        // transient: retry after backoff\n    }\n    return err\n}","preventionTips":["Validate the cluster spec region before teardown; don't change region on an existing cluster","Grant compute.addresses.list via roles/compute.viewer","Parse the %v-formatted raw error string to identify the GCP status code","Retry on 429/5xx; these listings are quota-sensitive","Confirm project ID in credentials matches the cluster's project"],"tags":["gce","gcp","addresses","listing","api-error"],"backgroundTag":"gce-api-request-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"}