{"record":{"id":"64ee476f1d90563b","repo":"phacility/phabricator","slug":"no-user-with-username-s-exists-64ee47","errorCode":null,"errorMessage":"No user with username \"%s\" exists.","messagePattern":"No user with username \"(.+?)\" exists\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/policy/management/PhabricatorPolicyManagementUnlockWorkflow.php","lineNumber":151,"sourceCode":"    }\n\n    return 0;\n  }\n\n  private function loadUser($username) {\n    $viewer = $this->getViewer();\n\n    if ($username === null) {\n      return null;\n    }\n\n    $user = id(new PhabricatorPeopleQuery())\n      ->setViewer($viewer)\n      ->withUsernames(array($username))\n      ->executeOne();\n\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}\n","sourceCodeStart":133,"sourceCodeEnd":161,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/policy/management/PhabricatorPolicyManagementUnlockWorkflow.php#L133-L161","documentation":"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.","triggerScenarios":"./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.","commonSituations":"Typos, renamed users, and usernames copied from another install or a stale runbook.","solutions":["Copy the exact username from the user's profile page (the /p/USERNAME/ part of the URL) and retry.","If the user was renamed or disabled, pick a current active username."],"exampleFix":"# before\n./bin/policy unlock T123 --view alise\n# after (exact username from /p/alice/)\n./bin/policy unlock T123 --view alice","handlingStrategy":"validation","validationCode":"// Screen usernames before passing them to --view/--edit/--owner,\n// mirroring the workflow's own lookup.\n$user = id(new PhabricatorPeopleQuery())\n  ->setViewer(PhabricatorUser::getOmnipotentUser())\n  ->withUsernames(array($username))\n  ->executeOne();\nif (!$user) {\n  // skip this username; unlock would throw PhutilArgumentUsageException\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy usernames from profile URLs (/p/USERNAME/) rather than retyping them.","Re-check usernames after user renames or cross-install runbook copies."],"tags":["phabricator","cli","user-not-found","unlock"],"backgroundTag":"user-not-found","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}