{"record":{"id":"7cd9e40138800568","repo":"Dokploy/dokploy","slug":"not-found-7cd9e4","errorCode":"NOT_FOUND","errorMessage":"Project not found","messagePattern":"Project not found","errorType":"exception","errorClass":"TRPCError","httpStatus":404,"severity":"error","filePath":"packages/server/src/services/project.ts","lineNumber":115,"sourceCode":"\t\t\t\t\tpostgres: {\n\t\t\t\t\t\tcolumns: { ...serviceColumns, postgresId: true },\n\t\t\t\t\t\twith: { server: { columns: { name: true } } },\n\t\t\t\t\t},\n\t\t\t\t\tredis: {\n\t\t\t\t\t\tcolumns: { ...serviceColumns, redisId: true },\n\t\t\t\t\t\twith: { server: { columns: { name: true } } },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tprojectTags: {\n\t\t\t\twith: {\n\t\t\t\t\ttag: true,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t});\n\tif (!project) {\n\t\tthrow new TRPCError({\n\t\t\tcode: \"NOT_FOUND\",\n\t\t\tmessage: \"Project not found\",\n\t\t});\n\t}\n\treturn project;\n};\n\nexport const deleteProject = async (projectId: string) => {\n\tconst project = await db\n\t\t.delete(projects)\n\t\t.where(eq(projects.projectId, projectId))\n\t\t.returning()\n\t\t.then((value) => value[0]);\n\n\treturn project;\n};\n\nexport const updateProjectById = async (","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/Dokploy/dokploy/blob/546686ea3587f12ec5652217dedd9f7960fb6d15/packages/server/src/services/project.ts#L97-L133","documentation":"findProjectById queries the projects table (with joined relations) by projectId and throws NOT_FOUND when no row matches. It means the project id supplied does not exist in the database (or was deleted). This is the standard lookup guard for all project-scoped operations.","triggerScenarios":"Any tRPC query/mutation that resolves a project by id via findProjectById, with a projectId that doesn't exist, was deleted, or has a typo/whitespace. Also stale UI state after another user deleted the project.","commonSituations":"Project was deleted in another session/tab but the current client still references it; stale projectId cached in frontend state after switching organizations; copy-paste or truncated UUID when calling the API directly.","solutions":["Verify the projectId exists: check the projects table or list projects for the organization","Refresh client state / re-fetch the project list if the project was deleted elsewhere","Ensure the correct organization is active and the id is passed intact (no truncation)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const exists = await trpc.project.list.query({ orgId }).then(ps => ps.some(p => p.projectId === id));","typeGuard":null,"tryCatchPattern":"try { await findProjectById(id) } catch (e) { if (e instanceof TRPCError && e.code === 'NOT_FOUND') { /* drop stale state, redirect to project list */ } }","preventionTips":["Refresh the project list after org switches","Treat NOT_FOUND as a signal to invalidate cached ids"],"tags":["trpc","not-found","project","lookup"],"backgroundTag":"resource-not-found","analyzedSha":"546686ea3587f12ec5652217dedd9f7960fb6d15","analyzedAt":"2026-08-27T05:18:58.095Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}