{"record":{"id":"7fab79fc68301f36","repo":"phacility/phabricator","slug":"unable-to-load-mysql-blob-file-s","errorCode":null,"errorMessage":"Unable to load MySQL blob file '%s'!","messagePattern":"Unable to load MySQL blob file '(.+?)'!","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/files/engine/PhabricatorMySQLFileStorageEngine.php","lineNumber":90,"sourceCode":"  public function deleteFile($handle) {\n    $this->loadFromMySQLFileStorage($handle)->delete();\n  }\n\n\n/* -(  Internals  )---------------------------------------------------------- */\n\n\n  /**\n   * Load the Lisk object that stores the file data for a handle.\n   *\n   * @param string  File data handle.\n   * @return PhabricatorFileStorageBlob Data DAO.\n   * @task internal\n   */\n  private function loadFromMySQLFileStorage($handle) {\n    $blob = id(new PhabricatorFileStorageBlob())->load($handle);\n    if (!$blob) {\n      throw new Exception(pht(\"Unable to load MySQL blob file '%s'!\", $handle));\n    }\n    return $blob;\n  }\n\n}\n","sourceCodeStart":72,"sourceCodeEnd":96,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/files/engine/PhabricatorMySQLFileStorageEngine.php#L72-L96","documentation":"The MySQL storage engine stores each file's bytes in a blob row keyed by the file's storage handle; loadFromMySQLFileStorage() throws when PhabricatorFileStorageBlob->load($handle) returns nothing. The file metadata row exists and points at a handle, but the blob row for that handle is missing from the database.","triggerScenarios":"The blob row was deleted manually, a partial database restore recovered the file table but not file_storageblob, or the file's storage handle was recorded against the wrong engine/row.","commonSituations":"Selective table restores after an incident; manual deletion of 'large' blob rows to reclaim space; incomplete migration between storage engines that left handles pointing at MySQL blobs that were already moved.","solutions":["Confirm the row is really gone: SELECT * FROM file_storageblob WHERE id = <handle>","If lost, restore the blob row(s) from a backup taken together with the file table","If unrecoverable, destroy the file record explicitly so the UI shows a deleted file instead of a read error","When migrating storage engines, run the complete storage migration so every file's handle matches the engine that holds its bytes"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"$blob = id(new PhabricatorFileStorageBlob())->load($file->getStorageHandle());\nif (!$blob) {\n  // data row missing: treat file as lost, do not attempt read\n}","typeGuard":null,"tryCatchPattern":"catch Exception from engine reads, mark the file record as deleted/corrupt in the UI, and log the handle for restoration from backup.","preventionTips":["Back up the file and blob tables together","Use the supported storage migration workflow instead of ad-hoc engine moves"],"tags":["storage","mysql","missing-row","data-consistency"],"backgroundTag":"missing-storage-object","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}