langflow-ai/langflow · error · HTTPException

Component cache not initialized

Error message

Component cache not initialized

What it means

Error "Component cache not initialized" thrown in langflow-ai/langflow.

Source

Thrown at src/backend/base/langflow/api/v1/flows.py:927

    return compress_response(result)


@router.post("/expand/", status_code=200, dependencies=[Depends(get_current_active_user)], include_in_schema=False)
async def expand_compact_flow_endpoint(
    compact_data: dict,
):
    """Expand a compact flow format (minimal nodes/edges) to the full flow format."""
    from lfx.interface.components import component_cache, get_and_cache_all_types_dict

    from langflow.processing.expand_flow import expand_compact_flow

    # Ensure component cache is loaded
    if component_cache.all_types_dict is None:
        settings_service = get_settings_service()
        await get_and_cache_all_types_dict(settings_service)

    if component_cache.all_types_dict is None:
        raise HTTPException(status_code=500, detail="Component cache not initialized")

    try:
        return expand_compact_flow(compact_data, component_cache.all_types_dict)
    except ValueError as e:
        raise HTTPException(status_code=400, detail=str(e)) from e
    except Exception as e:
        raise HTTPException(status_code=500, detail=str(e)) from e

View on GitHub (pinned to 976ec789d2)

Solutions

  1. Wait for startup to finish so the component cache initializes, then retry.
  2. Restart the server if the cache failed to initialize; check startup logs.

When it happens

Trigger: Occurs when a request needs the component cache before it has been initialized during server startup.

Common situations: See trigger scenarios.


AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14). Data as JSON: /api/errors/90b78a64ed82d2be. Report an issue: GitHub.