Mintplex-Labs/anything-llm · error
Internal Server Error
Error message
Internal Server Error
What it means
Catch-all handler in the parsed-files context-metadata endpoint: WorkspaceParsedFiles.getContextMetadataAndLimits threw (e.g. database or workspace/thread lookup failure) and a bare 500 status is returned.
Solutions
- Check the server logs for the exception in the parsed-files endpoint.
- Verify the workspace slug is valid and the database is reachable, then retry.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Unhandled exception in the parsed files endpoint. Triggered when parsed-file operations throw (workspacesParsedFiles.js:41).
Common situations: See trigger scenarios.
Understand the failure class
- HTTP status errors: handling 4xx and 5xx responses — how to handle 4xx and 5xx responses properly.
AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18).
Data as JSON: /api/errors/02d99a5fc41a775a.
Report an issue: GitHub.
Appendix: source
Thrown at server/endpoints/workspacesParsedFiles.js:41
const threadSlug = request.query.threadSlug || null;
const user = await userFromSession(request, response);
const workspace = response.locals.workspace;
const thread = threadSlug
? await WorkspaceThread.get({ slug: String(threadSlug) })
: null;
const { files, contextWindow, currentContextTokenCount } =
await WorkspaceParsedFiles.getContextMetadataAndLimits(
workspace,
thread || null,
multiUserMode(response) ? user : null
);
return response
.status(200)
.json({ files, contextWindow, currentContextTokenCount });
} catch (e) {
console.error(e.message, e);
return response.sendStatus(500).end();
}
}
);
app.delete(
"/workspace/:slug/delete-parsed-files",
[validatedRequest, flexUserRoleValid([ROLES.all]), validWorkspaceSlug],
async function (request, response) {
try {
const { fileIds = [] } = reqBody(request);
if (!fileIds.length) return response.sendStatus(400).end();
const user = await userFromSession(request, response);
const workspace = response.locals.workspace;
const success = await WorkspaceParsedFiles.delete({
id: {
in: fileIds.map((id) => parseInt(id)),
},
...(user ? { userId: user.id } : {}),View on GitHub (pinned to 3aec848f28)