{"record":{"id":"ce12ef4d7b6cfb5d","repo":"phacility/phabricator","slug":"client-closed-connection-before-sending-a-complete","errorCode":null,"errorMessage":"Client closed connection before sending a complete protocol frame.","messagePattern":"Client closed connection before sending a complete protocol frame\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"warning","filePath":"src/applications/diffusion/ssh/DiffusionSubversionServeSSHWorkflow.php","lineNumber":127,"sourceCode":"          $struct = $message['structure'];\n\n          // This is the:\n          //\n          //   ( version ( cap1 ... ) url ... )\n          //\n          // The `url` allows us to identify the repository.\n\n          $uri = $struct[2]['value'];\n          $path = $this->getPathFromSubversionURI($uri);\n\n          return $this->loadRepositoryWithPath(\n            $path,\n            PhabricatorRepositoryType::REPOSITORY_TYPE_SVN);\n        }\n      }\n\n      if (!$io_channel->isOpenForReading()) {\n        throw new Exception(\n          pht(\n            'Client closed connection before sending a complete protocol '.\n            'frame.'));\n      }\n\n      // If the client has disconnected, kill the subprocess and bail.\n      if (!$io_channel->isOpenForWriting()) {\n        throw new Exception(\n          pht(\n            'Client closed connection before receiving response.'));\n      }\n    }\n  }\n\n  protected function executeRepositoryOperations() {\n    $repository = $this->getRepository();\n\n    $args = $this->getArgs();","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/diffusion/ssh/DiffusionSubversionServeSSHWorkflow.php#L109-L145","documentation":"During repository identification the SSH client closed its side before sending a complete first ra_svn frame - the frame that carries the repository URL. The server aborts because it never learned which repository the client wanted; the failure is on the client side, not in Phabricator.","triggerScenarios":"User cancels svn mid-handshake; client-side timeout or host-key prompt refusal; network drop immediately after connect; a client bug truncating the first write.","commonSituations":"Interactive users canceling at password or host-key prompts; CI jobs killed during checkout; flaky links between client and the Phabricator host.","solutions":["Retry the svn command - a disconnect during handshake is usually transient and client-initiated","Inspect the client output above the error for the real cause (host key prompt, auth failure, timeout)","If reproducible, test the same client against another svn+ssh host to rule out client corruption"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  $workflow->execute($args);\n} catch (Exception $ex) {\n  // Client abandoned the handshake: exit quietly with a non-zero code.\n  // No server state was modified, so no rollback is needed.\n  return 1;\n}","preventionTips":["Make automated clients non-interactive (accept host keys, provide credentials up front) so they never die mid-handshake","Do not build tooling that opens svn+ssh sockets and abandons them"],"tags":["phabricator","svn","ssh","disconnect","handshake"],"backgroundTag":"client-disconnected","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}