{"record":{"id":"21fdfac0b38709a5","repo":"phacility/phabricator","slug":"failed-to-load-file-s-returned-by-s-21fdfa","errorCode":null,"errorMessage":"Failed to load file (\"%s\") returned by \"%s\".","messagePattern":"Failed to load file \\(\"(.+?)\"\\) returned by \"(.+?)\"\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/repository/worker/PhabricatorRepositoryCommitPublishWorker.php","lineNumber":417,"sourceCode":"          new PhutilNumber($time_limit)));\n    }\n\n    if ($diff_info['tooHuge']) {\n      $pretty_limit = phutil_format_bytes($byte_limit);\n      throw new Exception(\n        pht(\n          'Patch size exceeds configured byte size limit (\"%s\") of %s.',\n          $byte_key,\n          $pretty_limit));\n    }\n\n    $file_phid = $diff_info['filePHID'];\n    $file = id(new PhabricatorFileQuery())\n      ->setViewer($viewer)\n      ->withPHIDs(array($file_phid))\n      ->executeOne();\n    if (!$file) {\n      throw new Exception(\n        pht(\n          'Failed to load file (\"%s\") returned by \"%s\".',\n          $file_phid,\n          'diffusion.rawdiffquery'));\n    }\n\n    return $file->loadFileData();\n  }\n\n  private function closeRevisions(\n    PhabricatorUser $actor,\n    PhabricatorRepositoryCommit $commit) {\n\n    $differential = 'PhabricatorDifferentialApplication';\n    if (!PhabricatorApplication::isClassInstalled($differential)) {\n      return;\n    }\n","sourceCodeStart":399,"sourceCodeEnd":435,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/repository/worker/PhabricatorRepositoryCommitPublishWorker.php#L399-L435","documentation":"diffusion.rawdiffquery returned a filePHID for the generated patch, but the immediately following PhabricatorFileQuery (omnipotent viewer) cannot load it (PhabricatorRepositoryCommitPublishWorker.php:411-422). This is an internal invariant break: the file was just written by the same pipeline, so realistic causes are aggressive file garbage collection or storage-engine trouble.","triggerScenarios":"File GC (a very short storage TTL) deleting the patch file between generation and load; a flaky custom storage backend (e.g., S3) losing the just-written object; a DB transaction rollback between the two steps.","commonSituations":"Aggressive storage.ttl configuration; misconfigured or throttled blob storage; partial restores of the file table.","solutions":["Look up the reported file PHID in the Files application or the file table to see if/when it vanished","Check file storage config and GC TTL; raise storage.ttl if it was set very low","Fix storage engine issues, then re-run publishing for the commit so a fresh patch file is generated"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Verify the file backend is healthy before publish runs (operational check):\n//   bin/storage status\n// and ensure storage TTL is not shorter than your publish queue lag.","typeGuard":null,"tryCatchPattern":"try {\n  $data = $this->loadRawPatchText($repository, $commit);\n} catch (Exception $ex) {\n  // File vanished between generation and load (GC/TTL or storage flake):\n  // transient by nature - let the task retry, which regenerates the file.\n  phlog($ex);\n  throw $ex;\n}","preventionTips":["Keep storage TTL comfortably longer than worker-queue lag","Monitor blob storage health (S3/local disk) on daemon hosts","Requeue the publish task (bin/repository reparse) after fixing storage"],"tags":["phabricator","files","garbage-collection","storage","publish","php"],"backgroundTag":"missing-file-record","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}