langflow-ai/langflow · error · HTTPException
response.model_dump()
Error message
response.model_dump()
What it means
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.
Source
Thrown at src/backend/base/langflow/api/health_check_router.py:63
user_id = "da93c2bd-c857-4b10-8c8c-60988103320f"
try:
# Check database to query a bogus flow
stmt = select(Flow).where(Flow.id == uuid.uuid4())
(await session.exec(stmt)).first()
response.db = "ok"
except Exception: # noqa: BLE001
await logger.aexception("Error checking database")
try:
chat = get_chat_service()
await chat.set_cache("health_check", str(user_id))
await chat.get_cache("health_check")
response.chat = "ok"
except Exception: # noqa: BLE001
await logger.aexception("Error checking chat service")
if response.has_error():
raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=response.model_dump())
response.status = "ok"
return response
View on GitHub (pinned to 976ec789d2)
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
Example fix
# before: LANGFLOW_DATABASE_URL=postgresql://langflow:wrongpw@db:5432/langflow # after LANGFLOW_DATABASE_URL=postgresql://langflow:correctpw@db:5432/langflow # then: curl -s localhost:7860/health_check | jq # expect status 'ok'
Defensive patterns
Strategy: validation
Validate before calling
const healthy = await fetch('/health_check').then(r => r.ok); // deploy gates
// inspect body on failure: { database: 'error', cache: 'ok', ... } Try / catch
try { const h = await healthCheck(); } catch (e) { const failed = e.response.data.detail; // dict naming the failing subsystem
pageOncall(failed); } Prevention
- 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
When it happens
Trigger: 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.
Common situations: Misconfigured LANGFLOW_DATABASE_URL or Redis URL, database container not started, network partitions between services, wrong credentials after rotation.
Related errors
- Flow creation failed.
- Database error while activating version. Please try again.
- An internal error occurred while listing flows.
- An internal error occurred while creating the flow.
- Error deleting knowledge base.
AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14).
Data as JSON: /api/errors/6298bef2108286db.
Report an issue: GitHub.