Dokploy/dokploy · error · TRPCError
UNAUTHORIZED
UNAUTHORIZED
Error message
You don't have access to this project
What it means
For non-admin users, Dokploy checks the member's accessedProjects list (from findMemberByUserId) before reading a project. If the projectId isn't in the member's per-project grants, access is denied even within the same organization.
Source
Thrown at apps/dokploy/server/api/routers/project.ts:119
throw new TRPCError({
code: "BAD_REQUEST",
message: `Error creating the project: ${error instanceof Error ? error.message : error}`,
cause: error,
});
}
}),
one: protectedProcedure
.input(apiFindOneProject)
.query(async ({ input, ctx }) => {
if (ctx.user.role !== "owner" && ctx.user.role !== "admin") {
const { accessedServices, accessedProjects } = await findMemberByUserId(
ctx.user.id,
ctx.session.activeOrganizationId,
);
if (!accessedProjects.includes(input.projectId)) {
throw new TRPCError({
code: "UNAUTHORIZED",
message: "You don't have access to this project",
});
}
const project = await db.query.projects.findFirst({
where: and(
eq(projects.projectId, input.projectId),
eq(projects.organizationId, ctx.session.activeOrganizationId),
),
with: {
environments: {
with: {
applications: {
columns: {
...serviceColumns,
applicationId: true,
icon: true,View on GitHub (pinned to 546686ea35)
Solutions
- Have an owner/admin grant the member access to that project in the member's project assignments
- If you're the admin, use an admin account or fix the member's project list
- Re-fetch the member's accessible projects and navigate only via those
Defensive patterns
Strategy: validation
Validate before calling
const { accessedProjects } = await api.member.byUserId.query();
if (!accessedProjects.includes(projectId)) throw new Error('No grant for this project'); Prevention
- Members should navigate only via projects listed for them
- Admins: assign new projects to members who need them
When it happens
Trigger: A member-level user (not owner/admin) requests a project they weren't explicitly granted; project access was revoked; member record not yet updated after new project creation.
Common situations: Restricted members opening shared deep links to non-granted projects; admin creates a project but doesn't assign it to the member.
Related errors
AI-assisted analysis of Dokploy/dokploy@546686ea35 (2026-08-27).
Data as JSON: /api/errors/fd13d18b65947b8f.
Report an issue: GitHub.