{"record":{"id":"254bc758d99339d1","repo":"phacility/phabricator","slug":"specify-a-method-to-call-with-method","errorCode":null,"errorMessage":"Specify a method to call with \"--method\".","messagePattern":"Specify a method to call with \"--method\"\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/conduit/management/PhabricatorConduitCallManagementWorkflow.php","lineNumber":45,"sourceCode":"              'Force the request to execute in this process, rather than '.\n              'proxying to another host in the cluster.'),\n          ),\n          array(\n            'name' => 'as',\n            'param' => 'username',\n            'help' => pht(\n              'Execute the call as the given user. (If omitted, the call will '.\n              'be executed as an omnipotent user.)'),\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $viewer = $this->getViewer();\n\n    $method = $args->getArg('method');\n    if (!strlen($method)) {\n      throw new PhutilArgumentUsageException(\n        pht('Specify a method to call with \"--method\".'));\n    }\n\n    $input = $args->getArg('input');\n    if (!strlen($input)) {\n      throw new PhutilArgumentUsageException(\n        pht('Specify a file to read parameters from with \"--input\".'));\n    }\n\n    $as = $args->getArg('as');\n    if (strlen($as)) {\n      $actor = id(new PhabricatorPeopleQuery())\n        ->setViewer($viewer)\n        ->withUsernames(array($as))\n        ->executeOne();\n      if (!$actor) {\n        throw new PhutilArgumentUsageException(\n          pht(","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/conduit/management/PhabricatorConduitCallManagementWorkflow.php#L27-L63","documentation":"Usage exception from the bin/conduit call management workflow: the --method argument is empty (absent or given an empty value). The command requires a method name plus an input file, and refuses to run without them.","triggerScenarios":"Running ./bin/conduit call --input params.json while forgetting --method; misspelling the flag (e.g. --methods); a wrapper script passing an empty $METHOD shell variable.","commonSituations":"Shell wrappers and cron jobs where the method variable is unset for some records; copy-pasting the command from docs that omit the flag.","solutions":["Add --method <conduit.method.name> to the command line.","If it still fails, run ./bin/conduit help call to confirm expected flags for your version.","Guard wrapper scripts so they abort early when the method variable is empty."],"exampleFix":"# before\n$ ./bin/conduit call --input params.json\n# after\n$ ./bin/conduit call --method user.whoami --input params.json","handlingStrategy":"validation","validationCode":"#!/bin/bash\n# Fail fast in wrappers before invoking bin/conduit.\nMETHOD=\"${METHOD:?Set METHOD to a Conduit method name}\"\nINPUT=\"${INPUT:?Set INPUT to a params file path}\"\n./bin/conduit call --method \"$METHOD\" --input \"$INPUT\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Require and default both flags in wrapper scripts with parameter expansion guards.","Keep a working command line in the project docs and copy from it rather than retyping."],"tags":["conduit","cli","usage","phabricator","php"],"backgroundTag":"missing-cli-argument","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}