{"record":{"id":"819d5a39512f8f23","repo":"Dokploy/dokploy","slug":"bad-request-819d5a","errorCode":"BAD_REQUEST","errorMessage":"Error creating the project: ${error instanceof Error ? error.message : error}","messagePattern":"Error creating the project: (.+?)","errorType":"exception","errorClass":"TRPCError","httpStatus":400,"severity":"error","filePath":"apps/dokploy/server/api/routers/project.ts","lineNumber":101,"sourceCode":"\t\t\t\t}\n\n\t\t\t\tconst project = await createProject(\n\t\t\t\t\tinput,\n\t\t\t\t\tctx.session.activeOrganizationId,\n\t\t\t\t);\n\t\t\t\tawait addNewProject(ctx, project.project.projectId);\n\n\t\t\t\tawait addNewEnvironment(ctx, project?.environment?.environmentId || \"\");\n\n\t\t\t\tawait audit(ctx, {\n\t\t\t\t\taction: \"create\",\n\t\t\t\t\tresourceType: \"project\",\n\t\t\t\t\tresourceId: project.project.projectId,\n\t\t\t\t\tresourceName: project.project.name,\n\t\t\t\t});\n\t\t\t\treturn project;\n\t\t\t} catch (error) {\n\t\t\t\tthrow new TRPCError({\n\t\t\t\t\tcode: \"BAD_REQUEST\",\n\t\t\t\t\tmessage: `Error creating the project: ${error instanceof Error ? error.message : error}`,\n\t\t\t\t\tcause: error,\n\t\t\t\t});\n\t\t\t}\n\t\t}),\n\n\tone: protectedProcedure\n\t\t.input(apiFindOneProject)\n\t\t.query(async ({ input, ctx }) => {\n\t\t\tif (ctx.user.role !== \"owner\" && ctx.user.role !== \"admin\") {\n\t\t\t\tconst { accessedServices, accessedProjects } = await findMemberByUserId(\n\t\t\t\t\tctx.user.id,\n\t\t\t\t\tctx.session.activeOrganizationId,\n\t\t\t\t);\n\n\t\t\t\tif (!accessedProjects.includes(input.projectId)) {\n\t\t\t\t\tthrow new TRPCError({","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/Dokploy/dokploy/blob/546686ea3587f12ec5652217dedd9f7960fb6d15/apps/dokploy/server/api/routers/project.ts#L83-L119","documentation":"Catch-all BAD_REQUEST around the whole project.create flow. Any non-TRPCError thrown while creating the project (and its default environment) is rethrown with the original message embedded. Typical causes: DB constraint violations, slug/name collisions, or downstream service failures.","triggerScenarios":"Any unexpected exception during createProject — duplicate project name constraint, database errors, or (in cloud) provisioning failures. The inner error message is appended to the message string.","commonSituations":"Creating many projects rapidly hitting a unique constraint; DB schema drift after upgrade; control-plane DB briefly down.","solutions":["Read the appended inner message — it names the actual failure","If it's a name/slug collision, pick a different project name","Check control-plane database health and run pending migrations","Retry once transient issues are resolved"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await api.project.create.mutate(input); }\ncatch (e) { report(e.message.replace(/^Error creating the project: /, '')); }","preventionTips":["Surface the embedded inner message to users","Avoid duplicate project names to dodge constraint errors"],"tags":["dokploy","project","creation","catch-all"],"backgroundTag":"operation-wrapped-failure","analyzedSha":"546686ea3587f12ec5652217dedd9f7960fb6d15","analyzedAt":"2026-08-27T05:18:58.095Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}