kubernetes/kops · error
error creating Healthcheck: %v
Error message
error creating Healthcheck: %v
What it means
After a successful Insert, RenderGCE waits for the returned long-running operation via t.Cloud.WaitForOp(r). An error here means the create operation was submitted but failed to complete successfully (or polling failed).
Source
Thrown at upup/pkg/fi/cloudup/gcetasks/httphealthcheck.go:97
}
return nil
}
func (h *HTTPHealthcheck) RenderGCE(t *gce.GCEAPITarget, a, e, changes *HTTPHealthcheck) error {
if a == nil {
o := &compute.HttpHealthCheck{
Name: fi.ValueOf(e.Name),
Port: fi.ValueOf(e.Port),
RequestPath: fi.ValueOf(e.RequestPath),
}
klog.V(4).Infof("Creating Healthcheck %q", o.Name)
r, err := t.Cloud.Compute().HTTPHealthChecks().Insert(t.Cloud.Project(), o)
if err != nil {
return fmt.Errorf("error creating Healthcheck %q: %v", o.Name, err)
}
if err := t.Cloud.WaitForOp(r); err != nil {
return fmt.Errorf("error creating Healthcheck: %v", err)
}
h.SelfLink = r.TargetLink
} else if changes.Port != nil || changes.RequestPath != nil {
// Insert only applies these on create, so reconcile changes to an existing check with a separate Update.
o := &compute.HttpHealthCheck{
Name: fi.ValueOf(e.Name),
Port: fi.ValueOf(e.Port),
RequestPath: fi.ValueOf(e.RequestPath),
}
klog.V(4).Infof("Updating Healthcheck %q", o.Name)
r, err := t.Cloud.Compute().HTTPHealthChecks().Update(t.Cloud.Project(), o.Name, o)
if err != nil {
return fmt.Errorf("error updating Healthcheck %q: %v", o.Name, err)
}
if err := t.Cloud.WaitForOp(r); err != nil {
return fmt.Errorf("error updating Healthcheck: %v", err)
}View on GitHub (pinned to 4c8573c808)
Solutions
- Look up the operation result/error in GCE Cloud Logging to see the backend rejection reason
- Re-run the apply after backoff — Find will then reconcile against whatever was actually created
- Eliminate concurrent operations on the same health check (avoid parallel applies to one project)
- Increase quota if the operation failed on quota
Example fix
null
Defensive patterns
Strategy: retry
Try / catch
if err := t.Cloud.WaitForOp(r); err != nil {
var gerr *googleapi.Error
if errors.As(err, &gerr) && (gerr.Code == 429 || gerr.Code >= 500) {
// backoff, then re-run apply — Find reconciles partial state
}
} Prevention
- Serialize applies to the same GCE project to avoid operation conflicts
- Inspect failed operations in the GCE console for the root cause
- Retry idempotently with exponential backoff
- Keep quota headroom before large creates
When it happens
Trigger: The async insert operation fails on the GCE backend: quota enforcement at execution time, conflicting concurrent operation on the same health check name, server-side validation rejection, or polling errors/timeouts.
Common situations: Two applies racing to create the same health check; quota hit between submit and execute; GCE API instability during the polling window.
Related errors
- error waiting for healthcheck: %v
- error parsing operation URL %q: %v
- error creating forwarding rule: %v
- setting ForwardRule labels: %w
- error getting HealthCheck %q: %v
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/ec1e7f62fe548256.
Report an issue: GitHub.