{"record":{"id":"02d99a5fc41a775a","repo":"Mintplex-Labs/anything-llm","slug":"internal-server-error-02d99a","errorCode":null,"errorMessage":"Internal Server Error","messagePattern":"Internal Server Error","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"server/endpoints/workspacesParsedFiles.js","lineNumber":41,"sourceCode":"        const threadSlug = request.query.threadSlug || null;\n        const user = await userFromSession(request, response);\n        const workspace = response.locals.workspace;\n        const thread = threadSlug\n          ? await WorkspaceThread.get({ slug: String(threadSlug) })\n          : null;\n        const { files, contextWindow, currentContextTokenCount } =\n          await WorkspaceParsedFiles.getContextMetadataAndLimits(\n            workspace,\n            thread || null,\n            multiUserMode(response) ? user : null\n          );\n\n        return response\n          .status(200)\n          .json({ files, contextWindow, currentContextTokenCount });\n      } catch (e) {\n        console.error(e.message, e);\n        return response.sendStatus(500).end();\n      }\n    }\n  );\n\n  app.delete(\n    \"/workspace/:slug/delete-parsed-files\",\n    [validatedRequest, flexUserRoleValid([ROLES.all]), validWorkspaceSlug],\n    async function (request, response) {\n      try {\n        const { fileIds = [] } = reqBody(request);\n        if (!fileIds.length) return response.sendStatus(400).end();\n        const user = await userFromSession(request, response);\n        const workspace = response.locals.workspace;\n        const success = await WorkspaceParsedFiles.delete({\n          id: {\n            in: fileIds.map((id) => parseInt(id)),\n          },\n          ...(user ? { userId: user.id } : {}),","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/endpoints/workspacesParsedFiles.js#L23-L59","documentation":"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.","triggerScenarios":"Unhandled exception in the parsed files endpoint. Triggered when parsed-file operations throw (workspacesParsedFiles.js:41).","commonSituations":"See trigger scenarios.","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."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}