kubernetes/kops · error

error listing forwardingRules: %v

Error message

error listing forwardingRules: %v

What it means

Wraps the compute ForwardingRules().List failure while discovering the API load balancer's ingress IP. Not-found is tolerated (treated as no rules), so this fires only for genuine API errors: permissions on the (possibly shared) network project, quota, or connectivity.

Source

Thrown at upup/pkg/fi/cloudup/gce/gce_cloud.go:339

	// TODO: Add context to GetApiIngressStatus

	var ingresses []fi.ApiIngressStatus

	klog.V(2).Infof("Querying GCE to find forwardingRules for API")
	// These are the ingress rules, so we search for them in the network project.
	_, project, err := ParseNameAndProjectFromNetworkID(cluster.Spec.Networking.NetworkID)
	if err != nil {
		return nil, err
	} else if project == "" {
		project = c.Project()
	}

	forwardingRules, err := c.compute.ForwardingRules().List(context.Background(), project, c.region)
	if err != nil {
		if !IsNotFound(err) {
			forwardingRules = nil
		} else {
			return nil, fmt.Errorf("error listing forwardingRules: %v", err)
		}
	}

	clusterLabel := LabelForCluster(cluster.Name)

	for _, forwardingRule := range forwardingRules {
		if !strings.HasPrefix(forwardingRule.Name, "api-") {
			continue
		}

		if clusterLabel.Value != forwardingRule.Labels[clusterLabel.Key] {
			continue
		}

		if forwardingRule.IPAddress == "" {
			return nil, fmt.Errorf("found forwardingRule %q, but it did not have an IPAddress", forwardingRule.Name)
		}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Grant compute.forwardingRules.list on the network project for shared-VPC setups
  2. Verify the NetworkID project reference
  3. Inspect the wrapped API error and retry transient failures
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at upup/pkg/fi/cloudup/gce/gce_cloud.go:339 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/911faa450e4067c5. Report an issue: GitHub.