phacility/phabricator · warning · PhutilArgumentUsageException

No such user "%s"!

Error message

No such user "%s"!

What it means

bin/auth refresh --user <name> filters the OAuth token refresh by a Phabricator user; when PhabricatorPeopleQuery finds no user with that exact username, the workflow aborts with this usage exception before querying external accounts.

Source

Thrown at src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php:45

    $query = id(new PhabricatorExternalAccountQuery())
      ->setViewer($viewer)
      ->requireCapabilities(
        array(
          PhabricatorPolicyCapability::CAN_VIEW,
          PhabricatorPolicyCapability::CAN_EDIT,
        ));

    $username = $args->getArg('user');
    if (strlen($username)) {
      $user = id(new PhabricatorPeopleQuery())
        ->setViewer($viewer)
        ->withUsernames(array($username))
        ->executeOne();
      if ($user) {
        $query->withUserPHIDs(array($user->getPHID()));
      } else {
        throw new PhutilArgumentUsageException(
          pht('No such user "%s"!', $username));
      }
    }

    $accounts = $query->execute();

    if (!$accounts) {
      throw new PhutilArgumentUsageException(
        pht('No accounts match the arguments!'));
    } else {
      $console->writeOut(
        "%s\n",
        pht(
          'Found %s account(s) to refresh.',
          phutil_count($accounts)));
    }

    $providers = PhabricatorAuthProvider::getAllEnabledProviders();

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Fix the username spelling (exact, case-sensitive) and re-run.
  2. Run './bin/auth refresh' without --user to refresh all external accounts, then narrow once names are confirmed.

Example fix

// before
./bin/auth refresh --user alinceoln
// after
./bin/auth refresh --user alincoln
Defensive patterns

Strategy: validation

Validate before calling

// Verify before invoking the workflow.
$user = id(new PhabricatorPeopleQuery())
  ->setViewer(PhabricatorUser::getOmnipotentUser())
  ->withUsernames(array($username))
  ->executeOne();
if (!$user) {
  // fail early with 'unknown username' instead of running the workflow
}

Prevention

When it happens

Trigger: Running './bin/auth refresh --user alinceoln' (typo), or a username that exists only in the external IdP and has no Phabricator account.

Common situations: Case-sensitive or misspelled usernames; renamed users; local-only testing with names that were never provisioned.

Related errors


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