phacility/phabricator · warning · PhutilArgumentUsageException

Flags "--all-identities" and "--raw" are not compatible.

Error message

Flags "--all-identities" and "--raw" are not compatible.

What it means

In `bin/repository rebuild-identities`, `--all-identities` rebuilds every existing identity while `--raw` selects identities by their exact raw identity string. Both flags given together is contradictory (select-all plus explicit selection), so the workflow rejects the combination up front with this PhutilArgumentUsageException.

Source

Thrown at src/applications/repository/management/PhabricatorRepositoryManagementRebuildIdentitiesWorkflow.php:83

    $rebuilt_anything = false;

    $all_repositories = $args->getArg('all-repositories');
    $repositories = $args->getArg('repository');

    if ($all_repositories && $repositories) {
      throw new PhutilArgumentUsageException(
        pht(
          'Flags "--all-repositories" and "--repository" are not '.
          'compatible.'));
    }


    $all_identities = $args->getArg('all-identities');
    $raw = $args->getArg('raw');

    if ($all_identities && $raw) {
      throw new PhutilArgumentUsageException(
        pht(
          'Flags "--all-identities" and "--raw" are not '.
          'compatible.'));
    }

    $dry_run = $args->getArg('dry-run');
    $this->dryRun = $dry_run;

    if ($this->dryRun) {
      $this->logWarn(
        pht('DRY RUN'),
        pht('This is a dry run, so no changes will be written.'));
    }

    if ($all_repositories || $repositories) {
      $rebuilt_anything = true;

      if ($repositories) {

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Drop `--raw` to rebuild all identities, or drop `--all-identities` and pass only the exact raw strings you need.
  2. Make wrapper logic pick one mode: bulk rebuild or targeted rebuild, never both.

Example fix

# before
./bin/repository rebuild-identities --all-identities --raw 'Alice <alice@example.com>'

# after: targeted rebuild only
./bin/repository rebuild-identities --raw 'Alice <alice@example.com>'
# or bulk rebuild only
./bin/repository rebuild-identities --all-identities
Defensive patterns

Strategy: validation

Validate before calling

# Shell guard before invoking rebuild-identities
if [ -n "$RAW" ] && [ "$ALL_IDS" = "1" ]; then
  echo "--raw and --all-identities are mutually exclusive" >&2
  exit 2
fi
./bin/repository rebuild-identities ${RAW:+--raw "$RAW"} ${ALL_IDS:+--all-identities}

Prevention

When it happens

Trigger: Running `./bin/repository rebuild-identities --all-identities --raw 'Alice <alice@example.com>'` or any invocation where both `--all-identities` and `--raw` are truthy.

Common situations: Operator history reuse; wrapper scripts that always set `--all-identities` and also forward explicit raw strings when a user supplies them.

Related errors


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