phacility/phabricator · error · Exception
No content engine can render this document.
Error message
No content engine can render this document.
What it means
PhabricatorDocumentEngine::newEngines() (via getEngines) filters all registered document engines by canRenderDocument($ref); if every engine is filtered out, it throws this exception because no renderer exists for the referenced file. The document rendering pipeline then has no way to produce content for the ref.
Source
Thrown at src/applications/files/document/PhabricatorDocumentEngine.php:227
final public static function getEnginesForRef(
PhabricatorUser $viewer,
PhabricatorDocumentRef $ref) {
$engines = self::getAllEngines();
foreach ($engines as $key => $engine) {
$engine = id(clone $engine)
->setViewer($viewer);
if (!$engine->canRenderDocument($ref)) {
unset($engines[$key]);
continue;
}
$engines[$key] = $engine;
}
if (!$engines) {
throw new Exception(pht('No content engine can render this document.'));
}
$vectors = array();
foreach ($engines as $key => $usable_engine) {
$vectors[$key] = $usable_engine->newSortVector($ref);
}
$vectors = msortv($vectors, 'getSelf');
return array_select_keys($engines, array_keys($vectors));
}
protected function getByteLengthLimit() {
return (1024 * 1024 * 8);
}
protected function canRenderCompleteDocument(PhabricatorDocumentRef $ref) {
$limit = $this->getByteLengthLimit();
if ($limit) {View on GitHub (pinned to 5720a38cfe)
Solutions
- Check the file's detected MIME type; rename or re-upload the file with a correct, recognized extension
- Compare the file size against engine byte limits; if too large, download the file instead of requesting a rendered view
- Review document engine enable/disable configuration to confirm the engine for this format was not switched off
- For custom formats, register a PhabricatorDocumentEngine subclass whose canRenderDocument() accepts the type
Defensive patterns
Strategy: fallback
Validate before calling
$engines = id(new PhabricatorDocumentEngine())
->setViewer($viewer)
->newEngines($ref);
if (!$engines) {
// nothing can render this ref: offer a raw download link instead
} Try / catch
catch the Exception at the document-rendering boundary and fall back to a plain download response with a friendly message.
Prevention
- Constrain uploads to formats your deployment has engines for
- Keep MIME detection accurate (extension plus content inspection)
- Register custom PhabricatorDocumentEngine subclasses for formats your users rely on
When it happens
Trigger: Requesting a rendered (browse) view for a file whose MIME type or extension no engine claims, or where every engine that claims it refuses it — e.g. the file exceeds the engine's byte limit (getByteLengthLimit()), or its data cannot be loaded for probing.
Common situations: Exotic or misdetected MIME types uploaded as generic application/octet-stream; very large files above all engines' byte limits; deployments that disabled default engines via configuration; files whose extension was lost on upload.
Related errors
- Failed to "json_decode(...)" JSON document after successfull
- Found no background template resource for dimensions %dx%d.
- Found no template resource (for emblem "%s") with dimensions
- Unable to find fetch!
- Unable to find lines.
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/d3dffe8c6e928936.
Report an issue: GitHub.