danny-avila/LibreChat · warning · Error
Unable to extract text from "${file.originalname}". RAG text
Error message
Unable to extract text from "${file.originalname}". RAG text extraction was unavailable and the built-in parser produced no result. What it means
Thrown when `shouldUseConfiguredText` is true, `parseText` (RAG `/text` endpoint with `allowNativeFallback: false`) threw, AND the fallback built-in document parser (`resolveDocumentText`) returned null. Both extraction paths failed: RAG was unreachable/errored, and the local parser produced no text. The user-facing message names both failures.
Source
Thrown at api/server/services/Files/process.js:902
/**
* A document type the admin routed to configured text extraction: prefer RAG `/text`, but fall
* back to the built-in document parser (not raw native text) when RAG is unavailable, so a
* transient outage doesn't degrade a docx/pdf to unreadable bytes. Only the RAG extraction is
* inside the fallback catch: a downstream persistence failure (size guard, DB, agent-resource
* mutation) must surface as itself, not trigger a second extraction attempt.
*/
if (shouldUseConfiguredText) {
let configuredText;
try {
configuredText = await parseText({ req, file, file_id, allowNativeFallback: false });
} catch (err) {
logger.warn(
`[processAgentFileUpload] Configured RAG text extraction unavailable for "${file.originalname}", using built-in document parser:`,
err,
);
const documentText = await resolveDocumentText();
if (!documentText) {
throw new Error(
`Unable to extract text from "${file.originalname}". RAG text extraction was unavailable and the built-in parser produced no result.`,
);
}
const { text, bytes, filepath: docFileURL } = documentText;
return await createTextFile({ text, bytes, filepath: docFileURL });
}
return await createTextFile({
text: configuredText.text,
bytes: configuredText.bytes,
type: file.mimetype,
});
}
const { text, bytes } = await parseText({ req, file, file_id });
return await createTextFile({ text, bytes, type: file.mimetype });
}
// Dual storage pattern for RAG files: Storage + Vector DBView on GitHub (pinned to 5ff282f900)
Solutions
- Check server logs for the `[processAgentFileUpload] Configured RAG text extraction unavailable` warn — it contains the RAG error.
- Verify RAG service health and the configured endpoint/URL.
- Re-test with a known-good document; if it also fails, the RAG integration itself is broken.
- If RAG is reliably unavailable, consider disabling `shouldUseConfiguredText` for that MIME so the built-in parser is the primary path.
Defensive patterns
Strategy: fallback
Try / catch
try { await processAgentFileUpload(params); }
catch (e) {
if (/RAG text extraction was unavailable/.test(e.message)) {
logger.error('Both RAG and built-in parser failed', { raw: e.message });
return res.status(503).json({ error: 'Text extraction temporarily unavailable; please retry later.' });
}
throw e;
} Prevention
- Monitor the RAG service endpoint — this error means it is down or rejecting the doc.
- Read the `[processAgentFileUpload] Configured RAG text extraction unavailable` warn for the root cause.
- Keep the built-in document parser version current as a reliable fallback.
When it happens
Trigger: A document configured for RAG text extraction where the RAG service is down or errored (parseText rejects), and the built-in document parser either does not handle the format or also errors silently and returns nothing. The catch around parseText logs a warn and falls through; the null check on resolveDocumentText is what throws here.
Common situations: RAG service outage or misconfigured endpoint; RAG rejecting the document (too large for RAG's own limits); a corrupt source document both pipelines cannot parse; RAG credentials invalid causing parseText to throw.
Related errors
- Extracted text from "${file.originalname}" exceeds the 15MB
- Unable to extract text from "${file.originalname}". The docu
- An error occurred during file deletion.
- RAG_API_URL not defined
- File embedding failed. The filetype ${file.mimetype} is not
AI-assisted analysis of danny-avila/LibreChat@5ff282f900 (2026-08-12).
Data as JSON: /api/errors/22efb5fc59d49e88.
Report an issue: GitHub.