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
- Confirm the exact username via the People application (admin UI) or `./bin/user search`
- Check for renames - the previous username is gone; ask the user or check transaction history
- 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
- Look up exact usernames via the People application or Conduit user.query before running commands
- Track renames - old usernames stop resolving
- Derive usernames from a canonical source (LDAP/SSO/HR), not free-text input
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
- User account "%s" is already approved. You can only approve
- User account "%s" is already an administrator. You can only
- User account "%s" is not disabled. You can only enable accou
- Select a user account to act on with "--user <username>".
- Request parameter "%s" is not formatted properly. Expected a
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/160ea395de60b0ea.
Report an issue: GitHub.