Dokploy/dokploy · warning · TRPCError
CONFLICT
CONFLICT
Error message
Service with this 'AppName' already exists
What it means
Thrown by createMariadb when validUniqueServerAppName finds the prefixed appName ('mariadb-<name>') already exists on the server. It is Dokploy's duplicate-name guard and maps to HTTP 409 CONFLICT.
Source
Thrown at packages/server/src/services/mariadb.ts:27
import { buildMariadb } from "@dokploy/server/utils/databases/mariadb";
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 Mariadb = typeof mariadb.$inferSelect;
export const createMariadb = async (
input: z.infer<typeof apiCreateMariaDB>,
) => {
const appName = buildAppName("mariadb", input.appName);
const valid = await validUniqueServerAppName(appName);
if (!valid) {
throw new TRPCError({
code: "CONFLICT",
message: "Service with this 'AppName' already exists",
});
}
const newMariadb = await db
.insert(mariadb)
.values({
...input,
databasePassword: input.databasePassword
? input.databasePassword
: generatePassword(),
databaseRootPassword: input.databaseRootPassword
? input.databaseRootPassword
: generatePassword(),
appName,
})
.returning()View on GitHub (pinned to 546686ea35)
Solutions
- Pick a unique appName and retry
- List existing apps to find the conflicting name
- Free the name by fully deleting the old service if it's obsolete
Example fix
// before
await createMariadb({ appName: 'db' }); // 409
// after
await createMariadb({ appName: 'db-orders-prod' }); Defensive patterns
Strategy: validation
Validate before calling
const apps = await trpc.admin.listApps.query();
if (apps.some(a => a.name === `mariadb-${input.appName}`)) throw new Error('Name taken'); Try / catch
try { await createMariadb(input); } catch (e) { if (e.shape?.data?.code === 'CONFLICT') { input.appName = uniqueify(input.appName); await createMariadb(input); } } Prevention
- Use environment-scoped names in IaC scripts
- Check the app list before creation
When it happens
Trigger: Calling createMariadb with an appName whose 'mariadb-'-prefixed form collides with an existing application or service name in the database.
Common situations: Terraform/scripted provisioning re-running without unique names, common names like 'db' already claimed, or names still reserved by soft-deleted apps.
Related errors
AI-assisted analysis of Dokploy/dokploy@546686ea35 (2026-08-27).
Data as JSON: /api/errors/59245d2ceb6d16e7.
Report an issue: GitHub.