{"record":{"id":"8ed2b1778483c02c","repo":"kubernetes/kops","slug":"error-creating-healthcheck-q-v","errorCode":null,"errorMessage":"error creating Healthcheck %q: %v","messagePattern":"error creating Healthcheck %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gcetasks/httphealthcheck.go","lineNumber":94,"sourceCode":"\t}\n\tif a != nil && changes.Name != nil {\n\t\treturn fi.CannotChangeField(\"Name\")\n\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}","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gcetasks/httphealthcheck.go#L76-L112","documentation":"When creating a new HTTPHealthcheck, RenderGCE calls HTTPHealthChecks().Insert. If the synchronous Insert call errors (before waiting on the returned operation), the error is wrapped with the health check name for context.","triggerScenarios":"HTTPHealthChecks().Insert(project, o) fails immediately: invalid HttpHealthCheck spec (bad port/requestPath/host fields), name conflict, quota exceeded, or IAM denial on compute.healthChecks.create.","commonSituations":"Missing compute.healthChecks.create permission; duplicate global health check name; malformed request path from the instance-group/cluster spec; global health-check quota exhausted.","solutions":["Resolve the wrapped googleapi error: fix spec fields (port 1-65535, requestPath starting with /) on validation errors","Grant compute.healthChecks.create IAM permission to the service account","Check/raise the global health check quota, or remove a conflicting same-name check","Retry after backoff for transient 429/5xx"],"exampleFix":"null","handlingStrategy":"validation","validationCode":"// validate before insert\nif o.Port < 1 || o.Port > 65535 { return errors.New(\"invalid port\") }\nif !strings.HasPrefix(o.RequestPath, \"/\") { return errors.New(\"requestPath must start with /\") }","typeGuard":null,"tryCatchPattern":"var gerr *googleapi.Error\nif errors.As(err, &gerr) && gerr.Code == 409 {\n\t// name conflict: the check already exists; fall through to update path\n}","preventionTips":["Validate Port and RequestPath against GCE constraints in the spec","Ensure globally unique health check names in the project","Grant compute.healthChecks.create IAM permission","Monitor global health check quota"],"tags":["gce","http-health-check","create","cloud-api"],"backgroundTag":"gce-api-insert-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"}