{"record":{"id":"e9052c617c0a208b","repo":"phacility/phabricator","slug":"bad-frame-length-character-in-git-protocol-s","errorCode":null,"errorMessage":"Bad frame length character in Git protocol (\"%s\"), expected a 4-digit hexadecimal value encoded as ASCII text.","messagePattern":"Bad frame length character in Git protocol \\(\"(.+?)\"\\), expected a 4-digit hexadecimal value encoded as ASCII text\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/diffusion/protocol/DiffusionGitUploadPackWireProtocol.php","lineNumber":35,"sourceCode":"    if ($this->readBuffer === null) {\n      $this->readBuffer = new PhutilRope();\n    }\n    $buffer = $this->readBuffer;\n\n    $buffer->append($bytes);\n\n    while (true) {\n      $len = $buffer->getByteLength();\n      switch ($this->readMode) {\n        case 'length':\n          // We're expecting 4 bytes containing the length of the protocol\n          // frame as hexadecimal in ASCII text, like \"01ab\". Wait until we\n          // see at least 4 bytes on the wire.\n          if ($len < 4) {\n            if ($len > 0) {\n              $bytes = $this->peekBytes($len);\n              if (!preg_match('/^[0-9a-f]+\\z/', $bytes)) {\n                throw new Exception(\n                  pht(\n                    'Bad frame length character in Git protocol (\"%s\"), '.\n                    'expected a 4-digit hexadecimal value encoded as ASCII '.\n                    'text.',\n                    $bytes));\n              }\n            }\n\n            // We can't make any more progress until we get enough bytes, so\n            // we're done with state processing.\n            break 2;\n          }\n\n          $frame_length = $this->readBytes(4);\n          $frame_length = hexdec($frame_length);\n\n          // Note that the frame length includes the 4 header bytes, so we\n          // usually expect a length of 5 or larger. Frames with length 0","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/diffusion/protocol/DiffusionGitUploadPackWireProtocol.php#L17-L53","documentation":"Error \"Bad frame length character in Git protocol (\"%s\"), expected a 4-digit hexadecimal value encoded as ASCII text.\" thrown in phacility/phabricator.","triggerScenarios":"Thrown at src/applications/diffusion/protocol/DiffusionGitUploadPackWireProtocol.php:35 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"}