{"record":{"id":"87c13b3f1b49998b","repo":"phacility/phabricator","slug":"no-such-user-s-to-recover","errorCode":null,"errorMessage":"No such user \"%s\" to recover.","messagePattern":"No such user \"(.+?)\" to recover\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/auth/management/PhabricatorAuthManagementRecoverWorkflow.php","lineNumber":46,"sourceCode":"  public function execute(PhutilArgumentParser $args) {\n    $usernames = $args->getArg('username');\n    if (!$usernames) {\n      throw new PhutilArgumentUsageException(\n        pht('You must specify the username of the account to recover.'));\n    } else if (count($usernames) > 1) {\n      throw new PhutilArgumentUsageException(\n        pht('You can only recover the username for one account.'));\n    }\n\n    $username = head($usernames);\n\n    $user = id(new PhabricatorPeopleQuery())\n      ->setViewer($this->getViewer())\n      ->withUsernames(array($username))\n      ->executeOne();\n\n    if (!$user) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'No such user \"%s\" to recover.',\n          $username));\n    }\n\n    if (!$user->canEstablishWebSessions()) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'This account (\"%s\") can not establish web sessions, so it is '.\n          'not possible to generate a functional recovery link. Special '.\n          'accounts like daemons and mailing lists can not log in via the '.\n          'web UI.',\n          $username));\n    }\n\n    $force_full_session = $args->getArg('force-full-session');\n\n    $engine = new PhabricatorAuthSessionEngine();","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/auth/management/PhabricatorAuthManagementRecoverWorkflow.php#L28-L64","documentation":"PhabricatorPeopleQuery->withUsernames(array($username))->executeOne() returns null: the exact, case-sensitive username matches no Phabricator user account, so there is nothing to generate a recovery link for and the workflow aborts.","triggerScenarios":"Typo or case mismatch in the username argument; the user was renamed, disabled, or deleted; attempting to recover a name that exists only in an external directory (LDAP/SSO) but has never logged in to create a Phabricator account.","commonSituations":"Case-sensitive username mismatches; retired/renamed accounts; assuming directory users exist in Phabricator before first login.","solutions":["Verify the exact username spelling and case in the People application (or copy it from the user's profile URL).","If the user was renamed, recover using the current username, not the old one.","If no Phabricator account exists yet, create/import one first — recovery applies only to existing accounts."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify before invoking the workflow.\n$user = id(new PhabricatorPeopleQuery())\n  ->setViewer(PhabricatorUser::getOmnipotentUser())\n  ->withUsernames(array($username))\n  ->executeOne();\nif (!$user) {\n  // fail early with 'unknown username' instead of running the workflow\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy-paste usernames from the People application or profile URL.","Usernames are matched exactly, including case.","Recovery applies only to existing Phabricator accounts, not directory-only names."],"tags":["cli","user-not-found","account-recovery","phabricator"],"backgroundTag":"user-not-found","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}