phacility/phabricator · error · PhutilArgumentUsageException

No user with username "%s" exists.

Error message

No user with username "%s" exists.

What it means

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.

Source

Thrown at src/applications/aphlict/management/PhabricatorAphlictManagementNotifyWorkflow.php:41

  }

  public function execute(PhutilArgumentParser $args) {
    $viewer = $this->getViewer();

    $username = $args->getArg('user');
    if (!strlen($username)) {
      throw new PhutilArgumentUsageException(
        pht(
          'Specify a user to notify with "--user".'));
    }

    $user = id(new PhabricatorPeopleQuery())
      ->setViewer($viewer)
      ->withUsernames(array($username))
      ->executeOne();

    if (!$user) {
      throw new PhutilArgumentUsageException(
        pht(
          'No user with username "%s" exists.',
          $username));
    }

    $message = $args->getArg('message');
    if (!strlen($message)) {
      throw new PhutilArgumentUsageException(
        pht(
          'Specify a message to send with "--message".'));
    }

    $application_phid = id(new PhabricatorNotificationsApplication())
      ->getPHID();

    $content_source = $this->newContentSource();

    $xactions = array();

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Get the exact username from the account's profile page or people query and retry.
  2. Verify the account still exists and is not deleted/disabled.
  3. Remember --user takes the username, not the real name or email address.
Defensive patterns

Strategy: validation

Validate before calling

$user = id(new PhabricatorPeopleQuery())
  ->setViewer($viewer)
  ->withUsernames(array($username))
  ->executeOne();
if (!$user) {
  throw new Exception("No account with username '{$username}'; check exact spelling/case.");
}

Try / catch

try {
  // execute notify workflow
} catch (PhutilArgumentUsageException $ex) {
  if (preg_match('/No user with username/', $ex->getMessage())) {
    // Re-resolve the username from the people directory, then retry once.
  } else {
    throw $ex;
  }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/d7afc76fcce61b1c. Report an issue: GitHub.