phacility/phabricator · warning · PhutilArgumentUsageException

Names "%s" and "%s" identify the same object. Specify only u

Error message

Names "%s" and "%s" identify the same object. Specify only unique objects.

What it means

Thrown when two different name arguments resolve to the same underlying object (same PHID). Example: passing both `--object T123` and `--object PHID-TASK-xxxx` where the PHID belongs to T123. After each name resolves, the workflow maps results by PHID and rejects the list if one PHID would be selected twice through different spellings — the constraint must reference distinct objects.

Source

Thrown at src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementWorkflow.php:296

      ->setViewer($viewer)
      ->withNames($names);

    $object_query->execute();

    $name_map = $object_query->getNamedResults();
    $phid_map = array();
    foreach ($names as $name) {
      if (!isset($name_map[$name])) {
        throw new PhutilArgumentUsageException(
          pht(
            'No object with name "%s" could be loaded.',
            $name));
      }

      $phid = $name_map[$name]->getPHID();

      if (isset($phid_map[$phid])) {
        throw new PhutilArgumentUsageException(
          pht(
            'Names "%s" and "%s" identify the same object. Specify only '.
            'unique objects.',
            $name,
            $phid_map[$phid]));
      }

      $phid_map[$phid] = $name;
    }

    return array_keys($phid_map);
  }

}

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Keep only one spelling of each object in the command
  2. Canonicalize all names to PHIDs (or all to monograms) before building the argument list and de-duplicate

Example fix

# before
./bin/worker retry --object D12 --object PHID-DREV-abc123

# after
./bin/worker retry --object D12
Defensive patterns

Strategy: validation

Validate before calling

// Canonicalize every name to a PHID, then de-duplicate by PHID
$lookup = $client->callMethod('phid.lookup', array('names' => $names));
$phids = array();
foreach ($names as $name) {
  if (isset($lookup[$name])) {
    $phids[$lookup[$name]['phid']] = true;
  }
}
$unique_phids = array_keys($phids);

Prevention

When it happens

Trigger: Mixing monograms and PHIDs for the same object in one command: `--object D12 --object PHID-DREV-abc123`. Also two aliases/IDs that the object query normalizes to one object. Distinct names only — literal duplicates throw the earlier 'specified more than once' error.

Common situations: Scripts that merge a list of monograms from one system with PHIDs from another without canonicalizing; operators pasting a PHID to be 'safe' alongside the monogram; renamed/aliased objects where both spellings still resolve.

Related errors


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