Mintplex-Labs/anything-llm · critical
Internal Server Error
Error message
Internal Server Error
What it means
HTTP 500 from GET /onboarding. This is a public endpoint (no auth middleware) that calls SystemSettings.isOnboardingComplete(). The catch logs e.message and sends 500 with .end(). The throw comes from the SystemSettings model — typically a DB query against the system_settings table. Because this endpoint is hit during initial app load (before login), a 500 here can block the onboarding flow entirely, leaving the user unable to proceed.
Source
Thrown at server/endpoints/system.js:102
app.get("/migrate", async (_, response) => {
response.sendStatus(200);
});
app.get("/env-dump", async (_, response) => {
if (process.env.NODE_ENV !== "production")
return response.sendStatus(200).end();
dumpENV();
response.sendStatus(200).end();
});
app.get("/onboarding", async (_, response) => {
try {
const results = await SystemSettings.isOnboardingComplete();
response.status(200).json({ onboardingComplete: results });
} catch (e) {
console.error(e.message, e);
response.sendStatus(500).end();
}
});
app.post("/onboarding", [validatedRequest], async (_, response) => {
try {
await SystemSettings.markOnboardingComplete();
response.sendStatus(200).end();
} catch (e) {
console.error(e.message, e);
response.sendStatus(500).end();
}
});
app.get("/setup-complete", async (_, response) => {
try {
const results = await SystemSettings.currentSettings();
response.status(200).json({ results });
} catch (e) {View on GitHub (pinned to 526360e320)
Solutions
- Check the server log for the exact Prisma error.
- Run the database migration (npx prisma migrate deploy or the project's setup script).
- Verify the system_settings table exists and has the expected schema (label/value columns).
- If the table exists but is empty, the onboarding flag may need to be seeded — check the project's seed script.
Defensive patterns
Strategy: try-catch
Validate before calling
// This is a public GET with no body/params to validate. // The only pre-check is DB health. // Ensure migrations are run before the server starts accepting requests. // In a startup script: // npx prisma migrate deploy && node server/index.js
Try / catch
// Degrade gracefully — onboarding status is not worth crashing the page.
try {
const results = await SystemSettings.isOnboardingComplete();
response.status(200).json({ onboardingComplete: results });
} catch (e) {
console.error('GET /onboarding failed:', e.message, e);
// Default to true so the user can proceed past onboarding
response.status(200).json({ onboardingComplete: true });
} Prevention
- Run prisma migrate deploy before starting the Express server — add it to the startup script or Docker entrypoint.
- Add a DB connectivity check at boot that fails fast with a clear message if the system_settings table is missing.
- Consider degrading gracefully: return onboardingComplete: true on error so users aren't locked out.
- Monitor this endpoint — it's public and boot-critical, so alerts on 5xx are important.
When it happens
Trigger: SystemSettings.isOnboardingComplete queries the system_settings table which doesn't exist (migration not run); the DB connection is not initialized; the Prisma client doesn't have the SystemSettings model; the system_settings table exists but the expected row/column for the onboarding flag is missing.
Common situations: Fresh install where the database was created but seed/migration scripts weren't run; Docker container started without the DB volume, resulting in an empty database; Prisma generate not run after cloning; the onboarding setting label was renamed in a version upgrade.
Understand the failure class
- HTTP status errors: handling 4xx and 5xx responses — how to handle 4xx and 5xx responses properly.
Related errors
- Internal Server Error
- Internal Server Error
- Internal Server Error
- Internal Server Error
- Internal Server Error
AI-assisted analysis of Mintplex-Labs/anything-llm@526360e320 (2026-08-13).
Data as JSON: /api/errors/3dc153300de82ac2.
Report an issue: GitHub.