{"record":{"id":"50fa32357315f3b8","repo":"kubernetes/kops","slug":"error-getting-healthcheck-q-v","errorCode":null,"errorMessage":"error getting HealthCheck %q: %v","messagePattern":"error getting HealthCheck %q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gcetasks/httphealthcheck.go","lineNumber":55,"sourceCode":"\tPort        *int64\n\tRequestPath *string\n}\n\nvar _ fi.CompareWithID = (*HTTPHealthcheck)(nil)\n\nfunc (e *HTTPHealthcheck) CompareWithID() *string {\n\treturn e.Name\n}\n\nfunc (e *HTTPHealthcheck) Find(c *fi.CloudupContext) (*HTTPHealthcheck, error) {\n\tcloud := c.T.Cloud.(gce.GCECloud)\n\tname := fi.ValueOf(e.Name)\n\tr, err := cloud.Compute().HTTPHealthChecks().Get(cloud.Project(), name)\n\tif err != nil {\n\t\tif gce.IsNotFound(err) {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn nil, fmt.Errorf(\"error getting HealthCheck %q: %v\", name, err)\n\t}\n\tactual := &HTTPHealthcheck{\n\t\tName:        new(r.Name),\n\t\tPort:        new(r.Port),\n\t\tRequestPath: new(r.RequestPath),\n\t\tSelfLink:    r.SelfLink,\n\t}\n\t// System fields\n\tactual.Lifecycle = e.Lifecycle\n\te.SelfLink = r.SelfLink\n\treturn actual, nil\n}\n\nfunc (e *HTTPHealthcheck) Run(c *fi.CloudupContext) error {\n\treturn fi.CloudupDefaultDeltaRunMethod(e, c)\n}\n\nfunc (_ *HTTPHealthcheck) CheckChanges(a, e, changes *HTTPHealthcheck) error {","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gcetasks/httphealthcheck.go#L37-L73","documentation":"HTTPHealthcheck.Find looks up the global HTTP health check via HTTPHealthChecks().Get(project, name). NotFound returns nil (resource absent); every other error is wrapped as this message and fails the reconcile.","triggerScenarios":"cloud.Compute().HTTPHealthChecks().Get fails with a non-NotFound error: IAM denial on compute.healthChecks.get, expired credentials, rate limiting, network failure, or API error.","commonSituations":"Service account lacks compute.healthChecks.get; global vs regional mismatch (HTTPHealthChecks are global; looking in the wrong service surface); transient GCE API outage; token expiry during long applies.","solutions":["Check the wrapped error code: 403 => add compute.healthChecks.get / compute.viewer IAM binding","Retry after backoff for 429/5xx responses","Refresh GCP credentials if authentication errors are wrapped","Confirm the health check name matches what exists (Find uses fi.ValueOf(e.Name))"],"exampleFix":"null","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"var gerr *googleapi.Error\nif errors.As(err, &gerr) {\n\tswitch {\n\tcase gerr.Code == 404: // treat as absent\n\tcase gerr.Code == 429 || gerr.Code >= 500: // retry with backoff\n\tcase gerr.Code == 403: // fix IAM: compute.healthChecks.get\n\t}\n}","preventionTips":["Grant compute.healthChecks.get to the service account","Refresh GCP credentials before long applies","Retry transient API failures instead of aborting the run","Ensure the check name from the spec matches an existing global health check"],"tags":["gce","http-health-check","reconciliation","cloud-api"],"backgroundTag":"gce-api-get-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"}