phacility/phabricator · warning · PhutilArgumentUsageException

No user with username "%s" exists.

Error message

No user with username "%s" exists.

What it means

loadUser() in the unlock workflow resolves each --view, --edit, and --owner username through PhabricatorPeopleQuery::withUsernames; a miss throws this usage exception naming the username that failed to resolve.

Source

Thrown at src/applications/policy/management/PhabricatorPolicyManagementUnlockWorkflow.php:151

    }

    return 0;
  }

  private function loadUser($username) {
    $viewer = $this->getViewer();

    if ($username === null) {
      return null;
    }

    $user = id(new PhabricatorPeopleQuery())
      ->setViewer($viewer)
      ->withUsernames(array($username))
      ->executeOne();

    if (!$user) {
      throw new PhutilArgumentUsageException(
        pht(
          'No user with username "%s" exists.',
          $username));
    }

    return $user;
  }

}

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Copy the exact username from the user's profile page (the /p/USERNAME/ part of the URL) and retry.
  2. If the user was renamed or disabled, pick a current active username.

Example fix

# before
./bin/policy unlock T123 --view alise
# after (exact username from /p/alice/)
./bin/policy unlock T123 --view alice
Defensive patterns

Strategy: validation

Validate before calling

// Screen usernames before passing them to --view/--edit/--owner,
// mirroring the workflow's own lookup.
$user = id(new PhabricatorPeopleQuery())
  ->setViewer(PhabricatorUser::getOmnipotentUser())
  ->withUsernames(array($username))
  ->executeOne();
if (!$user) {
  // skip this username; unlock would throw PhutilArgumentUsageException
}

Prevention

When it happens

Trigger: ./bin/policy unlock T123 --view alise with a typo, a renamed user's old username, or a name that is not a real user account in this install.

Common situations: Typos, renamed users, and usernames copied from another install or a stale runbook.

Related errors


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