{"record":{"id":"977e6d096f945ba1","repo":"phacility/phabricator","slug":"no-such-user-with-username-s","errorCode":null,"errorMessage":"No such user with username \"%s\"!","messagePattern":"No such user with username \"(.+?)\"!","errorType":"exception","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"error","filePath":"src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php","lineNumber":244,"sourceCode":"\n    return 0;\n  }\n\n  private function loadUsers($users) {\n    $users = $this->parseList($users);\n    if (!$users) {\n      return null;\n    }\n\n    $objects = id(new PhabricatorPeopleQuery())\n      ->setViewer($this->getViewer())\n      ->withUsernames($users)\n      ->execute();\n    $objects = mpull($objects, null, 'getUsername');\n\n    foreach ($users as $name) {\n      if (empty($objects[$name])) {\n        throw new PhutilArgumentUsageException(\n          pht('No such user with username \"%s\"!', $name));\n      }\n    }\n\n    return $objects;\n  }\n\n  private function parseList($list) {\n    $list = preg_split('/\\s*,\\s*/', $list);\n\n    foreach ($list as $key => $item) {\n      $list[$key] = trim($item);\n    }\n\n    foreach ($list as $key => $item) {\n      if (!strlen($item)) {\n        unset($list[$key]);\n      }","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php#L226-L262","documentation":"Thrown by the audit delete workflow's loadUsers() when one of the usernames passed via --users does not match any Phabricator user. All requested usernames are resolved via PhabricatorPeopleQuery; each missing name aborts the run before any deletion happens.","triggerScenarios":"--users alice,bob where 'bob' has a typo (b0b), was renamed, or was deleted/disabled; case mismatch against the stored username.","commonSituations":"Retyping usernames by hand instead of copying them; running the command long after a user left and their account was renamed or removed; scripts with hard-coded user lists drifting out of date.","solutions":["Verify the exact username: bin/user query bob (or search in People) and copy-paste it into --users","Remove ex-users from the list if their audit data no longer needs deletion","Usernames are case-sensitive here — match the stored casing exactly"],"exampleFix":"# before\n$ bin/audit delete --users alice,b0b\n# after\n$ bin/audit delete --users alice,bob --dry-run","handlingStrategy":"validation","validationCode":"$objects = id(new PhabricatorPeopleQuery())\n  ->setViewer($viewer)\n  ->withUsernames($names)\n  ->execute();\n$found = mpull($objects, null, 'getUsername');\nforeach ($names as $name) {\n  if (empty($found[$name])) {\n    throw new InvalidArgumentException(\"Unknown username '{$name}'\");\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Resolve usernames against PhabricatorPeopleQuery (or bin/user query) before building destructive commands","Pull user lists dynamically instead of hard-coding them in scripts"],"tags":["audit","cli","user-lookup","phabricator"],"backgroundTag":"user-not-found","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}