{"record":{"id":"1a4fc391242c04f4","repo":"kubernetes/kops","slug":"address-not-found-q-v","errorCode":null,"errorMessage":"address not found %q: %v","messagePattern":"address not found %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gcetasks/instance.go","lineNumber":99,"sourceCode":"\tactual.MachineType = new(lastComponent(r.MachineType))\n\tactual.CanIPForward = &r.CanIpForward\n\tif r.Scheduling != nil {\n\t\tactual.Preemptible = &r.Scheduling.Preemptible\n\t}\n\tif len(r.NetworkInterfaces) != 0 {\n\t\tni := r.NetworkInterfaces[0]\n\t\tactual.Network = &Network{Name: new(lastComponent(ni.Network))}\n\t\tactual.StackType = &ni.StackType\n\t\tif len(ni.AccessConfigs) != 0 {\n\t\t\tac := ni.AccessConfigs[0]\n\t\t\tif ac.NatIP != \"\" {\n\t\t\t\taddrs, err := cloud.Compute().Addresses().ListWithFilter(cloud.Project(), cloud.Region(), \"address eq \"+ac.NatIP)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"error querying for address %q: %v\", ac.NatIP, err)\n\t\t\t\t} else if len(addrs) != 0 {\n\t\t\t\t\tactual.IPAddress = &Address{Name: &addrs[0].Name}\n\t\t\t\t} else {\n\t\t\t\t\treturn nil, fmt.Errorf(\"address not found %q: %v\", ac.NatIP, err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfor _, serviceAccount := range r.ServiceAccounts {\n\t\tfor _, scope := range serviceAccount.Scopes {\n\t\t\tactual.Scopes = append(actual.Scopes, scopeToShortForm(scope))\n\t\t}\n\t}\n\n\tactual.Disks = make(map[string]*Disk)\n\tfor i, disk := range r.Disks {\n\t\tif i == 0 {\n\t\t\tsource := disk.Source\n\n\t\t\t// TODO: Parse source URL instead of assuming same project/zone?\n\t\t\tname := lastComponent(source)","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gcetasks/instance.go#L81-L117","documentation":"During Find, if an instance has a NatIP but no static GCE address matching that IP exists in the region, kOps fails with 'address not found'. Note the %v placeholder is filled with err, which is nil in this branch, so the message ends with '<nil>'. It signals an ephemeral (non-reserved) external IP or a mismatched address record.","triggerScenarios":"Instance's AccessConfig[0].NatIP is set, the address-list query succeeds but returns zero results — the IP is ephemeral, the static address is in another region/project, or was released and the IP reassigned as ephemeral.","commonSituations":"Instance using an ephemeral external IP instead of a reserved one; someone deleted the reserved address; kops state expecting an IPAddress resource that no longer exists; address reserved in a different region.","solutions":["Reserve the IP: `gcloud compute addresses create <name> --addresses=<NatIP> --region=<region>` and reference it via the kops spec, or clear the instance's IPAddress field so kOps treats it as ephemeral","Confirm the address exists in the same region/project as the instance","Check whether another task/spec references a deleted Address task and re-create it"],"exampleFix":"// before (kops cluster spec expecting a static IP that no longer exists)\napi:\n  loadBalancer... / instance with ipAddress: my-static-ip\n// after\neither recreate the address task/resource, or remove ipAddress so an ephemeral IP is used\n","handlingStrategy":"validation","validationCode":"// Confirm the NatIP is a reserved address in the region before Find runs\nfunc assertReservedAddress(project, region, natIP string, svc *compute.Service) error {\n\taddrs, err := svc.Addresses.List(project, region).Filter(\"address eq \"+natIP).Do()\n\tif err != nil { return err }\n\tif len(addrs.Items) == 0 {\n\t\treturn fmt.Errorf(\"%s is ephemeral or not reserved in %s; reserve it or drop the static-IP assumption\", natIP, region)\n\t}\n\treturn nil\n}","typeGuard":"func hasReservedAddress(addrs []*compute.Address, natIP string) bool {\n\tfor _, a := range addrs { if a.Address == natIP { return true } }\n\treturn false\n}","tryCatchPattern":null,"preventionTips":["Reserve external IPs used by kops-managed instances: gcloud compute addresses create","Never delete a reserved address that an instance spec references without updating the spec","Record address region in the cluster spec and keep it in sync with instances","Audit for ephemeral IPs: gcloud compute addresses list shows only reserved ones"],"tags":["gce","address","static-ip"],"backgroundTag":"gce-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"}