{"record":{"id":"2adb3413e1f6ee10","repo":"phacility/phabricator","slug":"patch-size-exceeds-configured-byte-size-limit-s","errorCode":null,"errorMessage":"Patch size exceeds configured byte size limit (\"%s\") of %s.","messagePattern":"Patch size exceeds configured byte size limit \\(\"(.+?)\"\\) of (.+?)\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/repository/worker/PhabricatorRepositoryCommitPublishWorker.php","lineNumber":404,"sourceCode":"      array(\n        'commit' => $identifier,\n        'linesOfContext' => 3,\n        'timeout' => $time_limit,\n        'byteLimit' => $byte_limit,\n      ));\n\n    if ($diff_info['tooSlow']) {\n      throw new Exception(\n        pht(\n          'Patch generation took longer than configured limit (\"%s\") of '.\n          '%s second(s).',\n          $time_key,\n          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    }","sourceCodeStart":386,"sourceCodeEnd":422,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/repository/worker/PhabricatorRepositoryCommitPublishWorker.php#L386-L422","documentation":"Same publish path, but the raw diff exceeded the byte cap from metamta.diffusion.byte-limit; the conduit result sets tooHuge and the worker throws (PhabricatorRepositoryCommitPublishWorker.php:402-409). The cap bounds how large a patch Phabricator is willing to generate and attach to commit email.","triggerScenarios":"A commit whose diff is larger than the configured byte limit: mass vendored-dependency updates, generated-code dumps, repository-wide renames or reformatting commits.","commonSituations":"Monorepo dependency-sync commits; code-generation or formatting sweeps; default byte limit smaller than the repository's routine commits.","solutions":["Raise the limit: bin/config set metamta.diffusion.byte-limit 8388608 (8 MB)","Or split the offending commit so no single diff exceeds the cap","Re-run publishing for the stuck commits after the config change: bin/repository reparse --message <monogram>"],"exampleFix":"# before\nbin/config set metamta.diffusion.byte-limit 1048576\n\n# after\nbin/config set metamta.diffusion.byte-limit 8388608","handlingStrategy":"validation","validationCode":"// Know your largest diffs and set the cap above them:\n//   git show <biggest-sha> | wc -c   (plus context overhead)\n// bin/config set metamta.diffusion.byte-limit 8388608","typeGuard":null,"tryCatchPattern":"try {\n  $patch = $this->loadRawPatchText($repository, $commit);\n} catch (Exception $ex) {\n  // tooHuge: raise metamta.diffusion.byte-limit or split the commit;\n  // retrying unchanged will fail identically every time.\n  phlog($ex);\n  throw $ex;\n}","preventionTips":["Set metamta.diffusion.byte-limit based on measured largest-commit diff size","Split generated-code or vendored-dependency mega-commits","Review the limit after repository layout changes or dependency-sync automation"],"tags":["phabricator","email","diff-size","configuration","payload-limit","php"],"backgroundTag":"payload-size-limit-exceeded","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}