Dokploy/dokploy · error · TRPCError

NOT_FOUND

NOT_FOUND

Error message

Libsql not found

What it means

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.

Source

Thrown at packages/server/src/services/libsql.ts:79

				},
			},
			mounts: true,
			server: true,
			backups: {
				with: {
					destination: {
						columns: {
							accessKey: false,
							secretAccessKey: false,
						},
					},
					deployments: true,
				},
			},
		},
	});
	if (!result) {
		throw new TRPCError({
			code: "NOT_FOUND",
			message: "Libsql not found",
		});
	}
	return result;
};

export const updateLibsqlById = async (
	libsqlId: string,
	libsqlData: Partial<Libsql>,
) => {
	const { appName, ...rest } = libsqlData;
	const result = await db
		.update(libsql)
		.set({
			...rest,
		})
		.where(eq(libsql.libsqlId, libsqlId))

View on GitHub (pinned to 546686ea35)

Solutions

  1. Confirm the libsqlId exists: SELECT * FROM libsql WHERE libsqlId = <id>
  2. Refetch the list of databases from the API and use the current ID
  3. Verify you're authenticated against the correct Dokploy server/URL
Defensive patterns

Strategy: validation

Validate before calling

const dbs = await trpc.libsql.list.query();
if (!dbs.some(d => d.libsqlId === id)) throw new Error('Unknown libsqlId');

Type guard

const isLibsql = (r: unknown): r is { libsqlId: string } =>
  typeof r === 'object' && r !== null && typeof (r as any).libsqlId === 'string';

Try / catch

try { await findLibsqlById(id); } catch (e) { if (e.code === 'NOT_FOUND') { /* refetch list, drop stale id */ } }

Prevention

When it happens

Trigger: 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.

Common situations: Client caches a libsqlId after the DB was destroyed, switching between staging/production servers, or copying an ID from another project.

Related errors


AI-assisted analysis of Dokploy/dokploy@546686ea35 (2026-08-27). Data as JSON: /api/errors/827fa08e3e94ecac. Report an issue: GitHub.