{"record":{"id":"138704d25a6748a9","repo":"Dokploy/dokploy","slug":"not-found-138704","errorCode":"NOT_FOUND","errorMessage":"MySql not found","messagePattern":"MySql not found","errorType":"exception","errorClass":"TRPCError","httpStatus":404,"severity":"error","filePath":"packages/server/src/services/mysql.ts","lineNumber":82,"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: \"MySql not found\",\n\t\t});\n\t}\n\treturn result;\n};\n\nexport const updateMySqlById = async (\n\tmysqlId: string,\n\tmysqlData: Partial<MySql>,\n) => {\n\tconst { appName, ...rest } = mysqlData;\n\tconst result = await db\n\t\t.update(mysql)\n\t\t.set({\n\t\t\t...rest,\n\t\t})\n\t\t.where(eq(mysql.mysqlId, mysqlId))","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/Dokploy/dokploy/blob/546686ea3587f12ec5652217dedd9f7960fb6d15/packages/server/src/services/mysql.ts#L64-L100","documentation":"findMySqlById fetches a mysql service with its server, mounts, deployments relations; NOT_FOUND is thrown when the query returns nothing for the mysqlId. This is the standard lookup behind the mysql router procedures.","triggerScenarios":"Requesting a mysql service by an ID that does not exist, was deleted, or is filtered out by the scoped where conditions (organization/application).","commonSituations":"Stale ID from an old bookmark/deep link, deleted service, cross-workspace access attempt.","solutions":["List mysql services to confirm the ID is current","If deleted, recreate the service or update the referencing resource","Ensure you are authenticated into the workspace that owns the service"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const all = await listMySql();\nconst ok = all.some(m => m.mysqlId === id);","typeGuard":null,"tryCatchPattern":"try { return await findMySqlById(id); } catch (e) { if (e instanceof TRPCError && e.code === \"NOT_FOUND\") return null; throw e; }","preventionTips":["Never deep-link mysql details without resolving IDs from the list API first"],"tags":["mysql","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"}