{"record":{"id":"b3abbc46d4db290f","repo":"phacility/phabricator","slug":"failed-to-load-file","errorCode":null,"errorMessage":"Failed to load file.","messagePattern":"Failed to load file\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/files/controller/PhabricatorFileDropUploadController.php","lineNumber":114,"sourceCode":"        'name' => $request->getStr('name'),\n        'authorPHID' => $viewer->getPHID(),\n        'viewPolicy' => $view_policy,\n        'isExplicitUpload' => true,\n      ));\n\n    $result = $file->getDragAndDropDictionary();\n    return id(new AphrontAjaxResponse())->setContent($result);\n  }\n\n  private function loadFile($file_phid) {\n    $viewer = $this->getViewer();\n\n    $file = id(new PhabricatorFileQuery())\n      ->setViewer($viewer)\n      ->withPHIDs(array($file_phid))\n      ->executeOne();\n    if (!$file) {\n      throw new Exception(pht('Failed to load file.'));\n    }\n\n    return $file;\n  }\n\n}\n","sourceCodeStart":96,"sourceCodeEnd":121,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/files/controller/PhabricatorFileDropUploadController.php#L96-L121","documentation":"Generic lookup-miss guard in the controller's private loadFile helper: a PhabricatorFileQuery by PHID (visibility-filtered by the acting viewer) returned no row for the file PHID handed to it. Either the PHID is wrong, the file was deleted, or the viewer lacks permission to see it — the message does not distinguish these cases.","triggerScenarios":"Thrown at src/applications/files/controller/PhabricatorFileDropUploadController.php:114 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the file PHID passed to the uploader actually exists (e.g. via file.search or the /F monogram URI)","Check the acting viewer's view policy on the file; the query is policy-filtered so invisible files look identical to missing ones","If the file was deleted or expired from temporary storage, re-upload the file and retry with the new PHID"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","contentChangedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}