phacility/phabricator · error · PhutilArgumentUsageException

Use %s to choose a user to reset actions for.

Error message

Use %s to choose a user to reset actions for.

What it means

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.

Source

Thrown at src/applications/auth/management/PhabricatorAuthManagementUnlimitWorkflow.php:31

          'rate-limited actions.'))
      ->setArguments(
        array(
          array(
            'name' => 'user',
            'param' => 'username',
            'help' => pht('Reset action counters for this user.'),
          ),
          array(
            'name' => 'all',
            'help' => pht('Reset all counters.'),
          ),
        ));
  }

  public function execute(PhutilArgumentParser $args) {
    $username = $args->getArg('user');
    if (!strlen($username)) {
      throw new PhutilArgumentUsageException(
        pht(
          'Use %s to choose a user to reset actions for.', '--user'));
    }

    $user = id(new PhabricatorPeopleQuery())
      ->setViewer($this->getViewer())
      ->withUsernames(array($username))
      ->executeOne();
    if (!$user) {
      throw new PhutilArgumentUsageException(
        pht(
          'No user exists with username "%s".',
          $username));
    }

    $all = $args->getArg('all');
    if (!$all) {
      // TODO: Eventually, let users reset specific actions. For now, we

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Re-run the command with the username: `bin/auth unlimit --user <username> --all`.
  2. If scripting, verify the variable is non-empty before invoking (e.g. `: "${USERNAME:?unset}"`).
  3. Run `bin/auth help unlimit` to confirm the accepted flags.

Example fix

// before
$ bin/auth unlimit
Use --user to choose a user to reset actions for.

// after
$ bin/auth unlimit --user alice --all
Defensive patterns

Strategy: validation

Validate before calling

// Shell: fail fast when the variable is unset before invoking
: "${PHAB_USER:?--user value required}"

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/4086e43f68d25568. Report an issue: GitHub.