amruthpillai/reactive-resume · error · ORPCError

INTERNAL_SERVER_ERROR

INTERNAL_SERVER_ERROR

Error message

Failed to create resume

What it means

resumeService.create() wraps the DB insert; if it fails for any reason other than the resume_slug_user_id_unique constraint (mapped to RESUME_SLUG_ALREADY_EXISTS), it logs the cause and throws INTERNAL_SERVER_ERROR. The underlying error is written to the server console, not the response.

Source

Thrown at packages/api/src/features/resume/service.ts:650

			await notifyResumeUpdated({
				type: "resume.updated",
				resumeId: id,
				userId: input.userId,
				updatedAt: new Date().toISOString(),
				mutation: "create",
			});

			return id;
		} catch (error) {
			const constraint = get(error, "cause.constraint") as string | undefined;

			if (constraint === "resume_slug_user_id_unique") {
				throw new ORPCError("RESUME_SLUG_ALREADY_EXISTS", { status: 400 });
			}

			console.error("Failed to create resume:", error);
			throw new ORPCError("INTERNAL_SERVER_ERROR", { message: "Failed to create resume" });
		}
	},

	update: async (input: {
		id: string;
		userId: string;
		name?: string;
		slug?: string;
		tags?: string[];
		data?: ResumeData;
		isPublic?: boolean;
		restoreStylesheet?: boolean;
		skipAutoSnapshot?: boolean;
	}) => {
		const resume = await db
			.transaction(async (tx) => {
				const [existing] = await tx
					.select({

View on GitHub (pinned to 3a5b12e2a4)

Solutions

  1. Check server logs for 'Failed to create resume:' with the full cause.
  2. Verify the DB is reachable and migrations are applied (dotenvx run -f .env.local -- pnpm db:migrate).
  3. Confirm no required column is null in the payload.
  4. If it is a transient DB error (connection/serialization), retry the create.
Defensive patterns

Strategy: try-catch

Validate before calling

function buildCreateInput(input) {
  if (!input.name || !input.slug) throw new Error('name and slug required');
  if (!/^[a-z0-9-]+$/.test(input.slug)) throw new Error('Invalid slug');
  return input;
}

Try / catch

try {
  await resumeService.create(input);
} catch (e) {
  if (e.code === 'RESUME_SLUG_ALREADY_EXISTS') { /* pick a new slug */ }
  else if (e.code === 'INTERNAL_SERVER_ERROR') {
    // check server logs; retry only if DB was transiently down
  } else throw e;
}

Prevention

When it happens

Trigger: DB connection loss, a NOT NULL or constraint violation other than the slug unique, schema drift between the Drizzle model and the live table, a serialization failure, or a duplicate generated id.

Common situations: DATABASE_URL misconfigured or the DB is down, a pending migration not applied, a new required column without a default, or transient DB instability.

Related errors


AI-assisted analysis of amruthpillai/reactive-resume@3a5b12e2a4 (2026-08-12). Data as JSON: /api/errors/6faf6646fc9c2a6d. Report an issue: GitHub.