{"record":{"id":"473e44b825f87f4c","repo":"phacility/phabricator","slug":"unexpected-git-upload-pack-initial-protocol-fram","errorCode":null,"errorMessage":"Unexpected \"git upload-pack\" initial protocol frame: expected \"<hash> <name>\\0<capabilities>\\n\", or \"shallow <hash>\\n\", got \"%s\".","messagePattern":"Unexpected \"git upload-pack\" initial protocol frame: expected \"<hash> <name>\\\\0<capabilities>\\\\n\", or \"shallow <hash>\\\\n\", got \"(.+?)\"\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/diffusion/protocol/DiffusionGitUploadPackWireProtocol.php","lineNumber":227,"sourceCode":"      }\n\n      $ok = preg_match(\n        '('.\n          '^'.\n          '(?:'.\n            '(?P<hash>[0-9a-f]{40}) (?P<name>[^\\0\\n]+)'.$capabilities_pattern.\n            '|'.\n            'shallow (?P<shallow>[0-9a-f]{40})'.\n          ')'.\n          '\\n'.\n          '\\z'.\n        ')',\n        $bytes,\n        $matches);\n\n      if (!$ok) {\n        if ($is_first) {\n          throw new Exception(\n            pht(\n              'Unexpected \"git upload-pack\" initial protocol frame: expected '.\n              '\"<hash> <name>\\0<capabilities>\\n\", or '.\n              '\"shallow <hash>\\n\", got \"%s\".',\n              $bytes));\n        } else {\n          throw new Exception(\n            pht(\n              'Unexpected \"git upload-pack\" protocol frame: expected '.\n              '\"<hash> <name>\\n\", or \"shallow <hash>\\n\", got \"%s\".',\n              $bytes));\n        }\n      }\n\n      if (isset($matches['shallow'])) {\n        $name = null;\n        $hash = $matches['shallow'];\n        $is_shallow = true;","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/diffusion/protocol/DiffusionGitUploadPackWireProtocol.php#L209-L245","documentation":"Error \"Unexpected \"git upload-pack\" initial protocol frame: expected \"<hash> <name>\\0<capabilities>\\n\", or \"shallow <hash>\\n\", got \"%s\".\" thrown in phacility/phabricator.","triggerScenarios":"Thrown at src/applications/diffusion/protocol/DiffusionGitUploadPackWireProtocol.php:227 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}