kubernetes/kops · error
error waiting for healthcheck: %v
Error message
error waiting for healthcheck: %v
What it means
After the Insert call returns a GCE long-running operation, RenderGCE waits for it via cloud.WaitForOp(op). If the operation completes with an error (or polling fails), the error is wrapped with this message — meaning creation was submitted but did not finish successfully.
Source
Thrown at upup/pkg/fi/cloudup/gcetasks/healthcheck.go:156
Port: e.Port,
}
default:
hc.Type = "TCP"
hc.TcpHealthCheck = &compute.TCPHealthCheck{
Port: e.Port,
}
}
if a == nil {
klog.V(2).Infof("Creating HealthCheck %q", hc.Name)
op, err := cloud.Compute().RegionHealthChecks().Insert(cloud.Project(), cloud.Region(), hc)
if err != nil {
return fmt.Errorf("error creating healthcheck: %v", err)
}
if err := cloud.WaitForOp(op); err != nil {
return fmt.Errorf("error waiting for healthcheck: %v", err)
}
} else {
return fmt.Errorf("cannot apply changes to healthcheck: %v", changes)
}
return nil
}
type terraformHealthCheckBlock struct {
Port int64 `cty:"port"`
}
type terraformHealthCheck struct {
Name string `cty:"name"`
TCPHealthCheck *terraformHealthCheckBlock `cty:"tcp_health_check"`
SSLHealthCheck *terraformHealthCheckBlock `cty:"ssl_health_check"`
}
View on GitHub (pinned to 4c8573c808)
Solutions
- Check the operation's error details (HTTP error payload) in GCE Cloud Logging / Operations for the specific reason
- Resolve conflicting concurrent operations and re-run the apply
- Retry the apply — it will re-insert after backoff if the check was not created
- Free up regional health-check quota if the error indicates quota
Example fix
null
Defensive patterns
Strategy: retry
Try / catch
if err := cloud.WaitForOp(op); err != nil {
var gerr *googleapi.Error
if errors.As(err, &gerr) && (gerr.Code == 429 || gerr.Code >= 500) {
time.Sleep(backoff)
// re-run apply; Find will reconcile actual state
}
} Prevention
- Avoid concurrent applies against the same GCE project
- Check GCE Operations/Cloud Logging for the async failure reason
- Retry idempotently — the next apply reconciles or recreates
- Provision quota headroom before large cluster changes
When it happens
Trigger: The async insert operation fails during execution: quota exceeded at provisioning time, concurrent conflicting operation on the same health check, invalid resource reached the backend, or the polling loop itself errors/times out.
Common situations: Another operation (delete/update) was in flight on the same health check; regional quota hit between submit and execute; GCE backend rejected fields validated only server-side; transient API errors during polling.
Related errors
- error creating Healthcheck: %v
- error deleting HTTP HealthCheck %s: %v
- error parsing operation URL %q: %v
- error creating forwarding rule: %v
- setting ForwardRule labels: %w
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/84beebad4fdb6664.
Report an issue: GitHub.