Mintplex-Labs/anything-llm · error
Internal Server Error
Error message
Internal Server Error
What it means
The catch-all 500 for POST /workspace/new. The handler calls Workspace.new(name, user?.id) followed by Telemetry.sendTelemetry and EventLogs.logEvent. Any unhandled exception — most commonly a database insert failure in Workspace.new — returns 500.
Source
Thrown at server/endpoints/workspaces.js:75
Embedder: process.env.EMBEDDING_ENGINE || "inherit",
VectorDbSelection: process.env.VECTOR_DB || "lancedb",
TTSSelection: process.env.TTS_PROVIDER || "native",
LLMModel: getModelTag(),
},
user?.id
);
await EventLogs.logEvent(
"workspace_created",
{
workspaceName: workspace?.name || "Unknown Workspace",
},
user?.id
);
response.status(200).json({ workspace, message });
} catch (e) {
console.error(e.message, e);
response.sendStatus(500).end();
}
}
);
app.post(
"/workspace/:slug/update",
[validatedRequest, flexUserRoleValid([ROLES.admin, ROLES.manager])],
async (request, response) => {
try {
const user = await userFromSession(request, response);
const { slug = null } = request.params;
const data = reqBody(request);
const currWorkspace = multiUserMode(response)
? await Workspace.getWithUser(user, { slug })
: await Workspace.get({ slug });
if (!currWorkspace) {
response.sendStatus(400).end();View on GitHub (pinned to 526360e320)
Solutions
- Inspect server logs for the exception message.
- Verify database connectivity and available storage space.
- Check for unique-constraint errors indicating a slug collision and retry with a different name.
Defensive patterns
Strategy: try-catch
Try / catch
try {
const res = await api.post('/workspace/new', { name });
} catch (e) {
if (e.response?.status === 500) {
// workspace creation failed — check DB health and storage; retry with a unique name
} else { throw e; }
} Prevention
- Ensure DB migrations are applied before starting the server.
- Monitor DB connectivity and disk space.
- Handle slug-collision edge cases by retrying with a modified name.
When it happens
Trigger: Database unavailable or locked during workspace insertion; unique-constraint violation on the generated slug; disk full; storage volume read-only.
Common situations: DB locked during migration; storage exhausted; concurrent creation race producing a slug collision.
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
- Failed to create workspace
- 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/a379e0cf185f5c5a.
Report an issue: GitHub.