{"record":{"id":"022b9479e9c270bb","repo":"phacility/phabricator","slug":"failed-to-load-favicon-template-with-phid-s","errorCode":null,"errorMessage":"Failed to load favicon template with PHID \"%s\".","messagePattern":"Failed to load favicon template with PHID \"(.+?)\"\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/files/favicon/PhabricatorFaviconRef.php","lineNumber":431,"sourceCode":"\n    $viewer = $this->getViewer();\n\n    $resource = $all_resources[$best_score];\n    if ($resource['source-type'] === 'builtin') {\n      $file = PhabricatorFile::loadBuiltin($viewer, $resource['source']);\n      if (!$file) {\n        throw new Exception(\n          pht(\n            'Failed to load favicon template builtin \"%s\".',\n            $resource['source']));\n      }\n    } else {\n      $file = id(new PhabricatorFileQuery())\n        ->setViewer($viewer)\n        ->withPHIDs(array($resource['source']))\n        ->executeOne();\n      if (!$file) {\n        throw new Exception(\n          pht(\n            'Failed to load favicon template with PHID \"%s\".',\n            $resource['source']));\n      }\n    }\n\n    return array(\n      'width' => $resource['width'],\n      'height' => $resource['height'],\n      'file' => $file,\n    );\n  }\n\n  private function newFaviconFile($data) {\n    return PhabricatorFile::newFromFileData(\n      $data,\n      array(\n        'name' => 'favicon',","sourceCodeStart":413,"sourceCodeEnd":449,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/files/favicon/PhabricatorFaviconRef.php#L413-L449","documentation":"The selected favicon template references a concrete PhabricatorFile by PHID; the PhabricatorFileQuery executed with the acting viewer returned no file. Either the file record was deleted while the template map still references its PHID, or the file's visibility policy hides it from the viewer doing the favicon rendering.","triggerScenarios":"Deleting (or making private) a file used as a favicon template while configuration still points at its PHID; the favicon render runs as a viewer whose policies exclude the file.","commonSituations":"An emblem image uploaded then later cleaned up by an admin; policy changes locking files to a project; configuration referencing PHIDs from another instance after a partial migration.","solutions":["Re-upload the template image and update the favicon configuration to the new PHID","Or adjust the file's policy so the viewer performing favicon rendering can see it","Remove the stale template entry if that emblem/template is no longer used"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"$file = id(new PhabricatorFileQuery())\n  ->setViewer($viewer)\n  ->withPHIDs(array($resource['source']))\n  ->executeOne();\nif (!$file) {\n  // template file deleted or invisible: skip this template\n}","typeGuard":null,"tryCatchPattern":"catch Exception and fall back to the default (builtin) favicon template when a PHID-backed template fails to load.","preventionTips":["Store favicon template files under stable, always-visible policies","Audit favicon configuration for PHID references before deleting any files"],"tags":["favicon","file-policy","dangling-reference","phid"],"backgroundTag":"missing-file-record","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}