{"record":{"id":"de5569c0fc5fbe42","repo":"Mintplex-Labs/anything-llm","slug":"workspace-thread-does-not-exist","errorCode":null,"errorMessage":"Workspace thread does not exist.","messagePattern":"Workspace thread does not exist\\.","errorType":"http","errorClass":null,"httpStatus":404,"severity":"error","filePath":"server/utils/middleware/validWorkspace.js","lineNumber":41,"sourceCode":"async function validWorkspaceAndThreadSlug(request, response, next) {\n  const { slug, threadSlug } = request.params;\n  const user = await userFromSession(request, response);\n  const workspace = multiUserMode(response)\n    ? await Workspace.getWithUser(user, { slug })\n    : await Workspace.get({ slug });\n\n  if (!workspace) {\n    response.status(404).send(\"Workspace does not exist.\");\n    return;\n  }\n\n  const thread = await WorkspaceThread.get({\n    slug: threadSlug,\n    user_id: user?.id || null,\n    workspace_id: workspace.id,\n  });\n  if (!thread) {\n    response.status(404).send(\"Workspace thread does not exist.\");\n    return;\n  }\n\n  response.locals.workspace = workspace;\n  response.locals.thread = thread;\n  next();\n}\n\nmodule.exports = {\n  validWorkspaceSlug,\n  validWorkspaceAndThreadSlug,\n};\n","sourceCodeStart":23,"sourceCodeEnd":54,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/middleware/validWorkspace.js#L23-L54","documentation":"Existence guard in validWorkspaceAndThreadSlug middleware: the workspace resolved but no WorkspaceThread matches the threadSlug for this user and workspace, so the thread param is invalid and a 404 is returned.","triggerScenarios":"Request referenced a workspace thread that does not exist. Triggered when validWorkspace middleware cannot find the thread slug within the workspace (validWorkspace.js:41).","commonSituations":"See trigger scenarios.","solutions":["Check the thread slug in the URL matches an existing thread in the given workspace.","Verify the thread belongs to the requesting user (in multi-user mode threads are per-user)."],"exampleFix":null,"handlingStrategy":"validation","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-14T05:17:10.506Z"}