{"record":{"id":"9cf4895ee0ffc8a0","repo":"kubernetes/kops","slug":"listing-forwardingrules-w","errorCode":null,"errorMessage":"listing forwardingRules: %w","messagePattern":"listing forwardingRules: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gcetasks/forwardingrule.go","lineNumber":353,"sourceCode":"func (e *ForwardingRule) TerraformLink() *terraformWriter.Literal {\n\tname := fi.ValueOf(e.Name)\n\n\treturn terraformWriter.LiteralSelfLink(\"google_compute_forwarding_rule\", name)\n}\n\nvar _ fi.CloudupProducesDeletions = (*ForwardingRule)(nil)\n\n// FindDeletions implements fi.HasDeletions\nfunc (e *ForwardingRule) FindDeletions(c *fi.CloudupContext) ([]fi.CloudupDeletion, error) {\n\tvar removals []fi.CloudupDeletion\n\n\tif len(e.pruneForwardingRules) != 0 {\n\t\tctx := c.Context()\n\t\tcloud := c.T.Cloud.(gce.GCECloud)\n\n\t\tforwardingRules, err := cloud.Compute().ForwardingRules().List(ctx, cloud.Project(), cloud.Region())\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"listing forwardingRules: %w\", err)\n\t\t}\n\n\t\tfor _, forwardingRule := range forwardingRules {\n\t\t\tprune := false\n\n\t\t\tfor _, rule := range e.pruneForwardingRules {\n\t\t\t\tif rule.Name == forwardingRule.Name {\n\t\t\t\t\tprune = true\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif prune {\n\t\t\t\tremovals = append(removals, &deleteForwardingRule{forwardingRule: forwardingRule})\n\t\t\t}\n\t\t}\n\t}\n\n\treturn removals, nil","sourceCodeStart":335,"sourceCodeEnd":371,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gcetasks/forwardingrule.go#L335-L371","documentation":"FindDeletions lists all regional forwarding rules via ForwardingRules().List to decide which prune-candidate rules (e.pruneForwardingRules) should be deleted. This error wraps a List API failure and aborts deletion detection.","triggerScenarios":"pruneForwardingRules is non-empty (e.g. load balancer mode changed and old rules should be removed) and ForwardingRules().List(ctx, project, region) fails — quota/auth/API errors, wrong region/project, or network issues.","commonSituations":"Expired or revoked service-account credentials; region misconfiguration listing an inaccessible project; transient GCE outage; API rate limiting during large updates.","solutions":["Check the wrapped cause: fix auth (gcloud auth / service-account key), region, or project as indicated","Re-run `kops update cluster` after transient API issues — deletion detection is re-computed each run","Verify compute.forwardingRules.list IAM permission for the kOps service account","Check `gcloud compute forwarding-rules list --regions=<region>` manually to confirm access"],"exampleFix":"null","handlingStrategy":"retry","validationCode":"// pre-flight permission/region check\ncmd := exec.Command(\"gcloud\", \"compute\", \"forwarding-rules\", \"list\", \"--project\", project, \"--regions\", region, \"--format\", \"value(name)\")\nif err := cmd.Run(); err != nil {\n    return fmt.Errorf(\"cannot list forwarding rules in %s/%s: %w\", project, region, err)\n}","typeGuard":null,"tryCatchPattern":"forwardingRules, err := cloud.Compute().ForwardingRules().List(ctx, project, region)\nif err != nil {\n    if isTransient(err) { // 429/5xx: backoff and retry before giving up\n        return retryWithBackoff(func() error { return listAndPrune() })\n    }\n    return nil, fmt.Errorf(\"listing forwardingRules: %w\", err)\n}","preventionTips":["Verify compute.forwardingRules.list IAM permission and correct project/region in the cluster spec","Back off on 429/5xx; list failures during large updates are often rate limits","Refresh credentials before long-running apply operations"],"tags":["gce","forwarding-rule","list","deletion"],"backgroundTag":"gce-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"}