{"record":{"id":"4086e43f68d25568","repo":"phacility/phabricator","slug":"use-s-to-choose-a-user-to-reset-actions-for","errorCode":null,"errorMessage":"Use %s to choose a user to reset actions for.","messagePattern":"Use (.+?) to choose a user to reset actions for\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"error","filePath":"src/applications/auth/management/PhabricatorAuthManagementUnlimitWorkflow.php","lineNumber":31,"sourceCode":"          'rate-limited actions.'))\n      ->setArguments(\n        array(\n          array(\n            'name' => 'user',\n            'param' => 'username',\n            'help' => pht('Reset action counters for this user.'),\n          ),\n          array(\n            'name' => 'all',\n            'help' => pht('Reset all counters.'),\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $username = $args->getArg('user');\n    if (!strlen($username)) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Use %s to choose a user to reset actions for.', '--user'));\n    }\n\n    $user = id(new PhabricatorPeopleQuery())\n      ->setViewer($this->getViewer())\n      ->withUsernames(array($username))\n      ->executeOne();\n    if (!$user) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'No user exists with username \"%s\".',\n          $username));\n    }\n\n    $all = $args->getArg('all');\n    if (!$all) {\n      // TODO: Eventually, let users reset specific actions. For now, we","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/auth/management/PhabricatorAuthManagementUnlimitWorkflow.php#L13-L49","documentation":"Thrown by `bin/auth unlimit` when the `--user` argument is omitted or empty. The workflow reads `$args->getArg('user')` and requires a non-empty string before it can look up the user whose action rate-limit counters should be reset. It is a pure command-line usage error (PhutilArgumentUsageException) raised before any database access.","triggerScenarios":"Running `bin/auth unlimit` with no arguments, or with `--user ''` / `--user=` (empty value) via a shell script variable that was unset or expanded to nothing.","commonSituations":"A shell script interpolates an unbound variable (`--user \"$USERNAME\"` with USERNAME unset); the admin assumes the command operates on all users without flags; documentation or muscle memory from a different tool omits the flag.","solutions":["Re-run the command with the username: `bin/auth unlimit --user <username> --all`.","If scripting, verify the variable is non-empty before invoking (e.g. `: \"${USERNAME:?unset}\"`).","Run `bin/auth help unlimit` to confirm the accepted flags."],"exampleFix":"// before\n$ bin/auth unlimit\nUse --user to choose a user to reset actions for.\n\n// after\n$ bin/auth unlimit --user alice --all","handlingStrategy":"validation","validationCode":"// Shell: fail fast when the variable is unset before invoking\n: \"${PHAB_USER:?--user value required}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `bin/auth help unlimit` before scripting the command.","Set shell `set -u` in ops scripts so unset variables abort immediately.","Keep a reviewed snippet of the exact invocation in your runbook."],"tags":["phabricator","cli","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"}