{"record":{"id":"d3dffe8c6e928936","repo":"phacility/phabricator","slug":"no-content-engine-can-render-this-document","errorCode":null,"errorMessage":"No content engine can render this document.","messagePattern":"No content engine can render this document\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/files/document/PhabricatorDocumentEngine.php","lineNumber":227,"sourceCode":"  final public static function getEnginesForRef(\n    PhabricatorUser $viewer,\n    PhabricatorDocumentRef $ref) {\n    $engines = self::getAllEngines();\n\n    foreach ($engines as $key => $engine) {\n      $engine = id(clone $engine)\n        ->setViewer($viewer);\n\n      if (!$engine->canRenderDocument($ref)) {\n        unset($engines[$key]);\n        continue;\n      }\n\n      $engines[$key] = $engine;\n    }\n\n    if (!$engines) {\n      throw new Exception(pht('No content engine can render this document.'));\n    }\n\n    $vectors = array();\n    foreach ($engines as $key => $usable_engine) {\n      $vectors[$key] = $usable_engine->newSortVector($ref);\n    }\n    $vectors = msortv($vectors, 'getSelf');\n\n    return array_select_keys($engines, array_keys($vectors));\n  }\n\n  protected function getByteLengthLimit() {\n    return (1024 * 1024 * 8);\n  }\n\n  protected function canRenderCompleteDocument(PhabricatorDocumentRef $ref) {\n    $limit = $this->getByteLengthLimit();\n    if ($limit) {","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/files/document/PhabricatorDocumentEngine.php#L209-L245","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"$engines = id(new PhabricatorDocumentEngine())\n  ->setViewer($viewer)\n  ->newEngines($ref);\nif (!$engines) {\n  // nothing can render this ref: offer a raw download link instead\n}","typeGuard":null,"tryCatchPattern":"catch the Exception at the document-rendering boundary and fall back to a plain download response with a friendly message.","preventionTips":["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"],"tags":["rendering","mime-type","document-engine","file-size-limit"],"backgroundTag":"unsupported-content-type","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}