{"record":{"id":"a379e0cf185f5c5a","repo":"Mintplex-Labs/anything-llm","slug":"internal-server-error-a379e0","errorCode":null,"errorMessage":"Internal Server Error","messagePattern":"Internal Server Error","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"server/endpoints/workspaces.js","lineNumber":75,"sourceCode":"            Embedder: process.env.EMBEDDING_ENGINE || \"inherit\",\n            VectorDbSelection: process.env.VECTOR_DB || \"lancedb\",\n            TTSSelection: process.env.TTS_PROVIDER || \"native\",\n            LLMModel: getModelTag(),\n          },\n          user?.id\n        );\n\n        await EventLogs.logEvent(\n          \"workspace_created\",\n          {\n            workspaceName: workspace?.name || \"Unknown Workspace\",\n          },\n          user?.id\n        );\n        response.status(200).json({ workspace, message });\n      } catch (e) {\n        console.error(e.message, e);\n        response.sendStatus(500).end();\n      }\n    }\n  );\n\n  app.post(\n    \"/workspace/:slug/update\",\n    [validatedRequest, flexUserRoleValid([ROLES.admin, ROLES.manager])],\n    async (request, response) => {\n      try {\n        const user = await userFromSession(request, response);\n        const { slug = null } = request.params;\n        const data = reqBody(request);\n        const currWorkspace = multiUserMode(response)\n          ? await Workspace.getWithUser(user, { slug })\n          : await Workspace.get({ slug });\n\n        if (!currWorkspace) {\n          response.sendStatus(400).end();","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/server/endpoints/workspaces.js#L57-L93","documentation":"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.","triggerScenarios":"Database unavailable or locked during workspace insertion; unique-constraint violation on the generated slug; disk full; storage volume read-only.","commonSituations":"DB locked during migration; storage exhausted; concurrent creation race producing a slug collision.","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."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const res = await api.post('/workspace/new', { name });\n} catch (e) {\n  if (e.response?.status === 500) {\n    // workspace creation failed — check DB health and storage; retry with a unique name\n  } else { throw e; }\n}","preventionTips":["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."],"tags":["http-500","workspace","creation","catch-all","database"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}