{"record":{"id":"769761441a02f7c1","repo":"langflow-ai/langflow","slug":"flow-is-not-accessible","errorCode":null,"errorMessage":"Flow is not accessible","messagePattern":"Flow is not accessible","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"src/backend/base/langflow/api/utils/flow_utils.py","lineNumber":280,"sourceCode":"    if authenticated_user_id is not None:\n        identifier = str(authenticated_user_id)\n        principal_type: Literal[\"user\", \"client\"] = \"user\"\n    else:\n        if client_id is None:\n            raise HTTPException(status_code=400, detail=\"No client_id cookie found\")\n        identifier = client_id\n        principal_type = \"client\"\n    new_flow_id = compute_virtual_flow_id(identifier, flow_id, principal_type=principal_type)\n\n    # Get the user associated with the flow\n    try:\n        from langflow.helpers.user import get_user_by_flow_id_or_endpoint_name\n\n        user = await get_user_by_flow_id_or_endpoint_name(str(flow_id))\n\n    except Exception as exc:\n        await logger.aexception(\"Error getting user for public flow %s\", flow_id)\n        raise HTTPException(status_code=403, detail=\"Flow is not accessible\") from exc\n\n    if not user:\n        raise HTTPException(status_code=403, detail=\"Flow is not accessible\")\n\n    return user, new_flow_id\n","sourceCodeStart":262,"sourceCodeEnd":286,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/api/utils/flow_utils.py#L262-L286","documentation":"After the flow is confirmed public, verify_public_flow_and_get_user() resolves the flow's owner via get_user_by_flow_id_or_endpoint_name(). Any exception from that lookup is logged (logger.aexception) and converted into 403 'Flow is not accessible'. This guards against partial state — a public flow row whose user_id points at a deleted/missing user — so anonymous callers never proceed without an owner context.","triggerScenarios":"The flow row exists and is PUBLIC but its user_id references a deleted user (cascade gaps after user deletion), or the DB lookup itself throws (connection drop, corrupted row, wrong database). The exception is chained (`from exc`), and the server log contains the underlying traceback under 'Error getting user for public flow {flow_id}'.","commonSituations":"User accounts deleted without cascade-deleting or re-assigning their flows; restoring a database dump where user rows are missing; transient DB failures during high load; multi-tenant setups where the flow was migrated between workspaces without its owner.","solutions":["Check the server logs for the chained exception right after 'Error getting user for public flow' — it names the real DB failure.","Verify the flow's user_id in the DB points at an existing user row; if the owner was deleted, either delete the (now orphaned) flow or update its user_id to a valid owner.","If the underlying cause is DB connectivity, fix that (pool size, DB up) and retry the request.","If this reproduces consistently, repair ownership via a migration/script rather than re-sharing the flow."],"exampleFix":"# before: orphaned flow\n-- flow.user_id -> users.id that no longer exists\n\n# after\nUPDATE flow SET user_id = '<valid-admin-uuid>' WHERE id = '<flow_id>';\n-- or delete the orphaned flow","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    user, vfid = await verify_public_flow_and_get_user(flow_id, client_id)\nexcept HTTPException as e:\n    if e.status_code == 403 and e.detail == 'Flow is not accessible':\n        # check server log for 'Error getting user for public flow' — the chained exc is the real cause\n        log_error(f'owner lookup failed for flow {flow_id}'); raise","preventionTips":["Make user deletion cascade or reassign flows (add a test: delete user with public flow).","Monitor for the 'Error getting user for public flow' log line — it carries the root cause.","Periodically audit for flows whose user_id has no matching users row."],"tags":["public-flow","database","data-integrity","http-403"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}