phacility/phabricator · warning · Exception

Too many Conduit methods provided.

Error message

Too many Conduit methods provided.

What it means

The SSH conduit workflow accepts the method as a wildcard argument but requires exactly one value (count($methodv) > 1 throws 'Too many Conduit methods provided.'). Extra tokens after the method name are interpreted as additional methods rather than method arguments.

Source

Thrown at src/applications/conduit/ssh/ConduitSSHWorkflow.php:23

  protected function didConstruct() {
    $this->setName('conduit');
    $this->setArguments(
      array(
        array(
          'name'      => 'method',
          'wildcard'  => true,
        ),
      ));
  }

  public function execute(PhutilArgumentParser $args) {
    $time_start = microtime(true);

    $methodv = $args->getArg('method');
    if (!$methodv) {
      throw new Exception(pht('No Conduit method provided.'));
    } else if (count($methodv) > 1) {
      throw new Exception(pht('Too many Conduit methods provided.'));
    }

    $method = head($methodv);

    $json = $this->readAllInput();
    $raw_params = null;
    try {
      $raw_params = phutil_json_decode($json);
    } catch (PhutilJSONParserException $ex) {
      throw new PhutilProxyException(
        pht('Invalid JSON input.'),
        $ex);
    }

    $params = idx($raw_params, 'params', '[]');
    $params = phutil_json_decode($params);
    $metadata = idx($params, '__conduit__', array());
    unset($params['__conduit__']);

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Keep exactly one token after 'conduit' (the method name) and pass every parameter via the JSON stdin payload.
  2. Check shell quoting/word-splitting if you believe you passed only one token.

Example fix

# before
$ echo '{"params":"{}"}' | ssh -p 2222 vcs@phab.example.com conduit maniphest.task.search 123
# after
$ echo '{"params":"{\"constraints\":{\"ids\":[123]}}"}' | ssh -p 2222 vcs@phab.example.com conduit maniphest.task.search
Defensive patterns

Strategy: validation

Validate before calling

# Exactly one method token; parameters go in the stdin JSON.
set -- method_name_only
[ "$#" -eq 1 ] || { echo 'one method, params via stdin JSON'; exit 2; }
echo "$PAYLOAD" | ssh -p 2222 vcs@phab.example.com conduit "$1"

Prevention

When it happens

Trigger: Running `ssh ... conduit maniphest.task.search 123` expecting 123 to be an argument; a quoting error that splits one argument into two tokens.

Common situations: Assuming a POSIX-style CLI where arguments follow the subcommand; all real parameters must travel inside the JSON on stdin, not on the command line.

Related errors


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