kubernetes/kops · error

unable to determine zones in region %q

Error message

unable to determine zones in region %q

What it means

Post-filter guard in GetZones: zones were listed successfully, but none matched the configured region after filtering by parsed region URL. Indicates the cluster's configured region is wrong or has no zones visible to this project.

Source

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

func GetZones(c GCECloud) ([]string, error) {
	var zones []string
	// TODO: Only zones in api.Cluster object, if we have one?
	gceZones, err := c.Compute().Zones().List(context.Background(), c.Project())
	if err != nil {
		return nil, fmt.Errorf("error listing zones: %v", err)
	}
	for _, gceZone := range gceZones {
		u, err := ParseGoogleCloudURL(gceZone.Region)
		if err != nil {
			return nil, err
		}
		if u.Name != c.Region() {
			continue
		}
		zones = append(zones, gceZone.Name)
	}
	if len(zones) == 0 {
		return nil, fmt.Errorf("unable to determine zones in region %q", c.Region())
	}

	klog.Infof("Scanning zones: %v", zones)
	return zones, nil
}

// TODO refactor this out of resources
// this is needed for delete groups and other new methods

// Zones returns the zones in a region
func (c *gceCloudImplementation) Zones() ([]string, error) {
	return GetZones(c)
}

func (c *gceCloudImplementation) WaitForOp(op *compute.Operation) error {
	return WaitForOp(c.compute.srv, op)
}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Correct the region in the cluster spec
  2. Verify the project has access to zones in that region
  3. Check the parsed region matches GCE region naming (e.g. us-central1)
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at upup/pkg/fi/cloudup/gce/gce_cloud.go:301 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/279862e6e8a66956. Report an issue: GitHub.