phacility/phabricator · error · Exception

Unexpected "git upload-pack" initial protocol frame: expecte

Error message

Unexpected "git upload-pack" initial protocol frame: expected "<hash> <name>\0<capabilities>\n", or "shallow <hash>\n", got "%s".

What it means

Error "Unexpected "git upload-pack" initial protocol frame: expected "<hash> <name>\0<capabilities>\n", or "shallow <hash>\n", got "%s"." thrown in phacility/phabricator.

Source

Thrown at src/applications/diffusion/protocol/DiffusionGitUploadPackWireProtocol.php:227

      }

      $ok = preg_match(
        '('.
          '^'.
          '(?:'.
            '(?P<hash>[0-9a-f]{40}) (?P<name>[^\0\n]+)'.$capabilities_pattern.
            '|'.
            'shallow (?P<shallow>[0-9a-f]{40})'.
          ')'.
          '\n'.
          '\z'.
        ')',
        $bytes,
        $matches);

      if (!$ok) {
        if ($is_first) {
          throw new Exception(
            pht(
              'Unexpected "git upload-pack" initial protocol frame: expected '.
              '"<hash> <name>\0<capabilities>\n", or '.
              '"shallow <hash>\n", got "%s".',
              $bytes));
        } else {
          throw new Exception(
            pht(
              'Unexpected "git upload-pack" protocol frame: expected '.
              '"<hash> <name>\n", or "shallow <hash>\n", got "%s".',
              $bytes));
        }
      }

      if (isset($matches['shallow'])) {
        $name = null;
        $hash = $matches['shallow'];
        $is_shallow = true;

View on GitHub (pinned to 5720a38cfe)

When it happens

Trigger: Thrown at src/applications/diffusion/protocol/DiffusionGitUploadPackWireProtocol.php:227 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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