{"record":{"id":"f93d1ea3650173a6","repo":"phacility/phabricator","slug":"specify-an-oauth-client-id-with-s","errorCode":null,"errorMessage":"Specify an OAuth client ID with %s.","messagePattern":"Specify an OAuth client ID with (.+?)\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"error","filePath":"src/applications/auth/management/PhabricatorAuthManagementUntrustOAuthClientWorkflow.php","lineNumber":28,"sourceCode":"      ->setSynopsis(\n        pht(\n          'Remove trust from an OAuth client. Users must manually confirm '.\n          'reauthorization of untrusted OAuth clients.'))\n      ->setArguments(\n        array(\n          array(\n            'name' => 'id',\n            'param' => 'id',\n            'help' => pht('The id of the OAuth client.'),\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $id = $args->getArg('id');\n\n    if (!$id) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Specify an OAuth client ID with %s.',\n          '--id'));\n    }\n\n    $client = id(new PhabricatorOAuthServerClientQuery())\n      ->setViewer($this->getViewer())\n      ->withIDs(array($id))\n      ->executeOne();\n\n    if (!$client) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Failed to find an OAuth client with ID %s.', $id));\n    }\n\n    if (!$client->getIsTrusted()) {\n      throw new PhutilArgumentUsageException(","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/auth/management/PhabricatorAuthManagementUntrustOAuthClientWorkflow.php#L10-L46","documentation":"Thrown by `bin/auth untrust-oauth-client` when the `--id` argument is omitted, empty, or evaluates falsy. The workflow requires a numeric OAuth client ID up front and aborts with this PhutilArgumentUsageException before constructing any query. No database access has happened yet.","triggerScenarios":"Running `bin/auth untrust-oauth-client` with no flags, or with an empty `--id` value (e.g. `--id \"$CLIENT_ID\"` where the shell variable is unset); passing the ID positionally instead of via `--id`.","commonSituations":"Automation script interpolates a missing variable; the operator assumes a positional argument works; the ID was left off because the operator expected an interactive prompt.","solutions":["Re-run with the flag: `bin/auth untrust-oauth-client --id <client-id>`.","Find the numeric client ID in Applications -> OAuth Server or via `SELECT id, name FROM oauth_server_oauthserverclient;`.","Guard scripts with a check that the ID variable is non-empty before invoking the command."],"exampleFix":"// before\n$ bin/auth untrust-oauth-client\nSpecify an OAuth client ID with --id.\n\n// after\n$ bin/auth untrust-oauth-client --id 7","handlingStrategy":"validation","validationCode":"// Guard scripts: refuse to invoke without an id\nif [ -z \"$CLIENT_ID\" ]; then echo \"CLIENT_ID required\" >&2; exit 2; fi\nbin/auth untrust-oauth-client --id \"$CLIENT_ID\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass `--id <numeric-id>`; the workflow takes no positional ID.","Quote shell variables and assert they are non-empty before invoking.","Keep the command template with the flag in your runbook."],"tags":["phabricator","cli","oauth","usage-exception","missing-argument"],"backgroundTag":"missing-cli-argument","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}