{"record":{"id":"33effd4ee5c43722","repo":"langflow-ai/langflow","slug":"starter-project-and-default-project-not-found-ple","errorCode":null,"errorMessage":"Starter project and default project not found. Please create a project and add flows to it.","messagePattern":"Starter project and default project not found\\. Please create a project and add flows to it\\.","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"src/backend/base/langflow/api/v1/flows.py","lineNumber":157,"sourceCode":"    components_only: bool = False,\n    get_all: bool = True,\n    folder_id: UUID | None = None,\n    flow_type: FlowType | None = None,\n    params: Annotated[Params, Depends()],\n    header_flows: bool = False,\n):\n    \"\"\"Retrieve a list of flows with optional pagination, filtering, and header-only mode.\"\"\"\n    try:\n        auth_settings = get_settings_service().auth_settings\n\n        default_folder = (await session.exec(select(Folder).where(Folder.name == DEFAULT_FOLDER_NAME))).first()\n        default_folder_id = default_folder.id if default_folder else None\n\n        starter_folder = (await session.exec(select(Folder).where(Folder.name == STARTER_FOLDER_NAME))).first()\n        starter_folder_id = starter_folder.id if starter_folder else None\n\n        if not starter_folder and not default_folder:\n            raise HTTPException(\n                status_code=404,\n                detail=\"Starter project and default project not found. Please create a project and add flows to it.\",\n            )\n\n        if not folder_id:\n            folder_id = default_folder_id\n\n        # Rows the caller owns outright. Under AUTO_LOGIN the legacy owner-scoped\n        # query also surfaces null-owner flows; keep that in the fallback path\n        # (``fallback_clause``). The SQL prefilter union, however, must NOT\n        # blanket-include null-owner rows: the in-memory fallback routes them\n        # through ``batch_enforce`` (``filter_visible_resources``'s owner_extractor\n        # returns None, which never equals a real user id), so the prefilter keeps\n        # them out of the owned half and a null-owner flow is visible only when the\n        # plugin lists its id. AUTHZ_ENABLED and AUTO_LOGIN are independent flags,\n        # so both can be set — this keeps the two paths consistent regardless.\n        owned_clause = Flow.user_id == current_user.id\n        fallback_clause = owned_clause","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/api/v1/flows.py#L139-L175","documentation":"404 from GET /api/v1/flows/ (the list endpoint): neither the 'Starter' folder (STARTER_FOLDER_NAME) nor the default folder (DEFAULT_FOLDER_NAME) exists in the database. The listing is folder-anchored — it needs at least one of these seed folders to scope the query — so an installation whose initial-setup folder seeding never ran (or was deleted) cannot list flows at all.","triggerScenarios":"Calling the flows listing on a fresh/custom database where initial setup did not create the seed folders, after someone deleted both folders and their flows, or against a database initialized by an external tool that skipped langflow's initial_setup.","commonSituations":"Pointing LANGFLOW_DATABASE_URL at a manually-created schema; running with a DB restored without the seed rows; setups that deliberately strip example content but also removed the folders.","solutions":["Let Langflow run its initial setup against this database (start the server so it seeds the default folder) and retry","Or create the folders via the API/UI so at least the default folder exists, then add flows","If folders were deleted accidentally, restore from a DB backup"],"exampleFix":"-- before: no default folder rows\nSELECT name FROM folder; -- neither 'Starter' nor the default name\n\n-- after: re-seed the default folder (name must match DEFAULT_FOLDER_NAME)\nINSERT INTO folder (id, name, user_id) VALUES (gen_random_uuid(), '<DEFAULT_FOLDER_NAME>', NULL);","handlingStrategy":"fallback","validationCode":"const { data: folders } = await axios.get('/api/v1/folders/');\nconst seeded = folders.some((f) => f.name === DEFAULT_FOLDER_NAME || f.name === STARTER_FOLDER_NAME);","typeGuard":null,"tryCatchPattern":"catch (e) {\n  if (e.response?.status === 404 && /Starter project and default project/.test(e.response.data?.detail))\n    showSetupPrompt();\n  throw e;\n}","preventionTips":["Run the server once against a fresh DB so initial setup seeds folders before clients connect","Include folder-seed verification in deployment smoke tests","When restoring databases, restore the seed folders too"],"tags":["http-404","flows","folders","initial-setup","database-seeding"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}