{"record":{"id":"22a8497be3976ed3","repo":"phacility/phabricator","slug":"too-many-conduit-methods-provided","errorCode":null,"errorMessage":"Too many Conduit methods provided.","messagePattern":"Too many Conduit methods provided\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"warning","filePath":"src/applications/conduit/ssh/ConduitSSHWorkflow.php","lineNumber":23,"sourceCode":"  protected function didConstruct() {\n    $this->setName('conduit');\n    $this->setArguments(\n      array(\n        array(\n          'name'      => 'method',\n          'wildcard'  => true,\n        ),\n      ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $time_start = microtime(true);\n\n    $methodv = $args->getArg('method');\n    if (!$methodv) {\n      throw new Exception(pht('No Conduit method provided.'));\n    } else if (count($methodv) > 1) {\n      throw new Exception(pht('Too many Conduit methods provided.'));\n    }\n\n    $method = head($methodv);\n\n    $json = $this->readAllInput();\n    $raw_params = null;\n    try {\n      $raw_params = phutil_json_decode($json);\n    } catch (PhutilJSONParserException $ex) {\n      throw new PhutilProxyException(\n        pht('Invalid JSON input.'),\n        $ex);\n    }\n\n    $params = idx($raw_params, 'params', '[]');\n    $params = phutil_json_decode($params);\n    $metadata = idx($params, '__conduit__', array());\n    unset($params['__conduit__']);","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/conduit/ssh/ConduitSSHWorkflow.php#L5-L41","documentation":"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.","triggerScenarios":"Running `ssh ... conduit maniphest.task.search 123` expecting 123 to be an argument; a quoting error that splits one argument into two tokens.","commonSituations":"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.","solutions":["Keep exactly one token after 'conduit' (the method name) and pass every parameter via the JSON stdin payload.","Check shell quoting/word-splitting if you believe you passed only one token."],"exampleFix":"# before\n$ echo '{\"params\":\"{}\"}' | ssh -p 2222 vcs@phab.example.com conduit maniphest.task.search 123\n# after\n$ echo '{\"params\":\"{\\\"constraints\\\":{\\\"ids\\\":[123]}}\"}' | ssh -p 2222 vcs@phab.example.com conduit maniphest.task.search","handlingStrategy":"validation","validationCode":"# Exactly one method token; parameters go in the stdin JSON.\nset -- method_name_only\n[ \"$#\" -eq 1 ] || { echo 'one method, params via stdin JSON'; exit 2; }\necho \"$PAYLOAD\" | ssh -p 2222 vcs@phab.example.com conduit \"$1\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember the SSH conduit interface takes no CLI arguments besides the method name.","Quote the method argument so word splitting cannot produce extra tokens."],"tags":["conduit","ssh","cli","phabricator","php"],"backgroundTag":"invalid-cli-arguments","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}