{"record":{"id":"827fa08e3e94ecac","repo":"Dokploy/dokploy","slug":"not-found-827fa0","errorCode":"NOT_FOUND","errorMessage":"Libsql not found","messagePattern":"Libsql not found","errorType":"exception","errorClass":"TRPCError","httpStatus":404,"severity":"error","filePath":"packages/server/src/services/libsql.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: \"Libsql not found\",\n\t\t});\n\t}\n\treturn result;\n};\n\nexport const updateLibsqlById = async (\n\tlibsqlId: string,\n\tlibsqlData: Partial<Libsql>,\n) => {\n\tconst { appName, ...rest } = libsqlData;\n\tconst result = await db\n\t\t.update(libsql)\n\t\t.set({\n\t\t\t...rest,\n\t\t})\n\t\t.where(eq(libsql.libsqlId, libsqlId))","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/Dokploy/dokploy/blob/546686ea3587f12ec5652217dedd9f7960fb6d15/packages/server/src/services/libsql.ts#L61-L97","documentation":"Thrown by findLibsqlById when the query for a Libsql database (with nested deployments relations) returns null. The requested libsqlId does not exist in the database.","triggerScenarios":"Calling the libsql router's read/update/delete path (findLibsqlById is called by the libsql procedure) with a libsqlId that has no matching row — deleted database, wrong environment, or a malformed/foreign ID.","commonSituations":"Client caches a libsqlId after the DB was destroyed, switching between staging/production servers, or copying an ID from another project.","solutions":["Confirm the libsqlId exists: SELECT * FROM libsql WHERE libsqlId = <id>","Refetch the list of databases from the API and use the current ID","Verify you're authenticated against the correct Dokploy server/URL"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const dbs = await trpc.libsql.list.query();\nif (!dbs.some(d => d.libsqlId === id)) throw new Error('Unknown libsqlId');","typeGuard":"const isLibsql = (r: unknown): r is { libsqlId: string } =>\n  typeof r === 'object' && r !== null && typeof (r as any).libsqlId === 'string';","tryCatchPattern":"try { await findLibsqlById(id); } catch (e) { if (e.code === 'NOT_FOUND') { /* refetch list, drop stale id */ } }","preventionTips":["Always refetch resource IDs before acting","Scope stored IDs per environment"],"tags":["database","not-found","libsql","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"}