danny-avila/LibreChat · error
File embedding failed.
Error message
File embedding failed.
What it means
Thrown by uploadVectors when the RAG API's /embed endpoint responds with HTTP 200 but the response body contains status: false. This indicates the RAG API received the file and recognized its type (known_type was not false), but the embedding process itself failed — the server could not generate or store the vector embeddings. This is a server-side processing failure, distinct from an unsupported file type.
Source
Thrown at api/server/services/Files/VectorDB/crud.js:104
const formHeaders = formData.getHeaders();
const response = await axios.post(`${process.env.RAG_API_URL}/embed`, formData, {
headers: {
Authorization: `Bearer ${jwtToken}`,
accept: 'application/json',
...formHeaders,
},
});
const responseData = response.data;
logger.debug('Response from embedding file', responseData);
if (responseData.known_type === false) {
throw new Error(`File embedding failed. The filetype ${file.mimetype} is not supported`);
}
if (!responseData.status) {
throw new Error('File embedding failed.');
}
return {
bytes: file.size,
filename: file.originalname,
filepath: FileSources.vectordb,
embedded: Boolean(responseData.known_type),
};
} catch (error) {
logAxiosError({
error,
message: 'Error uploading vectors',
});
throw new Error(error.message || 'An error occurred during file upload.');
}
}
module.exports = {View on GitHub (pinned to 5ff282f900)
Solutions
- Check the RAG API service logs for the specific embedding failure that occurred.
- Verify the RAG API's embedding model and vector database are operational.
- Retry the upload after a brief delay — transient RAG API failures often resolve.
- If the failure is persistent, test with a known-good file (e.g., a small plaintext .txt) to isolate whether the issue is file-specific or systemic.
Defensive patterns
Strategy: retry
Try / catch
try {
await uploadVectors({ req, file, file_id });
} catch (error) {
if (error.message === 'File embedding failed.') {
// RAG API processing failure — retry with backoff
await retryWithBackoff(() => uploadVectors({ req, file, file_id }), { retries: 3 });
}
throw error;
} Prevention
- Monitor RAG API embedding model availability and vector database health.
- Implement retry logic for transient embedding failures.
- Test with a known-good file to distinguish file-specific issues from systemic failures.
- Log RAG API responses for debugging embedding pipeline issues.
When it happens
Trigger: Calling uploadVectors({ req, file, file_id }) where the RAG API returns { status: false, known_type: true }. The RAG API's embedding pipeline encountered an error: database write failure, embedding model unavailable, document parsing error, or resource exhaustion.
Common situations: The RAG API's embedding model (e.g., an OpenAI embeddings endpoint or local model) is unavailable or rate-limited. Or the RAG API's vector database is down or full. Or the file content triggered a parsing error (e.g., a corrupted PDF). Or the RAG API has a transient internal error.
Related errors
- An error occurred during file upload.
- An error occurred during file deletion.
- RAG_API_URL not defined
- File embedding failed. The filetype ${file.mimetype} is not
- Storage backend "${source}" does not support file writes
AI-assisted analysis of danny-avila/LibreChat@5ff282f900 (2026-08-12).
Data as JSON: /api/errors/e758047217b42e5e.
Report an issue: GitHub.