{"record":{"id":"2ac911ef5c6955cc","repo":"phacility/phabricator","slug":"specify-a-file-to-read-parameters-from-with-inp","errorCode":null,"errorMessage":"Specify a file to read parameters from with \"--input\".","messagePattern":"Specify a file to read parameters from with \"--input\"\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/conduit/management/PhabricatorConduitCallManagementWorkflow.php","lineNumber":51,"sourceCode":"            '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(\n            'No such user \"%s\" exists.',\n            $as));\n      }\n\n      // Allow inline generation of user caches for the user we're acting\n      // as, since some calls may read user preferences.","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/conduit/management/PhabricatorConduitCallManagementWorkflow.php#L33-L69","documentation":"Usage exception from bin/conduit call: the --input argument is empty. The workflow reads method parameters from a file (typically JSON) and requires that path even for parameterless methods.","triggerScenarios":"Running ./bin/conduit call --method user.whoami with no --input; guessing a different flag name like --params or --data.","commonSituations":"Assuming parameterless methods need no input file; migrating from arc call-conduit where stdin echo '{}' is the idiom.","solutions":["Create a JSON file for the parameters (an empty object file for parameterless methods) and pass it with --input.","For quick tests: printf '{}' > /tmp/params.json && ./bin/conduit call --method user.whoami --input /tmp/params.json."],"exampleFix":"# before\n$ ./bin/conduit call --method user.whoami\n# after\n$ echo '{}' > /tmp/params.json\n$ ./bin/conduit call --method user.whoami --input /tmp/params.json","handlingStrategy":"validation","validationCode":"#!/bin/bash\nINPUT=\"${INPUT:-/tmp/conduit-params.json}\"\n[ -f \"$INPUT\" ] || printf '{}' > \"$INPUT\"   # parameterless methods still need a file\n./bin/conduit call --method \"$METHOD\" --input \"$INPUT\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always create the params file first, even when it is just '{}'.","Treat --method and --input as a pair; validate both in wrappers before executing."],"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"}