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

  1. Check the file's detected MIME type; rename or re-upload the file with a correct, recognized extension
  2. Compare the file size against engine byte limits; if too large, download the file instead of requesting a rendered view
  3. Review document engine enable/disable configuration to confirm the engine for this format was not switched off
  4. 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

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


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/d3dffe8c6e928936. Report an issue: GitHub.