{"record":{"id":"ceabb5d23c90d316","repo":"Mintplex-Labs/anything-llm","slug":"error-failed-to-embed-file","errorCode":null,"errorMessage":"error || \"Failed to embed file\"","messagePattern":"error \\|\\| \"Failed to embed file\"","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"server/endpoints/workspacesParsedFiles.js","lineNumber":93,"sourceCode":"      flexUserRoleValid([ROLES.admin, ROLES.manager]),\n      validWorkspaceSlug,\n    ],\n    async function (request, response) {\n      const { fileId = null } = request.params;\n      try {\n        const user = await userFromSession(request, response);\n        const workspace = response.locals.workspace;\n\n        if (!fileId) return response.sendStatus(400).end();\n        const { success, error, document } =\n          await WorkspaceParsedFiles.moveToDocumentsAndEmbed(\n            user,\n            fileId,\n            workspace\n          );\n\n        if (!success) {\n          return response.status(500).json({\n            success: false,\n            error: error || \"Failed to embed file\",\n          });\n        }\n\n        await Telemetry.sendTelemetry(\"document_embedded\");\n        await EventLogs.logEvent(\n          \"document_embedded\",\n          {\n            documentName: document?.name || \"unknown\",\n            workspaceId: workspace.id,\n          },\n          user?.id\n        );\n\n        return response.status(200).json({\n          success: true,\n          error: null,","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/endpoints/workspacesParsedFiles.js#L75-L111","documentation":"Propagation guard in the parsed-files embed endpoint: moveToDocumentsAndEmbed returned success=false, so moving the parsed file into documents and embedding it failed; the operation's error (or a generic fallback) is relayed to the caller.","triggerScenarios":"Failed to embed file: the embedding provider rejected or failed to process the file during workspace file embedding (workspacesParsedFiles.js:93). Triggered when the embedder throws or returns a falsy result while embedding an uploaded/parsed document into a workspace.","commonSituations":"See trigger scenarios.","solutions":["Check that the parsed file record still exists in WorkspaceParsedFiles and belongs to this workspace and user.","Open the collector and server logs for the underlying embed failure returned by WorkspaceParsedFiles.moveToDocumentsAndEmbed.","Verify the vector database provider is reachable and the workspace embedder is configured.","Retry the embed after confirming the document content is not empty."],"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-14T00:17:10.932Z"}