{"record":{"id":"6422fa0577efdbd1","repo":"langflow-ai/langflow","slug":"parse-exception-exc-6422fa","errorCode":null,"errorMessage":"parse_exception(exc)","messagePattern":"parse_exception\\(exc\\)","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"src/backend/base/langflow/api/v1/chat.py","lineNumber":617,"sourceCode":"            ),\n        )\n    except Exception as exc:\n        background_tasks.add_task(\n            telemetry_service.log_package_component,\n            ComponentPayload(\n                component_name=vertex_id.split(\"-\")[0],\n                component_id=vertex_id,\n                component_seconds=int(time.perf_counter() - start_time),\n                component_success=False,\n                component_error_message=str(exc),\n                component_run_id=run_id if \"run_id\" in locals() else None,\n            ),\n        )\n        if isinstance(exc, CustomComponentValidationError):\n            raise HTTPException(status_code=400, detail=str(exc)) from exc\n        await logger.aexception(\"Error building Component\")\n        message = parse_exception(exc)\n        raise HTTPException(status_code=500, detail=message) from exc\n\n    return build_response\n\n\nasync def _stream_vertex(flow_id: str, vertex_id: str, chat_service: ChatService):\n    graph = None\n    try:\n        try:\n            cache = await chat_service.get_cache(flow_id)\n        except Exception as exc:  # noqa: BLE001\n            await logger.aexception(\"Error building Component\")\n            yield str(StreamData(event=\"error\", data={\"error\": str(exc)}))\n            return\n\n        if isinstance(cache, CacheMiss):\n            # If there's no cache\n            msg = f\"No cache found for {flow_id}.\"\n            await logger.aerror(msg)","sourceCodeStart":599,"sourceCodeEnd":635,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/api/v1/chat.py#L599-L635","documentation":"Raised as HTTP 500 for any non-CustomComponentValidationError exception while building a single vertex. The detail is produced by parse_exception(exc), Langflow's helper that unwraps nested exception chains to present the most specific root-cause message instead of a generic outer traceback.","triggerScenarios":"POST /build/{flow_id}/vertices/{vertex_id} where the component's build/run raises a runtime error: API auth failure, network timeout to an LLM provider, malformed input data, or a bug in component logic.","commonSituations":"Expired or wrong API keys configured in the component; provider rate limits; vertex receiving inputs of the wrong shape from an upstream node; transient network failures to external services.","solutions":["Read the parse_exception detail — it surfaces the root cause (e.g. '401 Invalid API key'), not just 'Error building Component'.","Fix the root cause in the component's configuration (credentials, model name, endpoint URL) or its input wiring.","Check the server log for the full aexception traceback if the parsed message is insufficient.","Re-run the vertex build after fixing; for transient provider errors, retry with backoff."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"# Preflight external credentials the vertex depends on\nif not os.environ.get(\"OPENAI_API_KEY\"):\n    raise ConfigError(\"Vertex requires OPENAI_API_KEY\")","typeGuard":null,"tryCatchPattern":"try:\n    res = await client.post(vertex_url)\nexcept httpx.HTTPStatusError as e:\n    if e.response.status_code == 500:\n        detail = e.response.json()[\"detail\"]  # parse_exception root cause\n        if \"401\" in detail or \"api key\" in detail.lower():\n            raise CredentialsError(detail) from e\n        raise VertexBuildError(detail) from e\n    raise","preventionTips":["Validate credentials and input shapes before triggering vertex builds.","Retry only errors that look transient (timeouts, 429/5xx in the parsed detail).","Check server logs when the parsed detail is ambiguous — the full traceback is there."],"tags":["langflow","vertex-build","runtime-error","http-500"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}