{"record":{"id":"160ea395de60b0ea","repo":"phacility/phabricator","slug":"no-user-with-username-s-exists-160ea3","errorCode":null,"errorMessage":"No user with username \"%s\" exists.","messagePattern":"No user with username \"(.+?)\" exists\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"error","filePath":"src/applications/people/management/PhabricatorPeopleManagementWorkflow.php","lineNumber":30,"sourceCode":"      ),\n    );\n  }\n\n  final protected function selectUser(PhutilArgumentParser $argv) {\n    $username = $argv->getArg('user');\n\n    if (!strlen($username)) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Select a user account to act on with \"--user <username>\".'));\n    }\n\n    $user = id(new PhabricatorPeopleQuery())\n      ->setViewer($this->getViewer())\n      ->withUsernames(array($username))\n      ->executeOne();\n    if (!$user) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'No user with username \"%s\" exists.',\n          $username));\n    }\n\n    return $user;\n  }\n\n  final protected function applyTransactions(\n    PhabricatorUser $user,\n    array $xactions) {\n    assert_instances_of($xactions, 'PhabricatorUserTransaction');\n\n    $viewer = $this->getViewer();\n    $application = id(new PhabricatorPeopleApplication())->getPHID();\n    $content_source = $this->newContentSource();\n\n    $editor = $user->getApplicationTransactionEditor()","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/people/management/PhabricatorPeopleManagementWorkflow.php#L12-L48","documentation":"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.","triggerScenarios":"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.","commonSituations":"Renamed users breaking stale runbooks; automation building usernames from external directories; fresh clones of production data where the account was never created.","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"],"exampleFix":"# before\n./bin/people approve --user alise   # typo\n# after\n./bin/user search --format json | grep '\"userName\"'  # find the exact name, then:\n# ./bin/people approve --user alice","handlingStrategy":"validation","validationCode":"// Resolve the username before acting on it\n$user = id(new PhabricatorPeopleQuery())\n  ->setViewer($viewer)\n  ->withUsernames(array($username))\n  ->executeOne();\nif (!$user) {\n  throw new Exception(\"Unknown username: {$username}\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["phabricator","cli","people","username","lookup-failed"],"backgroundTag":"unknown-username","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}