phacility/phabricator · error · PhutilArgumentUsageException

No user with username "%s" exists.

Error message

No user with username "%s" exists.

What it means

selectUser() ran PhabricatorPeopleQuery with the exact --user value and executeOne() returned nothing, so no account with that username exists (never created, renamed away, deleted, or not resolvable to the acting viewer). The workflow aborts with a PhutilArgumentUsageException naming the username it failed to find.

Source

Thrown at src/applications/people/management/PhabricatorPeopleManagementWorkflow.php:30

      ),
    );
  }

  final protected function selectUser(PhutilArgumentParser $argv) {
    $username = $argv->getArg('user');

    if (!strlen($username)) {
      throw new PhutilArgumentUsageException(
        pht(
          'Select a user account to act on with "--user <username>".'));
    }

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

    return $user;
  }

  final protected function applyTransactions(
    PhabricatorUser $user,
    array $xactions) {
    assert_instances_of($xactions, 'PhabricatorUserTransaction');

    $viewer = $this->getViewer();
    $application = id(new PhabricatorPeopleApplication())->getPHID();
    $content_source = $this->newContentSource();

    $editor = $user->getApplicationTransactionEditor()

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Confirm the exact username via the People application (admin UI) or `./bin/user search`
  2. Check for renames - the previous username is gone; ask the user or check transaction history
  3. If the account should exist, create it (standard auth signup or your provisioning flow) or fix the username source in your script

Example fix

# before
./bin/people approve --user alise   # typo
# after
./bin/user search --format json | grep '"userName"'  # find the exact name, then:
# ./bin/people approve --user alice
Defensive patterns

Strategy: validation

Validate before calling

// Resolve the username before acting on it
$user = id(new PhabricatorPeopleQuery())
  ->setViewer($viewer)
  ->withUsernames(array($username))
  ->executeOne();
if (!$user) {
  throw new Exception("Unknown username: {$username}");
}

Prevention

When it happens

Trigger: Typo in `--user alise` instead of `alice`; the account was renamed so the old username no longer resolves; referencing a bot/system agent that was deleted; scripts deriving the username from an email prefix or HR feed that drifted.

Common situations: Renamed users breaking stale runbooks; automation building usernames from external directories; fresh clones of production data where the account was never created.

Related errors


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