{"record":{"id":"d7afc76fcce61b1c","repo":"phacility/phabricator","slug":"no-user-with-username-s-exists","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/aphlict/management/PhabricatorAphlictManagementNotifyWorkflow.php","lineNumber":41,"sourceCode":"  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $viewer = $this->getViewer();\n\n    $username = $args->getArg('user');\n    if (!strlen($username)) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Specify a user to notify with \"--user\".'));\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    $message = $args->getArg('message');\n    if (!strlen($message)) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Specify a message to send with \"--message\".'));\n    }\n\n    $application_phid = id(new PhabricatorNotificationsApplication())\n      ->getPHID();\n\n    $content_source = $this->newContentSource();\n\n    $xactions = array();","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/aphlict/management/PhabricatorAphlictManagementNotifyWorkflow.php#L23-L59","documentation":"The Aphlict notify workflow found no user account matching the --user value. PhabricatorPeopleQuery withUsernames(array($username)) is an exact, case-sensitive match on username; executeOne() returning null means no such account is visible to the viewer.","triggerScenarios":"Passing --user alice when the account's username is 'alice.b' or 'Alice'; referencing a deleted/renamed account; typing the display name or email instead of the username.","commonSituations":"Usernames changed during an SSO migration; operators using the human-readable name from the UI rather than the username; testing against an install where the account was never created.","solutions":["Get the exact username from the account's profile page or people query and retry.","Verify the account still exists and is not deleted/disabled.","Remember --user takes the username, not the real name or email address."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"$user = id(new PhabricatorPeopleQuery())\n  ->setViewer($viewer)\n  ->withUsernames(array($username))\n  ->executeOne();\nif (!$user) {\n  throw new Exception(\"No account with username '{$username}'; check exact spelling/case.\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  // execute notify workflow\n} catch (PhutilArgumentUsageException $ex) {\n  if (preg_match('/No user with username/', $ex->getMessage())) {\n    // Re-resolve the username from the people directory, then retry once.\n  } else {\n    throw $ex;\n  }\n}","preventionTips":["Use the username exactly as shown on the profile URL, not display name or email.","Look up usernames programmatically in automation instead of storing them in config.","After account renames/deletions, update notification scripts the same day."],"tags":["aphlict","notifications","user-not-found","cli","phabricator"],"backgroundTag":"entity-not-found","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}