{"record":{"id":"5254eb8a2ce951ef","repo":"kubernetes/kops","slug":"error-finding-address-q-v","errorCode":null,"errorMessage":"error finding Address %q: %v","messagePattern":"error finding Address %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gcetasks/forwardingrule.go","lineNumber":190,"sourceCode":"\t}\n\n\tif e.TargetPool != nil {\n\t\to.Target = e.TargetPool.URL(t.Cloud)\n\t}\n\n\tif e.BackendService != nil {\n\t\tif o.Target != \"\" {\n\t\t\treturn fmt.Errorf(\"cannot specify both %q and %q for forwarding rule target.\", o.Target, e.BackendService)\n\t\t}\n\t\to.BackendService = e.BackendService.URL(t.Cloud)\n\t}\n\n\tif e.IPAddress != nil {\n\t\to.IPAddress = fi.ValueOf(e.IPAddress.IPAddress)\n\t\tif o.IPAddress == \"\" {\n\t\t\taddr, err := e.IPAddress.find(t.Cloud)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error finding Address %q: %v\", e.IPAddress, err)\n\t\t\t}\n\t\t\tif addr == nil {\n\t\t\t\treturn fmt.Errorf(\"Address %q was not found\", e.IPAddress)\n\t\t\t}\n\n\t\t\to.IPAddress = fi.ValueOf(addr.IPAddress)\n\t\t\tif o.IPAddress == \"\" {\n\t\t\t\treturn fmt.Errorf(\"Address had no IP: %v\", e.IPAddress)\n\t\t\t}\n\t\t}\n\t}\n\tif o.IPAddress != \"\" && e.RuleIPAddress != nil {\n\t\treturn fmt.Errorf(\"Specified both IP Address and rule-managed IP address: %v, %v\", e.IPAddress, *e.RuleIPAddress)\n\t}\n\tif e.RuleIPAddress != nil {\n\t\to.IPAddress = *e.RuleIPAddress\n\t}\n","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gcetasks/forwardingrule.go#L172-L208","documentation":"When the spec's IPAddress reference is set but has no concrete IP value, RenderGCE calls e.IPAddress.find() to look up the Address task in GCE. Any lookup error is wrapped as 'error finding Address %q: %v'. This is a failed read against the Compute Addresses API during apply.","triggerScenarios":"ForwardingRule spec references an Address task whose IPAddress field is empty and the find() call returns an error (API failure, wrong region, permission denied).","commonSituations":"Referencing a named static address that does not exist in the target region; cross-project address references; IAM missing compute.addresses.get; typo in the address name.","solutions":["Inspect the wrapped %v cause; if not-found, create the static Address or correct its name.","Verify the address exists in the same region as the forwarding rule.","Set the IPAddress field explicitly in the spec to skip the lookup.","Check IAM permissions for compute.addresses.get."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// before applying, confirm the referenced address exists:\n// gcloud compute addresses describe ADDR --region=R --project=P --format=\"value(address)\"","typeGuard":"func addressRefResolvable(ref *Address, addrs []compute.Address) bool {\n  if ref == nil { return true }\n  for _, a := range addrs {\n    if a.Name == fi.ValueOf(ref.Name) { return true }\n  }\n  return false\n}","tryCatchPattern":"err := kopsUpdate()\nif err != nil && strings.Contains(err.Error(), \"error finding Address\") {\n  // address lookup failed: create the address or fix its name, then retry\n  log.Printf(\"address lookup failed: %v\", err)\n}","preventionTips":["Name Address tasks exactly as the GCE Address resources.","Create static addresses in the same region as the forwarding rule before applying.","Set an explicit IP in the spec when lookup resolution is not needed."],"tags":["gce","load-balancer","address","api-error"],"backgroundTag":"address-not-found","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"}