{"record":{"id":"f3369ab2dbde23be","repo":"phacility/phabricator","slug":"this-file-data-is-incomplete","errorCode":null,"errorMessage":"This file data is incomplete!","messagePattern":"This file data is incomplete!","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/files/engine/PhabricatorChunkedFileStorageEngine.php","lineNumber":43,"sourceCode":"\n  public function isChunkEngine() {\n    return true;\n  }\n\n  public function writeFile($data, array $params) {\n    // The chunk engine does not support direct writes.\n    throw new PhutilMethodNotImplementedException();\n  }\n\n  public function readFile($handle) {\n    // This is inefficient, but makes the API work as expected.\n    $chunks = $this->loadAllChunks($handle, true);\n\n    $buffer = '';\n    foreach ($chunks as $chunk) {\n      $data_file = $chunk->getDataFile();\n      if (!$data_file) {\n        throw new Exception(pht('This file data is incomplete!'));\n      }\n\n      $buffer .= $chunk->getDataFile()->loadFileData();\n    }\n\n    return $buffer;\n  }\n\n  public function deleteFile($handle) {\n    $engine = new PhabricatorDestructionEngine();\n    $chunks = $this->loadAllChunks($handle, true);\n    foreach ($chunks as $chunk) {\n      $engine->destroyObject($chunk);\n    }\n  }\n\n  private function loadAllChunks($handle, $need_files) {\n    $chunks = id(new PhabricatorFileChunkQuery())","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/files/engine/PhabricatorChunkedFileStorageEngine.php#L25-L61","documentation":"PhabricatorChunkedFileStorageEngine::readFile() reconstructs large files by concatenating their chunks; this exception fires when at least one chunk row has no data file attached (getDataFile() returns null), meaning the chunked upload never completed for that chunk. The engine is being asked to read a file whose data set is incomplete.","triggerScenarios":"Reading a file whose resumable upload was interrupted partway — some file_chunk rows for the file's handle still have a null dataFilePHID — typically when the client abandoned the upload or the file was marked complete incorrectly.","commonSituations":"Browser closed or network dropped during a large chunked upload; upload client crashed between chunk transfers; retries that created a new upload but left the old file record readable.","solutions":["Re-upload the file and let the resumable upload client run to completion so every chunk gets data","Inspect the chunk rows for the file's storage handle and identify chunks with a NULL dataFilePHID to confirm which upload failed","If the original data is gone, destroy the broken file record explicitly so nothing references the incomplete data","Check upload client logs/daemon state for the abandoned transfer that left the file in this state"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"$chunks = id(new PhabricatorFileChunkQuery())\n  ->setViewer(PhabricatorUser::getOmnipotentUser())\n  ->withChunkHandles(array($file->getStorageHandle()))\n  ->execute();\n$missing = array_filter($chunks, function ($c) {\n  return $c->getDataFilePHID() === null;\n});\nif ($missing) {\n  // upload incomplete: block reads and prompt a re-upload\n}","typeGuard":null,"tryCatchPattern":"catch Exception from loadFileData()/readFile() on chunked files, report 'upload incomplete', and offer re-upload — do not retry the read.","preventionTips":["Let resumable upload clients run to completion before sharing files","Surface missing-chunk files as upload failures rather than readable objects"],"tags":["storage","chunked-upload","incomplete-upload","resumable"],"backgroundTag":"incomplete-multipart-upload","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}