kubernetes/kops · error
error finding Address with IP=%q: %w
Error message
error finding Address with IP=%q: %w
What it means
After fetching the forwarding rule, Find() resolves its IP address to a GCE static Address resource via findAddressByIP(). If that helper fails (non-NotFound API error), the error is wrapped with %w preserving the cause. This blocks reconciling the forwarding rule's actual state.
Source
Thrown at upup/pkg/fi/cloudup/gcetasks/forwardingrule.go:111
Name: new(r.Name),
IPProtocol: r.IPProtocol,
}
if r.PortRange != "" {
actual.PortRange = &r.PortRange
}
if len(r.Ports) > 0 {
actual.Ports = r.Ports
}
if r.Target != "" {
actual.TargetPool = &TargetPool{
Name: new(lastComponent(r.Target)),
}
}
if r.IPAddress != "" {
address, err := findAddressByIP(cloud, r.IPAddress, r.Subnetwork)
if err != nil {
return nil, fmt.Errorf("error finding Address with IP=%q: %w", r.IPAddress, err)
}
actual.IPAddress = address
}
if r.BackendService != "" {
actual.BackendService = &BackendService{
Name: new(lastComponent(r.BackendService)),
}
}
if r.LoadBalancingScheme != "" {
actual.LoadBalancingScheme = new(r.LoadBalancingScheme)
}
if r.Network != "" {
actual.Network = &Network{
Name: new(lastComponent(r.Network)),
}
}
if r.Subnetwork != "" {
actual.Subnetwork = &Subnet{View on GitHub (pinned to 4c8573c808)
Solutions
- Follow the wrapped cause (%w) to the underlying findAddressByIP error.
- Confirm the IP is a static Address in the same region as the forwarding rule; create one if it is ephemeral.
- Check IAM permissions for compute.addresses.get/list.
- Re-run after verifying project/region configuration if the cause is an API error.
Defensive patterns
Strategy: validation
Validate before calling
// before applying, ensure the forwarding rule's IP is a static regional address:
// gcloud compute addresses list --filter="address=IP AND region=R"
func hasStaticAddress(ips []cloudresourcemanager.Binding, ip, region string) bool { /* query Addresses API; return false if empty */ ; return false } Type guard
func isRegionalAddress(addr *compute.Address, region string) bool {
return addr != nil && addr.Region != "" && strings.HasSuffix(addr.Region, "/regions/"+region) && addr.Address != ""
} Prevention
- Reserve a static regional Address before referencing its IP in a forwarding rule.
- Do not mix global and regional addresses; LB type dictates scope.
- Grant compute.addresses.get/list to the kops service account.
When it happens
Trigger: findAddressByIP returns an error other than not-found — typically a Compute API failure while listing/getting Addresses in the region, or an address in an unexpected project/scope (global vs regional).
Common situations: The IP is a global address but lookup is regional (or vice versa); IAM lacks compute.addresses.list; the forwarding rule references an ephemeral IP with no Address resource and the lookup API call still errors.
Related errors
- error finding Address %q: %v
- error getting ForwardingRule %q: %w
- error getting ForwardingRule %q: %v
- Address %q was not found
- Address had no IP: %v
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/34ab80f49cfe63c4.
Report an issue: GitHub.