danny-avila/LibreChat · warning · Error
File type ${file.mimetype} is not supported for text parsing
Error message
File type ${file.mimetype} is not supported for text parsing. What it means
Thrown at the end of the MIME-type routing chain when the uploaded file's MIME matches none of: OCR-supported, STT-supported, or text-supported MIME lists (and `shouldUseConfiguredText` is false). The server has no configured handler for that MIME type, so it refuses text extraction rather than guessing.
Source
Thrown at api/server/services/Files/process.js:881
const shouldUseSTT = fileConfig.checkType(
file.mimetype,
fileConfig.stt?.supportedMimeTypes || [],
);
if (shouldUseSTT) {
const sttService = await STTService.getInstance();
const { text, bytes } = await processAudioFile({ req, file, sttService });
return await createTextFile({ text, bytes });
}
const shouldUseText = fileConfig.checkType(
file.mimetype,
fileConfig.text?.supportedMimeTypes || [],
);
if (!shouldUseText) {
throw new Error(`File type ${file.mimetype} is not supported for text parsing.`);
}
/**
* 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,
);View on GitHub (pinned to 5ff282f900)
Solutions
- Add the MIME type to the appropriate `supportedMimeTypes` array in fileConfig (text/OCR/STT) via admin settings.
- Upload a supported format instead (convert the file to PDF/DOCX/TXT).
- Verify the actual MIME with `file --mime-type` — Multer may have sniffed from extension and gotten it wrong.
- If the type should never be parsed, suppress the upload affordance in the UI for that type.
Example fix
// config: enable CSV and Markdown text extraction
fileConfig: {
text: { supportedMimeTypes: [
'text/plain', 'text/markdown', 'text/csv',
'application/pdf', 'application/vnd.openxmlformats...'
] }
} Defensive patterns
Strategy: validation
Validate before calling
function isSupportedMime(file, fileConfig) {
const lists = [
fileConfig.ocr?.supportedMimeTypes || [],
fileConfig.stt?.supportedMimeTypes || [],
fileConfig.text?.supportedMimeTypes || [],
];
return lists.some(l => l.includes(file.mimetype));
} Try / catch
try { await processAgentFileUpload(params); }
catch (e) {
if (/is not supported for text parsing/.test(e.message)) return res.status(415).json({ error: e.message });
throw e;
} Prevention
- Keep the `supportedMimeTypes` arrays in fileConfig aligned with what users actually upload.
- Verify MIME with `file --mime-type`; Multer sniffs from extension and can misclassify.
- Hide the upload affordance for unsupported file types in the UI.
When it happens
Trigger: A file whose MIME is not in any of the admin-configured `supportedMimeTypes` arrays for OCR, STT, or text — e.g., a `.zip`, `.exe`, `.csv` not enabled for text, or an unusual MIME like `application/x-foo`. Also a real document type the admin simply didn't whitelist.
Common situations: Admin enabled PDF/DOCX but not TXT/CSV/MD; user uploads a binary archive expecting extraction; MIME sniffed incorrectly so a supported type is misclassified; a new file type not yet in the config.
Related errors
- Image uploads are not supported for file search tool resourc
- [${req.baseUrl}] Endpoint is required
- Text is required
- Error uploading file: ${result.message}
- Unexpected batch upload response: ${JSON.stringify(result).s
AI-assisted analysis of danny-avila/LibreChat@5ff282f900 (2026-08-12).
Data as JSON: /api/errors/db6e2e564101141c.
Report an issue: GitHub.