Dokploy/dokploy · error · TRPCError

NOT_FOUND

NOT_FOUND

Error message

Redis not found

What it means

findRedisById queries the `redis` table (with environment->project, mounts, server relations) by redisId and throws a NOT_FOUND TRPCError when drizzle's findFirst returns undefined. This is the standard Dokploy pattern for lookups: any tRPC procedure that resolves a redisId (e.g. the `redis` router queries, deployRedis) funnels through this check.

Source

Thrown at packages/server/src/services/redis.ts:67

	return newRedis;
};

export const findRedisById = async (redisId: string) => {
	const result = await db.query.redis.findFirst({
		where: eq(redis.redisId, redisId),
		with: {
			environment: {
				with: {
					project: true,
				},
			},
			mounts: true,
			server: true,
		},
	});
	if (!result) {
		throw new TRPCError({
			code: "NOT_FOUND",
			message: "Redis not found",
		});
	}
	return result;
};

export const updateRedisById = async (
	redisId: string,
	redisData: Partial<Redis>,
) => {
	const { appName, ...rest } = redisData;
	const result = await db
		.update(redis)
		.set({
			...rest,
		})
		.where(eq(redis.redisId, redisId))

View on GitHub (pinned to 546686ea35)

Solutions

  1. Verify the redisId exists: list redis databases for the project and confirm the ID matches
  2. If the record was deleted, re-create the redis database and use the new redisId
  3. Check for stray whitespace/quotes around the ID string when copied from logs or URLs

Example fix

// before
const r = await findRedisById(redisId);

// after
const r = await findRedisById(redisId).catch((e) => {
  if (e instanceof TRPCError && e.code === "NOT_FOUND") {
    throw new Error(`Redis ${redisId} no longer exists; refresh the list`);
  }
  throw e;
});
Defensive patterns

Strategy: try-catch

Validate before calling

const exists = await db.select().from(redis).where(eq(redis.redisId, redisId)).limit(1);
if (exists.length === 0) throw new Error(`Redis ${redisId} does not exist`);

Type guard

const isTRPCNotFound = (e: unknown): e is TRPCError =>
  e instanceof TRPCError && e.code === "NOT_FOUND";

Try / catch

try { const r = await findRedisById(redisId); } catch (e) { if (isTRPCNotFound(e)) { /* refresh list / recreate */ } throw e; }

Prevention

When it happens

Trigger: Passing a redisId that does not exist, was deleted (removeRedisById), belongs to another database/workspace, or a malformed/truncated UUID string that never matches any row.

Common situations: Stale UI after the redis database was removed from another tab/session, bookmarked or cached URL with an old redisId, copy/paste typo in an API script, or a deleted row while a deployment is still in flight.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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