{"record":{"id":"47786b0616f59c9d","repo":"bytedance/deer-flow","slug":"console-requires-a-sql-database-backend-set-datab","errorCode":null,"errorMessage":"Console requires a SQL database backend; set database.backend to sqlite or postgres in config.yaml.","messagePattern":"Console requires a SQL database backend; set database\\.backend to sqlite or postgres in config\\.yaml\\.","errorType":"http","errorClass":"HTTPException","httpStatus":503,"severity":"error","filePath":"backend/app/gateway/routers/console.py","lineNumber":124,"sourceCode":"    \"\"\"Daily token-usage series plus per-model breakdown for the window.\"\"\"\n\n    days: list[ConsoleUsageDay]\n    by_model: dict[str, ConsoleUsageModelBreakdown]\n    total_tokens: int\n    total_runs: int\n    total_cost: float | None = Field(default=None, description=\"Estimated spend for the window; null when no pricing is configured\")\n    currency: str | None = Field(default=None, description=\"Display currency taken from the first configured pricing entry\")\n\n\n# ---------------------------------------------------------------------------\n# Helpers\n# ---------------------------------------------------------------------------\n\n\ndef _session_factory_or_503():\n    sf = get_session_factory()\n    if sf is None:\n        raise HTTPException(\n            status_code=503,\n            detail=\"Console requires a SQL database backend; set database.backend to sqlite or postgres in config.yaml.\",\n        )\n    return sf\n\n\ndef _as_utc(dt: datetime | None) -> datetime | None:\n    \"\"\"Normalize DB timestamps: SQLite round-trips them naive, Postgres aware.\"\"\"\n    if dt is None:\n        return None\n    return dt.replace(tzinfo=UTC) if dt.tzinfo is None else dt\n\n\n# ---------------------------------------------------------------------------\n# Pricing — real spend estimation\n# ---------------------------------------------------------------------------\n\n","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/app/gateway/routers/console.py#L106-L142","documentation":"Error \"Console requires a SQL database backend; set database.backend to sqlite or postgres in config.yaml.\" thrown in bytedance/deer-flow.","triggerScenarios":"Thrown at backend/app/gateway/routers/console.py:124 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set database.backend to sqlite or postgres in config.yaml and restart the Gateway.","The console requires persisted SQL state; memory backend is not supported."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}