{"record":{"id":"d7138419eae1208e","repo":"phacility/phabricator","slug":"chunk-end-byte-is-d-not-d","errorCode":null,"errorMessage":"Chunk end byte is %d, not %d.","messagePattern":"Chunk end byte is (.+?), not (.+?)\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/files/conduit/FileConduitAPIMethod.php","lineNumber":68,"sourceCode":"      phlog($chunks);\n      throw new Exception(\n        pht(\n          'There are multiple chunks in byte range %d - %d.',\n          $start,\n          $end));\n    }\n\n    $chunk = head($chunks);\n    if ($chunk->getByteStart() != $start) {\n      throw new Exception(\n        pht(\n          'Chunk start byte is %d, not %d.',\n          $chunk->getByteStart(),\n          $start));\n    }\n\n    if ($chunk->getByteEnd() != $end) {\n      throw new Exception(\n        pht(\n          'Chunk end byte is %d, not %d.',\n          $chunk->getByteEnd(),\n          $end));\n    }\n\n    if ($chunk->getDataFilePHID()) {\n      throw new Exception(\n        pht('Chunk has already been uploaded.'));\n    }\n\n    return $chunk;\n  }\n\n  protected function decodeBase64($data) {\n    $data = base64_decode($data, $strict = true);\n    if ($data === false) {\n      throw new Exception(pht('Unable to decode base64 data!'));","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/files/conduit/FileConduitAPIMethod.php#L50-L86","documentation":"Boundary guard in loadFileChunkForUpload: the matched chunk's end byte differs from the client's requested end, so the client is uploading a range whose size/extent does not match the allocated chunk. The data would not fill the chunk exactly.","triggerScenarios":"Thrown at src/applications/files/conduit/FileConduitAPIMethod.php:68 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the server-allocated byteEnd for the chunk upload","Restart the chunked upload to resynchronize client and server ranges"],"exampleFix":null,"handlingStrategy":"validation","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"}