Dokploy/dokploy · warning · TRPCError
CONFLICT
CONFLICT
Error message
Service with this 'AppName' already exists
What it means
Thrown by createMongo when validUniqueServerAppName finds the prefixed appName ('mongo-<name>') already taken. Standard Dokploy duplicate-name guard returning HTTP 409 CONFLICT before any insert happens.
Source
Thrown at packages/server/src/services/mongo.ts:26
} from "@dokploy/server/db/schema";
import { generatePassword } from "@dokploy/server/templates";
import { buildMongo } from "@dokploy/server/utils/databases/mongo";
import { pullImage } from "@dokploy/server/utils/docker/utils";
import { execAsyncRemote } from "@dokploy/server/utils/process/execAsync";
import { TRPCError } from "@trpc/server";
import { eq, getTableColumns } from "drizzle-orm";
import { quote } from "shell-quote";
import type { z } from "zod";
import { validUniqueServerAppName } from "./project";
export type Mongo = typeof mongo.$inferSelect;
export const createMongo = async (input: z.infer<typeof apiCreateMongo>) => {
const appName = buildAppName("mongo", input.appName);
const valid = await validUniqueServerAppName(appName);
if (!valid) {
throw new TRPCError({
code: "CONFLICT",
message: "Service with this 'AppName' already exists",
});
}
const newMongo = await db
.insert(mongo)
.values({
...input,
databasePassword: input.databasePassword
? input.databasePassword
: generatePassword(),
appName,
})
.returning()
.then((value) => value[0]);
if (!newMongo) {View on GitHub (pinned to 546686ea35)
Solutions
- Choose a unique appName
- List existing apps to identify the collision
- Fully remove the obsolete service to release the name
Example fix
// before
await createMongo({ appName: 'mongo' }); // 409
// after
await createMongo({ appName: 'mongo-session-store' }); Defensive patterns
Strategy: validation
Validate before calling
const apps = await trpc.admin.listApps.query();
if (apps.some(a => a.name === `mongo-${input.appName}`)) throw new Error('Name taken'); Try / catch
try { await createMongo(input); } catch (e) { if (e.shape?.data?.code === 'CONFLICT') { input.appName = uniqueify(input.appName); await createMongo(input); } } Prevention
- Use descriptive, environment-scoped names
- Check existing names before scripted creates
When it happens
Trigger: Calling createMongo with an appName whose 'mongo-'-prefixed form collides with an existing app/service name.
Common situations: Repeated scripted provisioning with fixed names, generic names like 'mongo' already reserved, or names held by soft-deleted rows.
Related errors
AI-assisted analysis of Dokploy/dokploy@546686ea35 (2026-08-27).
Data as JSON: /api/errors/476146986be593a8.
Report an issue: GitHub.