{"record":{"id":"76a8817f3556ef65","repo":"Mintplex-Labs/anything-llm","slug":"the-textcontent-key-cannot-have-an-empty-value","errorCode":null,"errorMessage":"The 'textContent' key cannot have an empty value.","messagePattern":"The 'textContent' key cannot have an empty value\\.","errorType":"http","errorClass":null,"httpStatus":422,"severity":"error","filePath":"server/endpoints/api/document/index.js","lineNumber":554,"sourceCode":"          !requiredMetadata.every(\n            (reqKey) =>\n              Object.keys(metadata).includes(reqKey) && !!metadata[reqKey]\n          )\n        ) {\n          return response\n            .status(422)\n            .json({\n              success: false,\n              error: `You are missing required metadata key:value pairs in your request. Required metadata key:values are ${requiredMetadata\n                .map((v) => `'${v}'`)\n                .join(\", \")}`,\n            })\n            .end();\n        }\n\n        if (!textContent || textContent?.length === 0) {\n          return response\n            .status(422)\n            .json({\n              success: false,\n              error: `The 'textContent' key cannot have an empty value.`,\n            })\n            .end();\n        }\n\n        const { success, reason, documents } = await Collector.processRawText(\n          textContent,\n          metadata\n        );\n        if (!success) {\n          return response\n            .status(500)\n            .json({ success: false, error: reason, documents })\n            .end();\n        }\n","sourceCodeStart":536,"sourceCodeEnd":572,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/endpoints/api/document/index.js#L536-L572","documentation":"Validation guard in the raw-text embed API: the textContent field is missing, empty, or a zero-length value, so there is no content to embed and the request is rejected with 4xx before hitting the collector.","triggerScenarios":"Thrown at server/endpoints/api/document/index.js:554 when the library encounters an invalid state.","commonSituations":"Posting raw text to the document API with an empty or missing textContent value.","solutions":["Provide a non-empty string in the 'textContent' field of the request.","Verify the payload was serialized correctly and not stripped before sending."],"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"}