{"record":{"id":"ec1e7f62fe548256","repo":"kubernetes/kops","slug":"error-creating-healthcheck-v-ec1e7f","errorCode":null,"errorMessage":"error creating Healthcheck: %v","messagePattern":"error creating Healthcheck: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gcetasks/httphealthcheck.go","lineNumber":97,"sourceCode":"\t}\n\treturn nil\n}\n\nfunc (h *HTTPHealthcheck) RenderGCE(t *gce.GCEAPITarget, a, e, changes *HTTPHealthcheck) error {\n\tif a == nil {\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(\"Creating Healthcheck %q\", o.Name)\n\t\tr, err := t.Cloud.Compute().HTTPHealthChecks().Insert(t.Cloud.Project(), o)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error creating 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 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}","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gcetasks/httphealthcheck.go#L79-L115","documentation":"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).","triggerScenarios":"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.","commonSituations":"Two applies racing to create the same health check; quota hit between submit and execute; GCE API instability during the polling window.","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"],"exampleFix":"null","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := t.Cloud.WaitForOp(r); err != nil {\n\tvar gerr *googleapi.Error\n\tif errors.As(err, &gerr) && (gerr.Code == 429 || gerr.Code >= 500) {\n\t\t// backoff, then re-run apply — Find reconciles partial state\n\t}\n}","preventionTips":["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"],"tags":["gce","http-health-check","operation","async-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"}