{"record":{"id":"7044e4d868c58e3d","repo":"kubernetes/kops","slug":"error-updating-healthcheck-v","errorCode":null,"errorMessage":"error updating Healthcheck: %v","messagePattern":"error updating Healthcheck: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gcetasks/httphealthcheck.go","lineNumber":114,"sourceCode":"\t\tif err := t.Cloud.WaitForOp(r); err != nil {\n\t\t\treturn fmt.Errorf(\"error creating Healthcheck: %v\", err)\n\t\t}\n\t\th.SelfLink = r.TargetLink\n\t} else if changes.Port != nil || changes.RequestPath != nil {\n\t\t// Insert only applies these on create, so reconcile changes to an existing check with a separate Update.\n\t\to := &compute.HttpHealthCheck{\n\t\t\tName:        fi.ValueOf(e.Name),\n\t\t\tPort:        fi.ValueOf(e.Port),\n\t\t\tRequestPath: fi.ValueOf(e.RequestPath),\n\t\t}\n\n\t\tklog.V(4).Infof(\"Updating Healthcheck %q\", o.Name)\n\t\tr, err := t.Cloud.Compute().HTTPHealthChecks().Update(t.Cloud.Project(), o.Name, o)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error updating Healthcheck %q: %v\", o.Name, err)\n\t\t}\n\t\tif err := t.Cloud.WaitForOp(r); err != nil {\n\t\t\treturn fmt.Errorf(\"error updating Healthcheck: %v\", err)\n\t\t}\n\t}\n\treturn nil\n}\n\ntype terraformHTTPHealthcheck struct {\n\tName        string  `cty:\"name\"`\n\tPort        *int64  `cty:\"port\"`\n\tRequestPath *string `cty:\"request_path\"`\n}\n\nfunc (_ *HTTPHealthcheck) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *HTTPHealthcheck) error {\n\ttf := &terraformHTTPHealthcheck{\n\t\tName:        *e.Name,\n\t\tPort:        e.Port,\n\t\tRequestPath: e.RequestPath,\n\t}\n\treturn t.RenderResource(\"google_compute_http_health_check\", *e.Name, tf)","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gcetasks/httphealthcheck.go#L96-L132","documentation":"In the GCE httphealthcheck task, after the HTTPHealthChecks().Update API call succeeds, kOps waits for the returned GCE operation to complete via WaitForOp. This error wraps any failure from that operation wait — i.e. the update request was accepted but the operation itself failed or errored on the GCE side.","triggerScenarios":"HTTPHealthChecks().Update succeeded but Cloud.WaitForOp(r) returned an error: the GCE operation completed with an error state (e.g. invalid field rejected asynchronously, quota issue, or a transient API failure while polling).","commonSituations":"GCE rejecting healthcheck fields asynchronously (port/path/checkInterval changes conflicting with backend services), transient Google API errors or rate limiting during operation polling, or project-level quotas preventing the update.","solutions":["Inspect the wrapped %v error text for the GCE operation error detail and fix the offending healthcheck field in the cluster spec","Retry `kops update cluster` — operation-poll failures are often transient","Check GCP Console > Compute Engine > Operations (or `gcloud compute operations list`) for the failed operation's message","Verify healthcheck values (port, requestPath, checkIntervalSec, timeoutSec) satisfy GCE constraints"],"exampleFix":"// before\nhc, err := t.Cloud.Compute().HTTPHealthChecks().Get(t.Cloud.Project(), o.Name)\n// adjust fields blindly\n// after\nhc, err := t.Cloud.Compute().HTTPHealthChecks().Get(t.Cloud.Project(), o.Name)\nif err != nil { return fmt.Errorf(\"error getting Healthcheck %q: %v\", o.Name, err) }\n// reconcile fields against hc before issuing Update so the operation cannot fail\n","handlingStrategy":"retry","validationCode":"// Validate healthcheck fields before running update\nfunc validateHealthcheck(hc *compute.HttpHealthCheck) error {\n\tif hc.Port < 1 || hc.Port > 65535 { return fmt.Errorf(\"invalid port %d\", hc.Port) }\n\tif hc.CheckIntervalSec < 1 || hc.TimeoutSec >= hc.CheckIntervalSec { return fmt.Errorf(\"timeoutSec must be < checkIntervalSec\") }\n\tif hc.UnhealthyThreshold < 1 { return fmt.Errorf(\"unhealthyThreshold must be >= 1\") }\n\treturn nil\n}","typeGuard":null,"tryCatchPattern":"if err := t.Cloud.WaitForOp(r); err != nil {\n\tif isTransientOpError(err) {\n\t\t// re-fetch task state and retry the update with backoff\n\t\treturn retryAfterBackoff(func() error { return task.Update(ctx) })\n\t}\n\treturn fmt.Errorf(\"error updating Healthcheck: %v\", err)\n}","preventionTips":["Pre-validate all healthcheck fields against GCE constraints before issuing Update","Check `gcloud compute operations list` after failed updates to read the real operation error","Keep healthcheck settings compatible with the target pools / backend services that reference them","Watch for GCP quota errors in the region before large changes"],"tags":["gce","healthcheck","operation-wait"],"backgroundTag":"gce-operation-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}