Dokploy/dokploy · error · TRPCError

NOT_FOUND

NOT_FOUND

Error message

Project not found

What it means

findProjectById queries the projects table (with joined relations) by projectId and throws NOT_FOUND when no row matches. It means the project id supplied does not exist in the database (or was deleted). This is the standard lookup guard for all project-scoped operations.

Source

Thrown at packages/server/src/services/project.ts:115

					postgres: {
						columns: { ...serviceColumns, postgresId: true },
						with: { server: { columns: { name: true } } },
					},
					redis: {
						columns: { ...serviceColumns, redisId: true },
						with: { server: { columns: { name: true } } },
					},
				},
			},
			projectTags: {
				with: {
					tag: true,
				},
			},
		},
	});
	if (!project) {
		throw new TRPCError({
			code: "NOT_FOUND",
			message: "Project not found",
		});
	}
	return project;
};

export const deleteProject = async (projectId: string) => {
	const project = await db
		.delete(projects)
		.where(eq(projects.projectId, projectId))
		.returning()
		.then((value) => value[0]);

	return project;
};

export const updateProjectById = async (

View on GitHub (pinned to 546686ea35)

Solutions

  1. Verify the projectId exists: check the projects table or list projects for the organization
  2. Refresh client state / re-fetch the project list if the project was deleted elsewhere
  3. Ensure the correct organization is active and the id is passed intact (no truncation)
Defensive patterns

Strategy: try-catch

Validate before calling

const exists = await trpc.project.list.query({ orgId }).then(ps => ps.some(p => p.projectId === id));

Try / catch

try { await findProjectById(id) } catch (e) { if (e instanceof TRPCError && e.code === 'NOT_FOUND') { /* drop stale state, redirect to project list */ } }

Prevention

When it happens

Trigger: Any tRPC query/mutation that resolves a project by id via findProjectById, with a projectId that doesn't exist, was deleted, or has a typo/whitespace. Also stale UI state after another user deleted the project.

Common situations: Project was deleted in another session/tab but the current client still references it; stale projectId cached in frontend state after switching organizations; copy-paste or truncated UUID when calling the API directly.

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/7cd9e40138800568. Report an issue: GitHub.