{"record":{"id":"06aab7f444f5821b","repo":"Dokploy/dokploy","slug":"not-found-06aab7","errorCode":"NOT_FOUND","errorMessage":"Mount not found","messagePattern":"Mount not found","errorType":"exception","errorClass":"TRPCError","httpStatus":404,"severity":"error","filePath":"packages/server/src/services/mount.ts","lineNumber":136,"sourceCode":"\t\t\t},\n\t\t},\n\t} as const;\n\n\tconst mount = await db.query.mounts.findFirst({\n\t\twhere: eq(mounts.mountId, mountId),\n\t\twith: {\n\t\t\tapplication: serviceWith,\n\t\t\tcompose: serviceWith,\n\t\t\tlibsql: serviceWith,\n\t\t\tmariadb: serviceWith,\n\t\t\tmongo: serviceWith,\n\t\t\tmysql: serviceWith,\n\t\t\tpostgres: serviceWith,\n\t\t\tredis: serviceWith,\n\t\t},\n\t});\n\tif (!mount) {\n\t\tthrow new TRPCError({\n\t\t\tcode: \"NOT_FOUND\",\n\t\t\tmessage: \"Mount not found\",\n\t\t});\n\t}\n\treturn mount;\n};\n\nexport const findMountOrganizationId = async (mountId: string) => {\n\tconst mount = await findMountById(mountId);\n\n\tif (mount.application) {\n\t\treturn mount.application.environment.project.organizationId;\n\t}\n\tif (mount.compose) {\n\t\treturn mount.compose.environment.project.organizationId;\n\t}\n\tif (mount.libsql) {\n\t\treturn mount.libsql.environment.project.organizationId;","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/Dokploy/dokploy/blob/546686ea3587f12ec5652217dedd9f7960fb6d15/packages/server/src/services/mount.ts#L118-L154","documentation":"findMountById queries the mounts table (with joined app/deployments relations) and throws NOT_FOUND when no row matches the given mountId. It is the canonical lookup helper used by the mount router, so any request for a deleted or nonexistent mount surfaces here.","triggerScenarios":"Calling the mount query/procedure with a mountId that does not exist, was deleted, or belongs to a different workspace/organization scope filtered in the where clause.","commonSituations":"Stale mountId cached in the UI after another team member deleted the mount; copy-pasting an ID with a typo; race between delete and read.","solutions":["Verify the mountId exists: select from mounts where mountId = ...","Refresh the mount list in the UI and retry with the current ID","If the mount was deleted intentionally, remove the dangling reference from your config/scripts"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const mounts = await listMounts(appId);\nif (!mounts.some(m => m.mountId === id)) skip();","typeGuard":null,"tryCatchPattern":"try { return await findMountById(id); } catch (e) { if (e instanceof TRPCError && e.code === \"NOT_FOUND\") return null; throw e; }","preventionTips":["Treat mount references as soft: re-verify before use","Refresh lists after team deletions"],"tags":["mount","not-found","database"],"backgroundTag":"record-not-found","analyzedSha":"546686ea3587f12ec5652217dedd9f7960fb6d15","analyzedAt":"2026-08-27T05:18:58.095Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}