{"record":{"id":"b6d5be114ea7a3bf","repo":"langflow-ai/langflow","slug":"the-database-is-busy-please-retry-the-request","errorCode":null,"errorMessage":"The database is busy. Please retry the request.","messagePattern":"The database is busy\\. Please retry the request\\.","errorType":"http","errorClass":"HTTPException","httpStatus":503,"severity":"error","filePath":"src/backend/base/langflow/api/v1/flows.py","lineNumber":440,"sourceCode":"                    operation=operation,\n                )\n            return await operation()\n\n        return await run_with_lock_retry(\n            update_attempt,\n            session=session,\n            description=f\"update_flow {flow_id}\",\n        )\n    except HTTPException:\n        raise\n    except Exception as e:\n        await araise_if_deployment_guard_error_or_skip(\n            e,\n            log_message=f\"op=update_flow flow_id={flow_id}\",\n        )\n        if is_database_lock_error(e):\n            await logger.awarning(\"op=update_flow flow_id=%s exhausted lock retries\", flow_id)\n            raise HTTPException(\n                status_code=status.HTTP_503_SERVICE_UNAVAILABLE,\n                detail=FLOW_UPDATE_BUSY,\n                headers={\"Retry-After\": \"1\"},\n            ) from e\n        handled_error = _handle_unique_constraint_error(e)\n        if handled_error.status_code != status.HTTP_500_INTERNAL_SERVER_ERROR:\n            raise handled_error from e\n        await logger.aerror(\"op=update_flow flow_id=%s failed with %s\", flow_id, type(e).__name__)\n        raise HTTPException(\n            status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,\n            detail=FLOW_UPDATE_FAILED,\n        ) from e\n\n\n@router.put(\"/{flow_id}\", response_model=FlowRead)\nasync def upsert_flow(\n    *,\n    session: DbSession,","sourceCodeStart":422,"sourceCodeEnd":458,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/api/v1/flows.py#L422-L458","documentation":"Error \"The database is busy. Please retry the request.\" thrown in langflow-ai/langflow.","triggerScenarios":"Occurs when a database lock/timeout (e.g. SQLite 'database is locked') interrupts a flow write; the request should be retried.","commonSituations":"See trigger scenarios.","solutions":["Retry the request; the database was momentarily locked by another transaction.","If using SQLite, reduce concurrent write load or switch to PostgreSQL for production."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}