phacility/phabricator · error · Exception

Patch size exceeds configured byte size limit ("%s") of %s.

Error message

Patch size exceeds configured byte size limit ("%s") of %s.

What it means

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.

Source

Thrown at src/applications/repository/worker/PhabricatorRepositoryCommitPublishWorker.php:404

      array(
        'commit' => $identifier,
        'linesOfContext' => 3,
        'timeout' => $time_limit,
        'byteLimit' => $byte_limit,
      ));

    if ($diff_info['tooSlow']) {
      throw new Exception(
        pht(
          'Patch generation took longer than configured limit ("%s") of '.
          '%s second(s).',
          $time_key,
          new PhutilNumber($time_limit)));
    }

    if ($diff_info['tooHuge']) {
      $pretty_limit = phutil_format_bytes($byte_limit);
      throw new Exception(
        pht(
          'Patch size exceeds configured byte size limit ("%s") of %s.',
          $byte_key,
          $pretty_limit));
    }

    $file_phid = $diff_info['filePHID'];
    $file = id(new PhabricatorFileQuery())
      ->setViewer($viewer)
      ->withPHIDs(array($file_phid))
      ->executeOne();
    if (!$file) {
      throw new Exception(
        pht(
          'Failed to load file ("%s") returned by "%s".',
          $file_phid,
          'diffusion.rawdiffquery'));
    }

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Raise the limit: bin/config set metamta.diffusion.byte-limit 8388608 (8 MB)
  2. Or split the offending commit so no single diff exceeds the cap
  3. Re-run publishing for the stuck commits after the config change: bin/repository reparse --message <monogram>

Example fix

# before
bin/config set metamta.diffusion.byte-limit 1048576

# after
bin/config set metamta.diffusion.byte-limit 8388608
Defensive patterns

Strategy: validation

Validate before calling

// Know your largest diffs and set the cap above them:
//   git show <biggest-sha> | wc -c   (plus context overhead)
// bin/config set metamta.diffusion.byte-limit 8388608

Try / catch

try {
  $patch = $this->loadRawPatchText($repository, $commit);
} catch (Exception $ex) {
  // tooHuge: raise metamta.diffusion.byte-limit or split the commit;
  // retrying unchanged will fail identically every time.
  phlog($ex);
  throw $ex;
}

Prevention

When it happens

Trigger: A commit whose diff is larger than the configured byte limit: mass vendored-dependency updates, generated-code dumps, repository-wide renames or reformatting commits.

Common situations: Monorepo dependency-sync commits; code-generation or formatting sweeps; default byte limit smaller than the repository's routine commits.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/2adb3413e1f6ee10. Report an issue: GitHub.