kubernetes/kops · error

error getting TargetPool %q: %v

Error message

error getting TargetPool %q: %v

What it means

Wrapped error from PoolHealthCheck.Find when the TargetPools.Get call (used to inspect health-check membership) fails with a non-404 error. The target pool name is included; causes include permissions, wrong region, or a transient API failure.

Source

Thrown at upup/pkg/fi/cloudup/gcetasks/poolhealthcheck.go:67

			deps = append(deps, task)
		}
	}
	return deps
}

func (e *PoolHealthCheck) CompareWithID() *string {
	return e.Name
}

func (e *PoolHealthCheck) Find(c *fi.CloudupContext) (*PoolHealthCheck, error) {
	cloud := c.T.Cloud.(gce.GCECloud)
	name := fi.ValueOf(e.Pool.Name)
	r, err := cloud.Compute().TargetPools().Get(cloud.Project(), cloud.Region(), name)
	if err != nil {
		if gce.IsNotFound(err) {
			return nil, nil
		}
		return nil, fmt.Errorf("error getting TargetPool %q: %v", name, err)
	}
	if slices.Contains(r.HealthChecks, e.Healthcheck.SelfLink) {
		return &PoolHealthCheck{
			Name:        e.Name,
			Healthcheck: e.Healthcheck,
			Pool:        e.Pool,
			Lifecycle:   e.Lifecycle,
		}, nil
	}
	return nil, nil
}

func (e *PoolHealthCheck) Run(c *fi.CloudupContext) error {
	return fi.CloudupDefaultDeltaRunMethod(e, c)
}

func (_ *PoolHealthCheck) CheckChanges(a, e, changes *PoolHealthCheck) error {
	return nil

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Check the wrapped error for the Google API reason
  2. Confirm the target pool named in the spec exists in the cluster's region
  3. Ensure compute.targetPools.get permission, and retry on transient errors
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at upup/pkg/fi/cloudup/gcetasks/poolhealthcheck.go:67 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/2ef72fbaf2f1e7b9. Report an issue: GitHub.