phacility/phabricator · warning · Exception

Client closed connection before sending a complete protocol

Error message

Client closed connection before sending a complete protocol frame.

What it means

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.

Source

Thrown at src/applications/diffusion/ssh/DiffusionSubversionServeSSHWorkflow.php:127

          $struct = $message['structure'];

          // This is the:
          //
          //   ( version ( cap1 ... ) url ... )
          //
          // The `url` allows us to identify the repository.

          $uri = $struct[2]['value'];
          $path = $this->getPathFromSubversionURI($uri);

          return $this->loadRepositoryWithPath(
            $path,
            PhabricatorRepositoryType::REPOSITORY_TYPE_SVN);
        }
      }

      if (!$io_channel->isOpenForReading()) {
        throw new Exception(
          pht(
            'Client closed connection before sending a complete protocol '.
            'frame.'));
      }

      // If the client has disconnected, kill the subprocess and bail.
      if (!$io_channel->isOpenForWriting()) {
        throw new Exception(
          pht(
            'Client closed connection before receiving response.'));
      }
    }
  }

  protected function executeRepositoryOperations() {
    $repository = $this->getRepository();

    $args = $this->getArgs();

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Retry the svn command - a disconnect during handshake is usually transient and client-initiated
  2. Inspect the client output above the error for the real cause (host key prompt, auth failure, timeout)
  3. If reproducible, test the same client against another svn+ssh host to rule out client corruption
Defensive patterns

Strategy: try-catch

Try / catch

try {
  $workflow->execute($args);
} catch (Exception $ex) {
  // Client abandoned the handshake: exit quietly with a non-zero code.
  // No server state was modified, so no rollback is needed.
  return 1;
}

Prevention

When it happens

Trigger: 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.

Common situations: Interactive users canceling at password or host-key prompts; CI jobs killed during checkout; flaky links between client and the Phabricator host.

Related errors


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