overleaf/overleaf · error
Internal Server Error (error getting document res.sendStatus
Error message
Internal Server Error (error getting document res.sendStatus(500))
What it means
Sent by getDoc when fetching the document from the document updater service fails with any error other than NotFoundError (e.g. document-updater unavailable, Redis issues, timeout). The error is logged as 'error getting document for downloading' and the client receives a bare 500.
Source
Thrown at services/web/app/src/Features/DocumentUpdater/DocumentUpdaterController.mjs:41
res.setContentDisposition('attachment', { filename: doc.name })
plainTextResponse(res, lines.join('\n'))
} catch (err) {
if (err.name === 'NotFoundError') {
logger.warn(
{ err, projectId, docId },
'entity not found when downloading doc'
)
return res.sendStatus(404)
}
logger.err(
{ err, projectId, docId },
'error getting document for downloading'
)
return res.sendStatus(500)
}
}
export default {
getDoc: expressify(getDoc),
}
View on GitHub (pinned to 28ad3b03b7)
Solutions
- Check web logs for the underlying err to identify the document-updater failure
- Verify the document-updater service and its Redis instance are healthy
- Retry the download once the document-updater is responsive
- If it persists, check for large docs hitting timeouts or memory limits
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at services/web/app/src/Features/DocumentUpdater/DocumentUpdaterController.mjs:41 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- HTTP status errors: handling 4xx and 5xx responses — how to handle 4xx and 5xx responses properly.
AI-assisted analysis of overleaf/overleaf@28ad3b03b7 (2026-09-03).
Data as JSON: /api/errors/633a915e64b7ed72.
Report an issue: GitHub.