{"record":{"id":"2f3725684907fffc","repo":"langflow-ai/langflow","slug":"str-e","errorCode":null,"errorMessage":"str(e)","messagePattern":"str\\(e\\)","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"src/backend/base/langflow/api/build.py","lineNumber":237,"sourceCode":"        _, event_manager = queue_service.create_queue(job_id)\n        task_coro = generate_flow_events(\n            flow_id=flow_id,\n            background_tasks=background_tasks,\n            event_manager=event_manager,\n            inputs=inputs,\n            data=data,\n            files=files,\n            stop_component_id=stop_component_id,\n            start_component_id=start_component_id,\n            log_builds=log_builds,\n            current_user=current_user,\n            flow_name=flow_name,\n            source_flow_id=source_flow_id,\n        )\n        queue_service.start_job(job_id, task_coro)\n    except Exception as e:\n        await logger.aexception(\"Failed to create queue and start task\")\n        raise HTTPException(status_code=500, detail=str(e)) from e\n    return job_id\n\n\nasync def get_flow_events_response(\n    *,\n    job_id: str,\n    queue_service: JobQueueService,\n    event_delivery: EventDeliveryType,\n):\n    \"\"\"Get events for a specific build job, either as a stream or single event.\"\"\"\n    try:\n        main_queue, event_manager, event_task, _ = queue_service.get_queue_data(job_id)\n        # Refresh the polling-watchdog heartbeat for any client-driven access\n        # (polling and streaming both count as \"client alive\"). No-op for the\n        # in-memory queue or when the watchdog is disabled.\n        touch = getattr(queue_service, \"touch_activity\", None)\n        if touch is not None:\n            await touch(job_id)","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/api/build.py#L219-L255","documentation":"Catch-all raised when anything throws while queuing a flow build: creating the job entry or queue_service.start_job(job_id, task_coro). The original exception message is surfaced verbatim (str(e)) and logged with aexception. Typical roots are Redis connection failures in the job-queue service or errors building the task coroutine.","triggerScenarios":"POST /api/v1/build/{flow_id}/... (or the streaming build endpoint) while LANGFLOW_REDIS_URL points to an unreachable Redis in multi-worker mode; job-queue service not initialized; the task coroutine factory raising before the job starts.","commonSituations":"Redis down or credentials wrong after deploying with the queue/cache service backed by Redis; port-forwarded Redis in Docker not reachable; mixing memory queue with multiple workers.","solutions":["Check the backend log for the aexception entry — str(e) alone is often just 'Connection refused' style text.","Verify LANGFLOW_REDIS_URL / cache config and that Redis is reachable from the backend container.","For single-process dev runs, ensure the in-memory job queue service initialized (no Redis required).","Retry after the backing service is healthy; the job was never started, so no orphan cleanup is needed."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    job_id = await start_build(flow_id)\nexcept HTTPError as e:\n    if e.response.status_code == 500:\n        # job never started; safe to retry once backing service is healthy\n        await wait_for_queue_backend()\n        job_id = await start_build(flow_id)\n    else:\n        raise","preventionTips":["Health-check Redis connectivity before issuing builds in multi-worker deployments.","Monitor for this 500 in dashboards — it usually means infrastructure, not code.","Since start_job failed, no orphan job exists; retries are side-effect-free."],"tags":["build","job-queue","redis","http-500"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}