{"record":{"id":"6298bef2108286db","repo":"langflow-ai/langflow","slug":"response-model-dump","errorCode":null,"errorMessage":"response.model_dump()","messagePattern":"response\\.model_dump\\(\\)","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"src/backend/base/langflow/api/health_check_router.py","lineNumber":63,"sourceCode":"    user_id = \"da93c2bd-c857-4b10-8c8c-60988103320f\"\n    try:\n        # Check database to query a bogus flow\n        stmt = select(Flow).where(Flow.id == uuid.uuid4())\n        (await session.exec(stmt)).first()\n        response.db = \"ok\"\n    except Exception:  # noqa: BLE001\n        await logger.aexception(\"Error checking database\")\n\n    try:\n        chat = get_chat_service()\n        await chat.set_cache(\"health_check\", str(user_id))\n        await chat.get_cache(\"health_check\")\n        response.chat = \"ok\"\n    except Exception:  # noqa: BLE001\n        await logger.aexception(\"Error checking chat service\")\n\n    if response.has_error():\n        raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=response.model_dump())\n    response.status = \"ok\"\n    return response\n","sourceCodeStart":45,"sourceCodeEnd":66,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/api/health_check_router.py#L45-L66","documentation":"Raised as HTTP 500 by the health-check endpoint when any subsystem check fails: response.has_error() is true after probing the database, the chat/cache service (set_cache/get_cache round-trip), or other registered checks. The detail is response.model_dump() — a dict of per-subsystem statuses, so the failing subsystem is named in the body.","triggerScenarios":"GET /health_check returning 500 when: the database is unreachable, the cache (Redis) backend is down, or chat service cache round-trip fails. Each failed probe logs 'Error checking database' / 'Error checking chat service' with tracebacks.","commonSituations":"Misconfigured LANGFLOW_DATABASE_URL or Redis URL, database container not started, network partitions between services, wrong credentials after rotation.","solutions":["Inspect the 500 body: response.model_dump() lists exactly which check (db/cache/chat) is 'error'","Verify connectivity to the failing service (psql/ping the DB host, redis-cli ping)","Check env vars LANGFLOW_DATABASE_URL, LANGFLOW_CACHE_TYPE and Redis settings in .env","If the database check fails on startup, apply pending migrations (make alembic-upgrade) after DB connectivity is restored"],"exampleFix":"# before: LANGFLOW_DATABASE_URL=postgresql://langflow:wrongpw@db:5432/langflow\n# after\nLANGFLOW_DATABASE_URL=postgresql://langflow:correctpw@db:5432/langflow\n# then: curl -s localhost:7860/health_check | jq  # expect status 'ok'","handlingStrategy":"validation","validationCode":"const healthy = await fetch('/health_check').then(r => r.ok); // deploy gates\n// inspect body on failure: { database: 'error', cache: 'ok', ... }","typeGuard":null,"tryCatchPattern":"try { const h = await healthCheck(); } catch (e) { const failed = e.response.data.detail; // dict naming the failing subsystem\n  pageOncall(failed); }","preventionTips":["Wire /health_check into orchestrator liveness probes and deploy gates","Verify DB and Redis URLs before startup with a connection preflight","Alert on per-subsystem status, not just the HTTP code"],"tags":["health-check","http-500","database","cache","ops"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}