{"record":{"id":"c6cf001611a918b4","repo":"Dokploy/dokploy","slug":"not-found-c6cf00","errorCode":"NOT_FOUND","errorMessage":"Mongo not found","messagePattern":"Mongo not found","errorType":"exception","errorClass":"TRPCError","httpStatus":404,"severity":"error","filePath":"packages/server/src/services/mongo.ts","lineNumber":79,"sourceCode":"\t\t\t\t},\n\t\t\t},\n\t\t\tmounts: true,\n\t\t\tserver: true,\n\t\t\tbackups: {\n\t\t\t\twith: {\n\t\t\t\t\tdestination: {\n\t\t\t\t\t\tcolumns: {\n\t\t\t\t\t\t\taccessKey: false,\n\t\t\t\t\t\t\tsecretAccessKey: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tdeployments: true,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t});\n\tif (!result) {\n\t\tthrow new TRPCError({\n\t\t\tcode: \"NOT_FOUND\",\n\t\t\tmessage: \"Mongo not found\",\n\t\t});\n\t}\n\treturn result;\n};\n\nexport const updateMongoById = async (\n\tmongoId: string,\n\tmongoData: Partial<Mongo>,\n) => {\n\tconst { appName, ...rest } = mongoData;\n\tconst result = await db\n\t\t.update(mongo)\n\t\t.set({\n\t\t\t...rest,\n\t\t})\n\t\t.where(eq(mongo.mongoId, mongoId))","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/Dokploy/dokploy/blob/546686ea3587f12ec5652217dedd9f7960fb6d15/packages/server/src/services/mongo.ts#L61-L97","documentation":"Thrown by findMongoById when the MongoDB lookup (including nested deployments) returns null for the given mongoId.","triggerScenarios":"Calling the mongo router's by-ID procedures with a mongoId that doesn't exist — deleted database, wrong environment, or stale client-side ID.","commonSituations":"UI cache referencing a deleted mongo deployment, wrong server URL/API key pointing at another environment.","solutions":["Confirm the mongoId exists in the mongo table","Refetch the mongo list from the API and use a fresh ID","Verify the Dokploy server URL and credentials"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const dbs = await trpc.mongo.list.query();\nif (!dbs.some(d => d.mongoId === id)) throw new Error('Unknown mongoId');","typeGuard":null,"tryCatchPattern":"try { await findMongoById(id); } catch (e) { if (e.code === 'NOT_FOUND') return null; throw e; }","preventionTips":["Refetch mongo lists after deletion events","Don't hard-code IDs in scripts"],"tags":["database","not-found","mongodb","lookup"],"backgroundTag":"resource-not-found-by-id","analyzedSha":"546686ea3587f12ec5652217dedd9f7960fb6d15","analyzedAt":"2026-08-27T05:18:58.095Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}