{"record":{"id":"d076eddcf6ee5ebb","repo":"ory/hydra","slug":"status-is-not-yet-ok-s","errorCode":null,"errorMessage":"status is not yet ok: %s","messagePattern":"status is not yet ok: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"oryx/httpx/wait_for.go","lineNumber":44,"sourceCode":"\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tres, err := client.Do(req)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer func() {\n\t\t\t_ = res.Body.Close()\n\t\t}()\n\n\t\tbody, err := io.ReadAll(res.Body)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif gjson.GetBytes(body, \"status\").String() != \"ok\" {\n\t\t\treturn errors.Errorf(\"status is not yet ok: %s\", body)\n\t\t}\n\n\t\treturn nil\n\t},\n\t\tappend([]retry.Option{\n\t\t\tretry.DelayType(retry.BackOffDelay),\n\t\t\tretry.Delay(time.Second),\n\t\t\tretry.MaxDelay(time.Second * 2),\n\t\t\tretry.Attempts(20),\n\t\t}, opts...)...)\n}\n","sourceCodeStart":26,"sourceCodeEnd":56,"githubUrl":"https://github.com/ory/hydra/blob/4174065ffb052799890f7480f5360a877a67ffc1/oryx/httpx/wait_for.go#L26-L56","documentation":"This error comes from the httpx WaitFor helper: it polls an HTTP endpoint and parses the JSON body with gjson; if the top-level \"status\" field is not the string \"ok\", it returns 'status is not yet ok: <body>'. It means the service responded, but reports it is not ready/healthy yet (or the body shape is unexpected).","triggerScenarios":"Calling httpx.WaitFor (or a library startup that uses it) against an endpoint whose JSON body has status != \"ok\" at that moment; retries continue via retry.BackOffDelay until deadline.","commonSituations":"Waiting for a service (e.g. Kratos/Oathkeeper/hydra dev server or a migration endpoint) that is still starting up; hitting the wrong port or wrong health endpoint; service permanently degraded so the wait times out with this as the last error.","solutions":["Wait longer / increase the retry deadline — the service may simply still be booting","Check the target service's logs to see why status is not ok (failed migrations, bad config)","Verify you are polling the correct health/status endpoint and port","Inspect the body printed in the error to see the actual status value reported"],"exampleFix":"// before\nhttpx.WaitFor(ctx, \"http://localhost:4434/admin/status\") // fails while service initializes\n// after\nrequire.Eventually(t, func() bool {\n    resp, err := http.Get(\"http://localhost:4434/admin/status\")\n    return err == nil && resp.StatusCode == http.StatusOK\n}, 30*time.Second, 500*time.Millisecond)","handlingStrategy":"retry","validationCode":"func isReady(url string) bool {\n    body, err := http.Get(url)\n    if err != nil { return false }\n    defer body.Body.Close()\n    b, _ := io.ReadAll(body.Body)\n    return gjson.GetBytes(b, \"status\").String() == \"ok\"\n}","typeGuard":null,"tryCatchPattern":"err := httpx.WaitFor(ctx, url)\nif err != nil {\n    var statusErr = err // body is embedded in the message\n    log.Printf(\"service not ready after retries: %v\", statusErr)\n    // inspect service logs before giving up\n}","preventionTips":["Give services enough retry time at startup (increase backoff/deadline)","Poll the documented health/status endpoint on the right port","Check the target service logs when this error persists","Verify the endpoint actually returns JSON with a top-level \"status\" field"],"tags":["http","healthcheck","retry","startup"],"backgroundTag":"health-check-not-ready","analyzedSha":"4174065ffb052799890f7480f5360a877a67ffc1","analyzedAt":"2026-09-03T14:52:41.581Z","contentChangedAt":"2026-09-03T14:52:41.581Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}