Dokploy/dokploy · error · TRPCError
UNAUTHORIZED
UNAUTHORIZED
Error message
You are not allowed to access this DNS provider
What it means
findDnsProviderInOrganization loads a DNS provider then checks that its organizationId matches the caller's organization; a mismatch throws UNAUTHORIZED. This is multi-tenant isolation: the provider exists, but it belongs to a different organization.
Source
Thrown at packages/server/src/services/dns-provider.ts:110
const provider = await db.query.dnsProvider.findFirst({
where: eq(dnsProvider.dnsProviderId, dnsProviderId),
});
if (!provider) {
throw new TRPCError({
code: "NOT_FOUND",
message: "DNS provider not found",
});
}
return provider;
};
export const findDnsProviderInOrganization = async (
dnsProviderId: string,
organizationId: string,
) => {
const provider = await findDnsProviderById(dnsProviderId);
if (provider.organizationId !== organizationId) {
throw new TRPCError({
code: "UNAUTHORIZED",
message: "You are not allowed to access this DNS provider",
});
}
return provider;
};
export const findDnsProvidersByOrganizationId = async (
organizationId: string,
) => {
return await db.query.dnsProvider.findMany({
where: eq(dnsProvider.organizationId, organizationId),
orderBy: (providers, { asc }) => [asc(providers.name)],
});
};
export const updateDnsProvider = async (
dnsProviderId: string,View on GitHub (pinned to 546686ea35)
Solutions
- Verify you are using the correct organization context/token for that provider
- List providers within your own organization and use those IDs
- If the provider should be accessible, have an admin move/recreate it under the right organization
- Audit where the foreign ID came from (hardcoded config, stale cache)
Defensive patterns
Strategy: validation
Validate before calling
const provider = await findDnsProviderById(id);
if (provider.organizationId !== currentOrganizationId) { /* use a provider from your own org */ } Type guard
const isInOrg = (p: DnsProvider, orgId: string) => p.organizationId === orgId;
Try / catch
try { await findDnsProviderInOrganization(id, orgId); } catch (e) { if (e instanceof TRPCError && e.code === "UNAUTHORIZED") { /* fetch org-scoped provider list */ } } Prevention
- Always source IDs from org-scoped list endpoints
- Never share IDs across tenants
- Verify auth token matches the target organization
When it happens
Trigger: Accessing a DNS provider ID from another organization — e.g. an ID leaked via shared links, logs, or a client hardcoding an ID — while authenticated to a different org. Also happens after moving resources between organizations.
Common situations: Cross-tenant ID reuse in multi-tenant deployments; testing with production IDs; importing data that carries old organization IDs; token from one org used against another org's resources.
Related errors
AI-assisted analysis of Dokploy/dokploy@546686ea35 (2026-08-27).
Data as JSON: /api/errors/a98e9b62b9313171.
Report an issue: GitHub.