can1357/oh-my-pi · warning · HTTPException
not initialized
Error message
not initialized
What it means
The /readyz readiness probe returns HTTP 503 'not initialized' when the app-state bag has no 'pool' entry — i.e. the SandboxManager workspace pool (and the rest of the orchestrator wiring) has not been attached to the FastAPI app yet, so the instance cannot serve work.
Source
Thrown at python/robomp/src/server.py:324
finally:
await index_sync.stop()
await autoclose.stop()
await pool.stop(
drain_timeout=cfg.shutdown_drain_timeout_seconds,
kill_timeout=cfg.shutdown_kill_timeout_seconds,
)
app = FastAPI(title="robomp", version="0.1.0", lifespan=lifespan)
@app.get("/healthz")
async def healthz() -> dict[str, str]:
return {"status": "ok"}
@app.get("/readyz")
async def readyz(request: Request) -> dict[str, str]:
pool = request.app.state.bag.get("pool")
if pool is None:
raise HTTPException(503, "not initialized")
return {"status": "ready"}
@app.post("/webhook/github")
async def webhook(
request: Request,
x_github_event: str = Header(..., alias="X-GitHub-Event"),
x_github_delivery: str = Header(..., alias="X-GitHub-Delivery"),
x_hub_signature_256: str | None = Header(None, alias="X-Hub-Signature-256"),
) -> JSONResponse:
bag = request.app.state.bag
cfg: Settings = bag["settings"]
body = await request.body()
if not github_events.verify_signature(
cfg.github_webhook_secret.get_secret_value(),
body,
x_hub_signature_256,
):
raise HTTPException(status.HTTP_401_UNAUTHORIZED, "invalid signature")View on GitHub (pinned to 9690622007)
Solutions
- If transient during startup, retry — readiness flips to 200 once the pool is registered.
- Check container logs for a startup exception (e.g. GitCommandError, SystemExit from config) and fix that root cause.
- Verify required env/paths (/data workspaces, sqlite) are writable so initialization completes.
- Only gate deployment readiness on /healthz vs /readyz correctly: 503 here means wait or fix startup.
Defensive patterns
Strategy: fallback
Try / catch
import httpx
r = httpx.get('http://host:8080/readyz')
if r.status_code == 503 and 'not initialized' in r.text:
... # still booting: wait and re-probe; if persistent, check startup logs Prevention
- Configure orchestrator health checks with a startup grace period
- Watch container logs during boot for initialization exceptions
- Treat persistent 503 after startup as a crash signal, not a probe flake
When it happens
Trigger: GET /readyz during startup before _build_orchestrator finishes populating app.state.bag, or if orchestrator build fails/crashes leaving the pool unset.
Common situations: Kubernetes/compose health checks probing during container boot (transient, expected); orchestrator startup crash (git/config error) leaving the app half-initialized; calling /readyz on a manually-constructed create_app() without injecting the pool.
Related errors
- V2 remote compaction failed (${response.status} ${response.s
- No response body for V2 compaction streaming
- Unable to read OMP_AUTH_BROKER_ACCOUNT_POOL_FILE at ${filePa
- Request was aborted.
- Bedrock HTTP ${response.status}: ${errBody.slice(0, 1000)}
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/7adb3d9741f158ee.
Report an issue: GitHub.