stablyai/orca · warning · Error
File too large: ${(stats.size / 1024 / 1024).toFixed(1)}MB e
Error message
File too large: ${(stats.size / 1024 / 1024).toFixed(1)}MB exceeds ${MAX_TEXT_FILE_SIZE / 1024 / 1024}MB limit What it means
Thrown by readLocalLogSnapshot when the file's reported size (from fstat on the opened handle) exceeds MAX_TEXT_FILE_SIZE (50 MB). This function reads entire files into memory for log display, so the pre-read stat check prevents excessive memory consumption and Monaco editor degradation.
Source
Thrown at src/main/ipc/filesystem.ts:178
'.jpg': 'image/jpeg',
'.jpeg': 'image/jpeg',
'.gif': 'image/gif',
'.svg': 'image/svg+xml',
'.webp': 'image/webp',
'.bmp': 'image/bmp',
'.ico': 'image/x-icon',
'.pdf': 'application/pdf'
}
async function readLocalLogSnapshot(filePath: string): Promise<{
content: string
isBinary: boolean
fileIdentity?: string
}> {
const handle = await open(filePath, 'r')
try {
const stats = await handle.stat()
if (stats.size > MAX_TEXT_FILE_SIZE) {
throw new Error(
`File too large: ${(stats.size / 1024 / 1024).toFixed(1)}MB exceeds ${MAX_TEXT_FILE_SIZE / 1024 / 1024}MB limit`
)
}
const buffer = await handle.readFile()
if (buffer.byteLength > MAX_TEXT_FILE_SIZE) {
throw new Error(
`File too large: ${(buffer.byteLength / 1024 / 1024).toFixed(1)}MB exceeds ${MAX_TEXT_FILE_SIZE / 1024 / 1024}MB limit`
)
}
if (isBinaryBuffer(buffer)) {
return { content: '', isBinary: true }
}
return {
content: buffer.toString('utf8'),
isBinary: false,
fileIdentity: localLogFileIdentity(stats)
}
} finally {View on GitHub (pinned to 1136503c6a)
Solutions
- Use a log viewer or tail tool to inspect only the relevant portion of the large file.
- Split the file into smaller chunks before opening.
- Compress or archive old log entries to reduce the file below 50 MB.
Example fix
// before: open a 80MB log file via includeLocalLogMetadata // after: tail or split the log first // tail -c 52428800 large.log > recent.log // open recent.log
Defensive patterns
Strategy: validation
Validate before calling
const { stat } = await import('node:fs/promises')
const MAX_TEXT_FILE_SIZE = 50 * 1024 * 1024
async function assertLogUnderLimit(filePath: string): Promise<void> {
const s = await stat(filePath)
if (s.size > MAX_TEXT_FILE_SIZE) {
throw new Error(`${filePath} is ${(s.size / 1048576).toFixed(1)}MB, exceeds 50MB log snapshot limit`)
}
} Try / catch
try {
const result = await ipcRenderer.invoke('fs:readFile', { filePath, includeLocalLogMetadata: true })
} catch (error) {
if (error instanceof Error && error.message.startsWith('File too large')) {
showUserWarning(error.message + ' — use tail or split to view a portion.')
return
}
throw error
} Prevention
- Check log file size with `ls -la` or `du -h` before opening in the log viewer.
- Rotate or archive large logs to keep them under 50 MB.
- Use `tail -n 1000` or `tail -c 50M` to view the relevant portion of large logs.
When it happens
Trigger: Calling the fs:readFile IPC with includeLocalLogMetadata=true on a file whose stat.size exceeds 50 MB (50 * 1024 * 1024 bytes). The size is checked on the handle's fstat before readFile is called.
Common situations: Opening a large log file (server logs, application logs) that has grown past 50 MB. Reading a large text data file (CSV, JSON export) through the log-snapshot path. Attempting to view a concatenated or aggregated log archive.
Related errors
- File too large: ${(buffer.byteLength / 1024 / 1024).toFixed(
- File too large: ${(stats.size / 1024 / 1024).toFixed(1)}MB e
- '${relativePath}' is too large for remote import
- Remote import is too large
- File is too large (${(srcStat.size / (1024 * 1024)).toFixed(
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/a6c09a8689ff5d4f.
Report an issue: GitHub.