phacility/phabricator · error · PhutilArgumentUsageException
No identity "%s" exists. When selecting identities with "--r
Error message
No identity "%s" exists. When selecting identities with "--raw", the entire identity must match exactly.
What it means
With `--raw`, rebuild-identities looks identities up by exact match on the raw identity string (identityNameRaw — the full author/committer string exactly as it appeared in commit metadata, e.g. `Alice <alice@example.com>`). The query results are keyed by getIdentityNameRaw and every `--raw` value must be one of those keys; a value with no exact match raises this PhutilArgumentUsageException.
Source
Thrown at src/applications/repository/management/PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.php:167
$emails = $args->getArg('email');
if ($emails) {
$rebuilt_anything = true;
$this->rebuildEmails($emails);
}
if ($all_identities || $raw) {
$rebuilt_anything = true;
if ($raw) {
$identities = id(new PhabricatorRepositoryIdentityQuery())
->setViewer($viewer)
->withIdentityNames($raw)
->execute();
$identities = mpull($identities, null, 'getIdentityNameRaw');
foreach ($raw as $raw_identity) {
if (!isset($identities[$raw_identity])) {
throw new PhutilArgumentUsageException(
pht(
'No identity "%s" exists. When selecting identities with '.
'"--raw", the entire identity must match exactly.',
$raw_identity));
}
}
$identity_list = $identities;
} else {
$identity_query = id(new PhabricatorRepositoryIdentityQuery())
->setViewer($viewer);
$identity_list = new PhabricatorQueryIterator($identity_query);
$this->logInfo(
pht('REBUILD'),
pht('Rebuilding all existing identities.'));
}View on GitHub (pinned to 5720a38cfe)
Solutions
- Look up the exact stored string and pass it verbatim, e.g. `SELECT identityNameRaw FROM repository_identity WHERE identityNameRaw LIKE '%alice%';` or inspect the identity in the Diffusion/People UI, then quote it in the shell.
- If exact strings are awkward to gather, use `--all-identities` (optionally scoped with `--repository`) instead of `--raw`.
- If the identity should exist but does not, reparse the relevant commits first so identity rows get created, then retry.
Example fix
# before ./bin/repository rebuild-identities --raw 'alice@example.com' # Usage exception: No identity "alice@example.com" exists... # after: pass the full raw string exactly as stored ./bin/repository rebuild-identities --raw 'Alice <alice@example.com>'
Defensive patterns
Strategy: validation
Validate before calling
# Verify the exact raw string exists before passing --raw
raw='Alice <alice@example.com>'
count=$(mysql -N -B phabricator_repository -e \
"SELECT COUNT(*) FROM repository_identity WHERE identityNameRaw = '$raw'")
[ "$count" -ge 1 ] || { echo "identity not found (exact match required)" >&2; exit 1; }
./bin/repository rebuild-identities --raw "$raw" Prevention
- Treat `--raw` as byte-exact: copy the full raw string (display name plus email in angle brackets) from the database or UI.
- When unsure of the exact string, fall back to `--all-identities` scoped by `--repository`.
- Ensure commits carrying the identity have been parsed first so the identity row exists.
When it happens
Trigger: Passing only the email when the stored raw string is `Name <email>`; wrong casing, extra whitespace, or different display name; a raw string for which no PhabricatorRepositoryIdentity row exists (commits carrying it were never parsed).
Common situations: Assuming `--raw` accepts a bare email or a fuzzy substring; identities created only after commit parsing, so brand-new or never-parsed authors have no row; cut-and-paste from `git log` that mangles whitespace or unicode names.
Related errors
- Flags "--all-repositories" and "--repository" are not compat
- Flags "--all-identities" and "--raw" are not compatible.
- Nothing specified to rebuild. Use flags to choose which iden
- Specify a method to call with "--method".
- Specify a file to read parameters from with "--input".
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/59c18b83f8c53437.
Report an issue: GitHub.